티스토리 뷰

Mobile/iOS

[iOS]XIB로 시작하기

out of coding 2016. 2. 16. 14:03

오늘은 스토리보드를 이용하지 않고 그냥 MainXib를 가져와서 사용하는 방법을 알아본다.


방법은 다음과 같이 개발하도록 한다.


아래에서 ViewController는 UIViewController를 상속받은 Class이다.


AppDelegate 파일의 didFinishLaunchingWithOptions에 넣어주도록 한다.


ViewController* controller = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];


self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

self.window.frame = [[UIScreen mainScreen] bounds];


[self.window setRootViewController:controller];

[self.window makeKeyAndVisible];

return YES;


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함