• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bundle build setting that renames or compresses storyboards, xibs and nibs


  • Subject: Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 01 Mar 2016 14:00:35 -0800
  • Feedback-id: 167118m:167118agrif8a:167118sR1EPAFX3D:SMTPCORP

On Mar 1, 2016, at 12:43 , Alex Zavatone <email@hidden> wrote:

    NSString *myFrameworkIdentifier = @"com.myCompany.testFramework";    
    NSString *myStoryboardName = @"Insert your storyboard's name here without the extension";
    
    NSBundle *myBundle = [NSBundle bundleWithIdentifier:myFrameworkIdentifier];
    
    UIStoryboard *storyboardInstance = [UIStoryboard storyboardWithName:myStoryboardName bundle:myBundle];
    
    UIViewController *initialViewControllerInstance =  [storyboardInstance instantiateInitialViewController];

FWIW, I don’t think I’d do it this way either, because it’s too fragile (specifying the framework via a string).

The *politest* API would be to implement the instantiation as a class method in a class that’s in the framework. That is, move the code that finds the correct bundle into the framework itself, along with the boilerplate that’s needed to get from storybordName + bundle to view controller.

If the class of the initial view controller is known outside the framework, that seems like a good class to put the class method into. Otherwise, you can invent a class simply to provide a namespace for the method (rather than writing a global function, which is what the method “really” is).

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
      • From: Alex Zavatone <email@hidden>
References: 
 >Bundle build setting that renames or compresses storyboards, xibs and nibs (From: Alex Zavatone <email@hidden>)
 >Re: Bundle build setting that renames or compresses storyboards, xibs and nibs (From: Jens Alfke <email@hidden>)
 >Re: Bundle build setting that renames or compresses storyboards, xibs and nibs (From: Alex Zavatone <email@hidden>)
 >Re: Bundle build setting that renames or compresses storyboards, xibs and nibs (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
  • Next by Date: Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
  • Previous by thread: Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
  • Next by thread: Re: Bundle build setting that renames or compresses storyboards, xibs and nibs
  • Index(es):
    • Date
    • Thread