Skip to content

Instantly share code, notes, and snippets.

@diederikh
Created January 3, 2017 14:08
Show Gist options
  • Save diederikh/9236c6c7d52c444bed9d1d11c2bdc6d9 to your computer and use it in GitHub Desktop.
Save diederikh/9236c6c7d52c444bed9d1d11c2bdc6d9 to your computer and use it in GitHub Desktop.
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