Last active
October 16, 2015 20:34
-
-
Save abbeyjackson/06352bca2d626d2f69cc to your computer and use it in GitHub Desktop.
Multiple buttons with same protocol - delegate function, using multiple IBActions instead of tags
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
func buttonPressed(tabBar: TabBar, section: SectionType) { | |
if arrayForSectionType(section).count > 0 { | |
tableView.scrollToRowAtIndexPath( (NSIndexPath(forRow: 0, inSection: section.rawValue)), atScrollPosition: .Top, animated: true) | |
} | |
} | |
func arrayForSectionType(type: SectionType) -> Array<FieldType> { | |
switch type { | |
case .CaseA: | |
return arrayA | |
case .CaseB | |
return arrayB | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment