小编SRL*_*SRL的帖子

在Swift中以编程方式切换视图

我想通过按下"感觉幸运"按钮切换到第二个视图.当我试用我的模拟器并按下它时,它就会变成黑屏.我怎么能解决这个问题?

@IBAction func FeelingLuckyPress(sender: UIButton) {

    let secondViewController:SecondViewController = SecondViewController()

    self.presentViewController(secondViewController, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

xcode viewcontroller swift

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

swift ×1

viewcontroller ×1

xcode ×1