Up vote 1 down vote favorite 1 share g+ share fb share tw.
I was studying Storyboard on the new iOS 5.0. It seems really simple to use and to implement but my question is ... How can I update the old Xib to Storyboard? For instance.
I have some classes I developed when there was no storyboard and some of this classes come with xib file that help me to setup a custom layout quickly. Obviously when I use this kind of class I need to instantiate it using initWithNibName:bundle: and it now is ready to use and I can use it as many times I need because layout is coded inside xib. Now Storyboard ... Storyboard doesn't allow to load view controller from xib and I did not found a way to load storyboard file inside the main storyboard.
It seems like I need to reconfigure layout for a particular view controller every time I use it in a new project. It seems that now I'm forced to reconfigure the layout of my controller in every new application that use this controller instead of using xib file that have the layout inside. Maybe there is something I did not understand.
Anyone can help me to understand the best way to use storyboard? Thank you in advance. Gabriele.
EDIT in reply to sw3n Maybe I understood thanks to sw3n. This code below works but is this completely correct? // All this code is implemented inside the MyViewController class.
// Attached to an UIButton; - (void)loadNewController:(id)sender { self performSegueWithIdentifier:@"newControllerIdentifier" sender:sender; } - (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender { // As suggested by sw3n // Load the storyboard from file. UIStoryboard *storyboardTest = UIStoryboard storyboardWithName:@"StoryBoardLoad_Test" bundle:nil; // Instantiate the viewController that live in the storyboard file UIViewController *destinationViewController = storyboardTest instantiateViewControllerWithIdentifier:@"newControllerIdentifier"; // Instantiate a segue to start the chain UIStoryboardSegue *segue = UIStoryboardSegue alloc initWithIdentifier:identifier source:self destination:destinationViewController; self prepareForSegue:segue sender:sender; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if (segue. Identifier isEqualToString:@"newControllerIdentifier") { segue.
DestinationViewController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal; // Are there new options to present the controller? // If I was in a NavigationController a could obviously push it. Self presentModalViewController:segue.
DestinationViewController animated:YES; } } iphone ios5 xib nib storyboard link|improve this question edited Nov 23 '11 at 11:03 asked Nov 19 '11 at 2:11Gabriele16919 71% accept rate.
(UIStoryboard *)storyboardWithName:(NSString *)name bundle:(NSBundle *)storyboardBundleOrNil.
Interface Builder: select the segue in your view controller go to the attributes tab give the segue a name set the transition style In code: self performSegueWithIdentifier:@"mySegueNameFromInterfaceBuilder" sender:self.
This does't answers my question. This is how the storyboard works in a single . Storyboard file.
I'm interested in use multiple storyboard file. – Gabriele Nov 24 '11 at 18:36.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.