天天看點

swift 使用多個storyBoard,進行視圖跳轉

當項目中有多個storyBoard時,跨越storyBoard進行視圖跳轉:

let destinationStoryboard = UIStoryboard(name:"xxxStoryboard",bundle:nil)
        let destinationViewController = destinationStoryboard.instantiateViewControllerWithIdentifier("xxxVC") as! UIViewController
        self.presentViewController(destinationViewController, animated: true, completion: nil)
           

xxxStoryboard 是UIStoryboard的名字

xxxVC 是視圖中Identity的StoryboardID