From 87e769786a6c9d19bae66030afc11d0986ed042d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 14 Oct 2023 01:37:34 +0000 Subject: [PATCH] Forgotten file. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4516 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ios.m | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/ios.m 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"); +}