Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: ios/showcase/core/app_delegate.mm

Issue 2592593003: Upstream ios/showcase source code. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/showcase/core/app_delegate.h ('k') | ios/showcase/core/main.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/showcase/core/app_delegate.h"
6
7 #import "ios/showcase/core/showcase_model.h"
8 #import "ios/showcase/core/showcase_view_controller.h"
9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
14 @implementation AppDelegate
15 @synthesize window = _window;
16
17 - (BOOL)application:(UIApplication*)application
18 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
19 // Override point for customization after application launch.
20 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
21 ShowcaseViewController* viewController =
22 [[ShowcaseViewController alloc] initWithRows:[self rowsToDisplay]];
23 UINavigationController* navigationController = [[UINavigationController alloc]
24 initWithRootViewController:viewController];
25 self.window.rootViewController = navigationController;
26 [self.window makeKeyAndVisible];
27 return YES;
28 }
29
30 #pragma mark - Private
31
32 // Creates model data to display in the view controller.
33 - (NSArray<showcase::ModelRow*>*)rowsToDisplay {
34 NSArray<showcase::ModelRow*>* rows = [ShowcaseModel model];
35 NSSortDescriptor* sortDescriptor =
36 [NSSortDescriptor sortDescriptorWithKey:showcase::kClassForDisplayKey
37 ascending:YES];
38 return [rows sortedArrayUsingDescriptors:@[ sortDescriptor ]];
39 }
40
41 @end
OLDNEW
« no previous file with comments | « ios/showcase/core/app_delegate.h ('k') | ios/showcase/core/main.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698