Closed tariq235 closed 7 years ago
I think both are using storyboard and segue. I am looking for programmatic approach instead of storyboard.
Programmatic approach was simple I have just implemented this great library!
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let mainViewController = storyboard.instantiateViewController(withIdentifier: "MainViewController")
let leftTableViewController = storyboard.instantiateViewController(withIdentifier: "LeftTableViewController")
let rightViewController = storyboard.instantiateViewController(withIdentifier: "RightViewController")
let revealViewController = PBRevealViewController(leftViewController: leftTableViewController, mainViewController: mainViewController, rightViewController: rightViewController)
window?.rootViewController = revealViewController
window?.makeKeyAndVisible()
return true
}
Hi,
There are already two samples written in Swift! How can I help you?