I hope this can help future me. In Xcode 13.1, add the following code in SceneDelegate.m.
// Refer: https://blog.csdn.net/Alingjiu/article/details/79828365
// SceneDelegate.m
#import "ViewController.h" //add this header
//...
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
ViewController *viewController = [[ViewController alloc] init];
UINavigationController *navigationController =
[[UINavigationController alloc] initWithRootViewController:viewController];
self.window.rootViewController = navigationController;
}
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: