Last active
November 26, 2015 13:01
-
-
Save kevinkirkup/9edd97dba87fa0936e52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an enum for the tags specified in IB | |
enum TabItems : Int { | |
case FirstTab = 0 | |
case SecondTab | |
case ThirdTab | |
} | |
// Use a switch to handle each item | |
for item in self.tabBar.items { | |
if let tabItem = TabItems(fromraw: item.tag) { | |
switch tabItem { | |
case .FirstTab: | |
println("first tab") | |
case .SecondTab: | |
println("second tab") | |
default: | |
println("not recognized") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment