diff --git a/src/ios.m b/src/ios.m new file mode 100644 index 00000000..65d0442f --- /dev/null +++ b/src/ios.m @@ -0,0 +1,39 @@ +#import +#import +#import + +@interface ViewController : UIViewController +@property(strong, nonatomic) WKWebView* web_view; +@end + +@implementation ViewController +- (void)viewDidLoad +{ + [super viewDidLoad]; + WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init]; + self.web_view = [[WKWebView alloc] initWithFrame:self.view.frame configuration:configuration]; + [self.web_view loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://www.tildefriends.net/"]]]; + [self.view addSubview:self.web_view]; +} +@end + +@interface AppDelegate : UIResponder +@property(strong, nonatomic) UIWindow* window; +@end + +@implementation AppDelegate +- (BOOL)application:(UIApplication*)application + didFinishLaunchingWithOptions:(NSDictionary*)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + ViewController* view_controller = [[ViewController alloc] init]; + self.window.rootViewController = view_controller; + [self.window makeKeyAndVisible]; + return YES; +} +@end + +int main(int argc, char* argv[]) +{ + return UIApplicationMain(argc, argv, nil, @"AppDelegate"); +}