Reputation: 885
I have been using .storyboard file and corresponding .h and .m files to show a simple barcode scanner in my application.
What is the issue behind this?
Upvotes: 0
Views: 498
Reputation: 183
I think you should use SceneDelegate class
@implementation SceneDelegate
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene];
UIViewController *vc = [[UIViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
}
Upvotes: 0
Reputation: 81
try creating new reference from UIWindow.
`- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CGRect windowFrame = UIScreen.mainScreen.bounds;
UIWindow *theWindow = [[UIWindow alloc] initWithFrame:windowFrame];
UIViewController *viewController = [[UIViewController alloc] initWithNibName:nil bundle:nil];
theWindow.rootViewController = viewController;
[self setWindow:theWindow];
return YES;
}
Upvotes: 1