当我按下一个按钮时,我希望能够切换到一个新的视图控制器,而不使用导航控制器,但我似乎无法做到这一点。我已经四处寻找答案,但我发现的所有内容都是关于objective-c的,使用导航控制器的,或者根本无法使用。
func gunsoutButtonPressed(sender:UIButton!) {
print("yay\t")
//let encounterVC:AnyObject! = self.storyboard?.instantiateViewControllerWithIdentifier("ecounterViewController")
//self.showViewController(encounterVC as UIViewController, sender: encounterVC)
let encounterViewController = self.storyboard.instantiateViewControllerWithIdentifier("encounterViewController") as encounterViewController
self.pushViewController(encounterViewController, animated: true)
}