swift 使用多個storyBoard

來源:互聯網
上載者:User

標籤:

其實就是想不把介面都畫在一個Storyboard裡面

為了這個破問題,在網上查了很多資料,其實很簡單

 @IBAction func idQuery(sender: UIButton) {        let settingsStoryboard = UIStoryboard(name:"IDQueryStoryboard",bundle:nil)        let viewController = settingsStoryboard.instantiateViewControllerWithIdentifier("IDQuery") as! UIViewController        self.presentViewController(viewController, animated: true, completion: nil)            }

IDQueryStoryboard是你要調用Storyboard的名,IDQuery是你標識的StoryboardID

這樣設定了發現不行,報Could not find a storyboard 

退出模擬器,從新編譯,就可以了

 

swift 使用多個storyBoard

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.