ios - How to switch view controllers in swift? -


i'm trying switch 1 uiviewcontroller using code. right have,

self.presentviewcontroller(resultviewcontroller(), animated: true, completion: nil) 

all doing taking me black screen instead of resultviewcontroller. suggestions?

with storyboard. create swift file (secondviewcontroller.swift) second view controller , in appropriate function type this:

let secondviewcontroller = self.storyboard?.instantiateviewcontroller(withidentifier: "secondviewcontroller") as! secondviewcontroller  self.navigationcontroller.pushviewcontroller(secondviewcontroller, animated: true) 

without storyboard

let secondviewcontroller = viewcontroller(nibnameornil: nibname, bundleornil: nil) self.presentviewcontroller(secondviewcontroller, animated: true, completion: nil) 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -