-
Notifications
You must be signed in to change notification settings - Fork 262
Description
In the how to use section, I can only assume the interface builder instruction to Connect the container view for the primary (background) content to the outlet named primaryContentContainerView. is for the manual installation (and maybe cocoa pods?). However, with carthage, I can find no way to connect interface builder to the code as suggested (This could, perhaps, just be a shortcoming on my part, but I doubt I'd be the only one).
On the other side, doing it all programmatically, it's easy enough to do that once the first view controller is shown, but I don't know (and I doubt it's common knowledge) how to show your first view controller programmatically.
What I ended up doing was subclassing PulleyViewController and using a combo of IB and programmatic like this:
import UIKit
import Pulley
class PulleySub: PulleyViewController {
required init?(coder aDecoder: NSCoder) {
let storyboard = UIStoryboard.init(name: "Main", bundle: nil)
let mainVC = storyboard.instantiateViewController(withIdentifier: "mainVC")
let settings = storyboard.instantiateViewController(withIdentifier: "settingsVC")
super.init(contentViewController: mainVC, drawerViewController: settings)
}
required init(contentViewController: UIViewController, drawerViewController: UIViewController) {
super.init(contentViewController: contentViewController, drawerViewController: drawerViewController)
}
}(In interface builder, I simply have a solo UIViewController with which I set the class to PulleySub)
I don't know if this is a good idea or if this would be somehow compromised in the future. It feels clunky to me.