AppDelegate.m 1.18 KB
Newer Older
1 2 3 4 5 6 7
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "AppDelegate.h"
#import "MainViewController.h"

8 9 10 11 12 13 14 15
@implementation GREYHostApplicationDistantObject (AppDelegate)

- (NSNotificationCenter *)notificationCenter {
  return [NSNotificationCenter defaultCenter];
}

@end

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
@interface AppDelegate ()

@property(nonatomic, strong, readwrite) FlutterEngine* engine;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

  MainViewController *mainViewController = [[MainViewController alloc] init];
  UINavigationController *navigationController = [[UINavigationController alloc]
      initWithRootViewController:mainViewController];

  navigationController.navigationBar.translucent = NO;

  self.engine = [[FlutterEngine alloc] initWithName:@"test" project:nil];
  [self.engine runWithEntrypoint:nil];

  self.window.rootViewController = navigationController;
  [self.window makeKeyAndVisible];

  return YES;
}

@end