From 09935dbbdf91c6b0be84af5a40270009d3b15780 Mon Sep 17 00:00:00 2001 From: Nick DiZazzo Date: Wed, 6 Sep 2017 19:52:22 -0400 Subject: [PATCH] Removed duplicated label update --- .gitignore | 99 ++++++++++++++++++++---- BiomeDemo/BiomeDemo/ViewController.swift | 11 ++- 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index e7b722d..77ede74 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,40 @@ -# OS X -.DS_Store +### macOS ### +*.DS_Store +.AppleDouble +.LSOverride +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Swift ### # Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated build/ +DerivedData/ + +## Various settings *.pbxuser !default.pbxuser *.mode1v3 @@ -12,22 +44,59 @@ build/ *.perspectivev3 !default.perspectivev3 xcuserdata/ -*.xccheckout -profile + +## Other *.moved-aside -DerivedData +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific *.hmap *.ipa +*.dSYM.zip +*.dSYM -# Bundler -.bundle +## Playgrounds +timeline.xctimeline +playground.xcworkspace -Carthage -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -# Note: if you ignore the Pods directory, make sure to uncomment -# `pod install` in .travis.yml +# Swift Package Manager # -# Pods/ +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +.build/ + +# CocoaPods - Refactored to standalone file + +# Carthage - Refactored to standalone file + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output + +### Xcode ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated + +## Various settings + +## Other + +### Xcode Patch ### +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcworkspace/contents.xcworkspacedata +/*.gcno diff --git a/BiomeDemo/BiomeDemo/ViewController.swift b/BiomeDemo/BiomeDemo/ViewController.swift index 5f2fedb..46ee65a 100644 --- a/BiomeDemo/BiomeDemo/ViewController.swift +++ b/BiomeDemo/BiomeDemo/ViewController.swift @@ -20,9 +20,10 @@ class ViewController: UIViewController { super.viewDidLoad() self.showBiomesButton?.layer.cornerRadius = 3.0 - + let currentBiome = BiomeManager.shared.current - self.apiURLLabel?.text = currentBiome?.get("api_url") as? String + + self.setupBiomeInfo(biome: currentBiome) } @IBAction func showBiomes(_ sender: Any) { @@ -37,11 +38,15 @@ class ViewController: UIViewController { self.navigationController?.pushViewController(tableViewController, animated: true) } + + func setupBiomeInfo(biome: Biome?) { + self.apiURLLabel?.text = biome?.get("api_url") as? String + } } extension ViewController: BiomeManagerDelegate { func switched(to biome: Biome?) { - self.apiURLLabel?.text = biome?.get("api_url") as? String + self.setupBiomeInfo(biome: biome) } }