- unify storyboard segues and custom transitions
- separate storyboard related code from view controllers
- export transition logic without exposing view controllers
- reduce boilerplate by using reflection in the way that is conventional for your project
- have opportunity to deviate from convention where you need to
- keep reuseable cell factories code expressive
- combine cell registration and dequeueing code
- detect internal inconsistency earlier in debug time
- have debug information on what's wrong
- catch objc / cpp exceptions in swift
override func viewDidLoad() {
super.viewDidLoad()
tableConfiguration = tableView.conventional.configuration
.cell(StringCellV.self).byClass().configure(with: StringCellV.configure(stringVM:))
.cell(IntCellV.self).inStoryboard().configure(with: IntCellV.configure(intVM:))
.cellFromNib(ConventionalCell1V.self)
.cellFromNib(ConventionalCell2V.self)
.build()
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
return tableConfiguration.cell(from: tableView, at: indexPath, for: cellModels[indexPath.row])
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
self.window = window
windowConfiguration = window.conventional.configuration
.register(WelcomeC.self).instantiateInitial().changeRoot().noContext()
.build()
windowConfiguration.transit(WelcomeC.self)
return true
}
override func viewDidLoad() {
super.viewDidLoad()
configuration = conventional.configuration
.embedd(SubController.self, \.subController)
.showInitial(SeguedC.self)
.build()
viewModel = ViewModel(converter: configuration.converter, transit: {[weak self] in self?.configuration.perform($0)})
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
configuration.prepare(for: segue, sender: sender)
}
- Xcode 9.0
- Swift 4.1
Conventional depends only on UIKit