13

I have downloaded Rotating Wheel Control project. It is a XCode project that uses xib and I would like it to use Storyboards. Is there a good way to move xib "Rotating Wheel Control" files into the Storyboard?

Does anyone have experience with move xib files into Storyboard?

I try to do the best I can, but when I run the program I get a NSInvalidArgumentException.

Can anyone explain, How could I can fix this problem?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Neru-J
  • 1,623
  • 2
  • 23
  • 38
  • One more thing, just copy the view in xib and paste to replace the view of the view controller in your storyboard, then all copied subviews and constraints will be same with the original xib. However, `IBOutlet` and `IBAction` won't be copied automatically, so you have to connect them manually. – DawnSong Nov 30 '20 at 01:43

1 Answers1

11

I think "no" is the short answer. I raised a Radar with Apple last year but they've not done anything yet!

You can sometimes open the XIB and copy and paste the controls into your Storyboard, but the formatting is sometimes wrong and you still have to adjust the outlets and actions manually.

There is no reason why you can't use both Storyboards and XIBs in a single project; maybe that's the best approach in the short term.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
  • How to use storyboards and xib in a single project? – user4951 Aug 28 '12 at 08:14
  • how to make story board to use xib that's declared outside? – user4951 Aug 28 '12 at 08:14
  • @JimThio: Simple use them both, add XIB files like you would always do. Integration depends on the case. Usually you will have a ViewController that uses the `initWithNibName` to point to the to-be-used xib file. Then you can push this new view on the navigation stack you would normally do. – Kevin R Feb 11 '13 at 15:51