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