Embed-In navigation controller programmatically
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
UINavigationBar.appearance().backgroundColor = UIColor.whiteColor()
let loginViewController: LoginViewController = LoginViewController(nibName: "LoginViewController", bundle: nil)
let navController: UINavigationController = UINavigationController(rootViewController: loginViewController)
window!.makeKeyAndVisible()
window!.addSubview(navController.view!)
return true
}
Embed-In navigation controller Using Storyborad
To enable navigation controller you need to embed-in your loginViewController in Navigation controller
Open Storyboard --> select loginviewcontroller --> Editor (in Xcode menu) --> Embed in --> Navigation controller

you can see result looks like

then just update app delegate method to change the navigation bar background color
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
UINavigationBar.appearance().backgroundColor = UIColor.whiteColor()
return true
}
In LoginViewController controller add Right swipe gesture in viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
let swiperight: UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(LoginViewController.swiperight(_:)))
swiperight.direction = .Right
self.view!.addGestureRecognizer(swiperight)
}
func swiperight(gestureRecognizer: UISwipeGestureRecognizer) {
//Do what you want here
//Load Signup view controller here
func swiperight(gestureRecognizer: UISwipeGestureRecognizer) {
//Load Signup view controller here
let signupHomeViewController: SignupHomeViewController = SignupHomeViewController(nibName: nil, bundle: nil)
// and push it onto the 'navigation stack'
self.navigationController?.pushViewController(signupHomeViewController, animated: true)
}
}
In SignupViewController controller add Left swipe gesture in viewDidLoad
override func viewDidLoad() {
super.viewDidLoad()
let swipeleft: UISwipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(SignupViewController.swipeleft(_:)))
swipeleft.direction = .Left
self.view!.addGestureRecognizer(swipeleft)
}
func swipeleft(gestureRecognizer: UISwipeGestureRecognizer) {
//Do what you want here
//Pop back to login view controller
}