Created
July 31, 2015 08:27
-
-
Save whiskey/4def64050c7afdadb6c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| enum FormSection: Int { | |
| case Header, Section1, Section2, Section2, Section3, Summary | |
| static let identifiers = [ | |
| Header: "header", | |
| Section1: "s1", | |
| Section2: "s2", | |
| Section3: "s3", | |
| Summary: "summary" | |
| ] | |
| static let sectionHeaders = [ | |
| Section1: NSLocalizedString("foo1", comment: "bar1"), | |
| Section2: NSLocalizedString("foo2", comment: "bar2"), | |
| Section3: NSLocalizedString("foo3", comment: "bar3") | |
| Summary: NSLocalizedString("header.summary", comment: "lalala"), | |
| ] | |
| static var count:Int { return 5 } | |
| func identifier() -> String { | |
| if let id = FormSection.identifiers[self] { | |
| return id | |
| } else { | |
| return "undefined" | |
| } | |
| } | |
| func headerTitle() -> String? { | |
| if let string = FormSection.sectionHeaders[self] { | |
| return string | |
| } else { | |
| return nil | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment