2017-12-22 14 views
1

どのように私はviewControllerをモーダルで表示できますか?私はこのViewControllerをmodaly swiftに表示する方法4

let userVC = mainStoryboard.instantiateViewController(withIdentifier: 
    "menuC") as! MenuController 
    userVC.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext 
     userVC.navigationController?.modalPresentationStyle = 
    UIModalPresentationStyle.overCurrentContext 
    present(userVC, animated: true, completion: nil) 

答えて

0

この

if let presentedViewController = self.storyboard?.instantiateViewController(withIdentifier: "menuC") { 
     presentedViewController.providesPresentationContextTransitionStyle = true 
     presentedViewController.definesPresentationContext = true 
     presentedViewController.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext; 
     presentedViewController.view.backgroundColor = UIColor.init(white: 0.4, alpha: 0.8) 
     self.present(presentedViewController, animated: true, completion: nil) 
    } 
が好きですか試すIOSの新しい初心者ですとswift4 を使用しています
関連する問題