STPopup provides STPopupController, which works just like UINavigationController in popup style, for both iPhone and iPad. It's written in Objective-C and compatible with Swift.
I am loading the view controller from a storyboard and STPopup Controller is instantiated here
let storyboardID = UIStoryboard(name: "Push", bundle: nil) let popupController: STPopupController = STPopupController(rootViewController: storyboardID.instantiateViewControllerWithIdentifier("enablePush")) popupController.containerView.layer.cornerRadius = 4 popupController.presentInViewController(self)
I am loading the view controller from a storyboard and STPopup Controller is instantiated here
let storyboardID = UIStoryboard(name: "Push", bundle: nil) let popupController: STPopupController = STPopupController(rootViewController: storyboardID.instantiateViewControllerWithIdentifier("enablePush")) popupController.containerView.layer.cornerRadius = 4 popupController.presentInViewController(self)
In viewDidLoad() of this view controller I have:
self.contentSizeInPopup = CGSizeMake(300, 200) self.landscapeContentSizeInPopup = CGSizeMake(400, 200) self.navigationItem.rightBarButtonItem?.image = UIImage(named: "dismissPushIcon") self.navigationItem.title = "Enable Push"
However the navigation bar remains empty as in the picture above.