Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting nibs/xibs from storyboards (iOS)

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 app. The app is just a flipside view controller, and is fairly simple but if there's a way to just extract the XIBs from the storyboard I'd much prefer to do that than recreate it.

tl;dr: getting .xibs out of a .storyboard?

like image 883
Tim Avatar asked Oct 26 '11 22:10

Tim


1 Answers

Xib files cannot be extracted from the storyboard but you can instantiate UIViewControllers out of the storyboard by instantiating your storyboard into a UIStoryboard Object and getting the UIViewController via its identifier, here's how I do it:

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
                            @"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];

    UIViewController *myController = [storyboard instantiateViewControllerWithIdentifier:@"myId"];

hope this helps.

like image 161
Sparq Avatar answered Oct 26 '22 17:10

Sparq