Last active
March 10, 2017 12:29
-
-
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
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
public var row: RowOf<Row.Cell.Value>! |
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
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) | |
} | |
} | |
} |
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
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) | |
} | |
} |
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
public required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
} |
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
public var row: RowOf<Row.Value>! |
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
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