Present a modal view using fade-in animation

后端 未结 3 835
眼角桃花
眼角桃花 2021-01-31 13:30

I presented a login screen as follows modally. Correct me if I am not right.

   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil]         


        
3条回答
  •  无人共我
    2021-01-31 14:14

    Swift 3, 3.1, 4, 4.2 (as of January, 2021)

    var storyboard = UIStoryboard(name: "Main", bundle: nil)
    var loginViewController = storyboard.instantiateViewController(withIdentifier: "login")
    loginViewController.modalTransitionStyle = .crossDissolve
    self.present(loginViewController, animated: true, completion: nil)
    

提交回复
热议问题