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

Side by Side Diff: ios/showcase/suggestions/suggestions_coordinator.mm

Issue 2618343002: Creates the Suggestions UI (Closed)
Patch Set: Created 3 years, 11 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/suggestions/suggestions_coordinator.h ('k') | no next file » | 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/suggestions/suggestions_coordinator.h"
6
7 #import "ios/chrome/browser/ui/suggestions/suggestions_data_source.h"
8 #import "ios/third_party/material_components_ios/src/components/Collections/src/ MaterialCollections.h"
9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
14 @implementation SuggestionsCoordinator {
15 SuggestionsDataSource* _dataSource;
16 }
17
18 @synthesize baseViewController;
19
20 #pragma mark - Coordinator
21
22 - (void)start {
23 SuggestionsViewController* suggestion = [[SuggestionsViewController alloc]
24 initWithStyle:CollectionViewControllerStyleDefault];
25
26 _dataSource = [[SuggestionsDataSource alloc] init];
27 _dataSource.collectionViewController = suggestion;
28
29 suggestion.dataSourceDelegate = _dataSource;
30 suggestion.actionsDelegate = self;
31
32 [self.baseViewController pushViewController:suggestion animated:YES];
33 }
34
35 #pragma mark - SuggestionsActions
36
37 - (void)addItem {
38 [_dataSource addTextItem:@"Button clicked"
39 subtitle:@"Item Added!"
40 toSection:0];
41 }
42
43 @end
OLDNEW
« no previous file with comments | « ios/showcase/suggestions/suggestions_coordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698