blob: 35465210e365e6f20d7a2d72f369a04e110d5317 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
int main() {
@autoreleasepool {
return UIApplicationMain(0, nil, nil, NSStringFromClass([AppDelegate class]));
}
}
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(id)options {
CGRect mainScreenBounds = [[UIScreen mainScreen] bounds];
self.window = [[UIWindow alloc] initWithFrame:mainScreenBounds];
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.frame = mainScreenBounds;
NSString* msg = @"Hello world";
UILabel *label = [[UILabel alloc] initWithFrame:mainScreenBounds];
[label setText:msg];
[viewController.view addSubview: label];
self.window.rootViewController = viewController;
[self.window makeKeyAndVisible];
return YES;
}
@end
|