Tôi muốn đặt trình điều khiển xem ban đầu từ appdelegate. Tôi đã tìm thấy một câu trả lời thực sự tốt, tuy nhiên đó là trong Mục tiêu C và tôi gặp khó khăn trong việc đạt được điều tương tự trong nhanh chóng.
Lập trình đặt trình điều khiển chế độ xem ban đầu bằng Storyboards
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *viewController = // determine the initial view controller here and instantiate it with [storyboard instantiateViewControllerWithIdentifier:<storyboard id>];
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];
return YES;
}
Bất cứ ai có thể giúp đỡ?
Tôi muốn Trình điều khiển ban đầu phụ thuộc vào một số điều kiện được đáp ứng bằng cách sử dụng câu lệnh có điều kiện.
Đây là bản sao có thể có của: stackoverflow.com/questions/10428629/ từ
– Hồ Kim Quyên 22:24:11 18/09/2016