| Index: ios/showcase/suggestions/suggestions_coordinator.mm
|
| diff --git a/ios/showcase/suggestions/suggestions_coordinator.mm b/ios/showcase/suggestions/suggestions_coordinator.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c842542fec974e19e2eb2de004b86dbc27b4348b
|
| --- /dev/null
|
| +++ b/ios/showcase/suggestions/suggestions_coordinator.mm
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2016 The Chromium 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 "ios/showcase/suggestions/suggestions_coordinator.h"
|
| +
|
| +#import "ios/chrome/browser/ui/suggestions/suggestions_data_source.h"
|
| +#import "ios/third_party/material_components_ios/src/components/Collections/src/MaterialCollections.h"
|
| +
|
| +#if !defined(__has_feature) || !__has_feature(objc_arc)
|
| +#error "This file requires ARC support."
|
| +#endif
|
| +
|
| +@implementation SuggestionsCoordinator {
|
| + SuggestionsDataSource* _dataSource;
|
| +}
|
| +
|
| +@synthesize baseViewController;
|
| +
|
| +#pragma mark - Coordinator
|
| +
|
| +- (void)start {
|
| + SuggestionsViewController* suggestion = [[SuggestionsViewController alloc]
|
| + initWithStyle:CollectionViewControllerStyleDefault];
|
| +
|
| + _dataSource = [[SuggestionsDataSource alloc] init];
|
| + _dataSource.collectionViewController = suggestion;
|
| +
|
| + suggestion.dataSourceDelegate = _dataSource;
|
| + suggestion.actionsDelegate = self;
|
| +
|
| + [self.baseViewController pushViewController:suggestion animated:YES];
|
| +}
|
| +
|
| +#pragma mark - SuggestionsActions
|
| +
|
| +- (void)addItem {
|
| + [_dataSource addTextItem:@"Button clicked"
|
| + subtitle:@"Item Added!"
|
| + toSection:0];
|
| +}
|
| +
|
| +@end
|
|
|