首页 > 代码库 > iOS区分不同类型设备,加载不同的Window

iOS区分不同类型设备,加载不同的Window

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
        self.viewController = [[ViewController alloc] 
        initWithNibName:@"ViewController_iPhone" bundle:nil];
   }
   else{
        self.viewController = [[ViewController alloc] initWithNibName:
        @"ViewController_iPad" bundle:nil];
   }
   self.window.rootViewController = self.viewController;

iOS区分不同类型设备,加载不同的Window