Created
April 30, 2019 21:30
-
-
Save volkanbicer/48a931771e3329586bea0e9806a452ee 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 StoreViewController: UIViewController { | |
typealias Factory = BooksViewControllerBuilder | |
private let factory: Factory | |
init(_ factory: Factory) { | |
self.factory = factory | |
super.init(nibName: nil, bundle: nil) | |
} | |
required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Add booksViewController | |
let booksViewController: BooksViewContoller = factory.build() | |
add(child: booksViewController) | |
} | |
func add(child controller: UIViewController) { | |
//... Add child view contollers | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment