Created
January 3, 2017 14:08
-
-
Save diederikh/9236c6c7d52c444bed9d1d11c2bdc6d9 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
class FontSizesDataSource: UITableViewDataSource { | |
private let fontSizeMultiplierDescriptions: [FontSizeMultiplier] = [.small, .normal, .large, .extraLarge] | |
var numberOfSections: Int { | |
return 1 | |
} | |
func numberOfItemsInSection(index: Int) -> Int { | |
return fontSizeMultiplierDescriptions.count | |
} | |
func cell(tableView: UITableView, atIndexPath indexPath: IndexPath) -> UITableViewCell { | |
let cell = dequeueReusableCell(withIdentifier: T.reuseIdentifier, for: indexPath) | |
cell.titleLabel?.text = fontSizeMultiplierDescriptions[indexPath.row].localizedFontSizeName() | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment