Extracting nibs/xibs from storyboards (iOS)

前端 未结 5 2095
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 01:38

I have created a simple project with a storyboard, and now realize that they don\'t support iOS 4.x and that I would like users with these devices to be able to download my

5条回答
  •  萌比男神i
    2020-12-30 02:10

    I found that the simplest method was to copy and paste the items out of the storyboard, one view at a time, and recreate the view controllers for each one.

    However, for anybody who does this, note that you have to make a xib for MainWindow in addition to all of your other XIBs, and hook it up accordingly, including setting up the window and app delegate. Storyboards handle all of this for you, so when you try to avoid them, you have a lot of manual setting up that creating non-storyboard projects from the get-go handles for you. Don't do what I did, and try to make your root controller your main view controller, because it will go nuts saying things about how UIApplication isn't key-value compliant for individual properties of your XIB.

提交回复
热议问题