Skip to content

Instantly share code, notes, and snippets.

@hsylife
Last active March 10, 2017 12:29
Show Gist options
  • Save hsylife/674ecb725964714659d70777bef1854c to your computer and use it in GitHub Desktop.
Save hsylife/674ecb725964714659d70777bef1854c to your computer and use it in GitHub Desktop.
EurekaをSwift 2.3→3.0用にアップデートして遭遇したエラー例と解決方法 その1 ref: http://qiita.com/hsylife/items/e612221c28cc367525df
public var row: RowOf<Row.Cell.Value>!
public override func viewDidLoad() {
super.viewDidLoad()
guard let options = row.dataProvider?.arrayData else { return }
//+++=
form +++ SelectableSection<Row, Row.Value>(row.title ?? "", selectionType: .SingleSelection(enableDeselection: true)) { [weak self] section in
if let sec = section as? SelectableSection<Row, Row.Value> {
sec.onSelectSelectableRow = { _, row in
self?.row.value = row.value
self?.completionCallback?(self!)
}
}
}
for option in options {
form.first! <<< Row.init(String(option)){ lrow in
if let fileName = row.displayValueFor?(option){
lrow.cell.imageView?.image = UIImage(named: fileName)
}
lrow.selectableValue = option
lrow.value = row.value == option ? option : nil
}.cellUpdate { [weak self] cell, row in
self?.selectableRowCellUpdate?(cell: cell, row: row)
}
}
}
open override func viewDidLoad() {
super.viewDidLoad()
setupForm()
}
open func setupForm() {
guard let options = row.dataProvider?.arrayData else { return }
if let optionsBySections = self.optionsBySections() {
for (sectionKey, options) in optionsBySections {
form +++ section(with: options, header: sectionHeaderTitleForKey?(sectionKey), footer: sectionFooterTitleForKey?(sectionKey))
}
} else {
form +++ section(with: options, header: row.title, footer: nil)
}
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
public var row: RowOf<Row.Value>!
open class ImageSelectorViewController<T:Equatable> : _ImageSelectorViewController<ListCheckRow<T>> {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment