Last active
October 6, 2023 18:10
-
-
Save douglashill/1bd6ba60b50315455ed2b2381bc355dc to your computer and use it in GitHub Desktop.
A minimal iOS 13 app that is set up in Objective-C rather than using a storyboard and UIApplicationSceneManifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import UIKit; | |
@interface SceneDelegate : UIResponder <UIWindowSceneDelegate> | |
@end | |
@implementation SceneDelegate | |
@synthesize window = _window; | |
- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { | |
self.window = [[UIWindow alloc] initWithWindowScene:(UIWindowScene *)scene]; | |
self.window.rootViewController = [[UIViewController alloc] init]; | |
[self.window makeKeyAndVisible]; | |
} | |
@end | |
@interface AppDelegate: UIResponder <UIApplicationDelegate> | |
@end | |
@implementation AppDelegate | |
- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { | |
UISceneConfiguration *configuration = [[UISceneConfiguration alloc] init]; | |
configuration.delegateClass = SceneDelegate.class; | |
return configuration; | |
} | |
@end | |
int main(int argc, char * argv[]) { | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass(AppDelegate.class)); | |
} |
Good sample I would just change:
self.window.rootViewController = [[UIViewController alloc] init];
to:
self.window.rootViewController = [[NameOfYourViewController alloc]init];
Also don't forget to import #import "NameOfYourViewController.h"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how were you able to enable the view control views ? , I am new to IOS development and i have been struggling to get the view controller views enabled :(