사용자 프레임워크 생성 후 프레임워크 안에 있는 Storyboard를 호출하여 사용해야 할 때가 있다.
그럴땐 NSBundle을 사용하여 Storyboard를 호출할 수 있다.
Object-C
NSBundle* frameworkBundle = [NSBundle bundleWithIdentifier:@"com.test.myProject"];
UIViewController* vc = [[UIStoryboard storyboardWithName:@"MyStoryboard" bundle:frameworkBundle] instantiateViewControllerWithIdentifier:@"MyViewController"];
Swift
let frameworkBundle = NSBundle(identifier: "com.test.myProject")
let storyboard = UIStoryboard(name: "MyStoryboard", bundle: frameworkBundle)
'Storyboard' 카테고리의 다른 글
Storyboard에서 생성한 UIViewController 코드로 접근 (0) | 2015.04.03 |
---|---|
메인 스토리보드 이름 설정 및 확인 (0) | 2015.04.03 |