Skip to content

Commit

Permalink
Removed duplicated label update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick DiZazzo committed Sep 6, 2017
1 parent 23c92f3 commit 09935db
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 18 deletions.
99 changes: 84 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
11 changes: 8 additions & 3 deletions BiomeDemo/BiomeDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
}
}

0 comments on commit 09935db

Please sign in to comment.