forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchrome_coordinator.h
48 lines (35 loc) · 1.84 KB
/
chrome_coordinator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
44
45
46
47
48
// 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.
#ifndef IOS_CHROME_BROWSER_CHROME_COORDINATOR_H_
#define IOS_CHROME_BROWSER_CHROME_COORDINATOR_H_
#include <UIKit/UIKit.h>
@class ChromeCoordinator;
typedef NSMutableArray<ChromeCoordinator*> MutableCoordinatorArray;
// A coordinator object that manages view controllers and other coordinators.
// Members of this class should clean up their own UI when they are deallocated.
@interface ChromeCoordinator : NSObject
// Creates a coordinator that will use |viewController|
- (nullable instancetype)initWithBaseViewController:
(nullable UIViewController*)viewController NS_DESIGNATED_INITIALIZER;
- (nullable instancetype)init NS_UNAVAILABLE;
// Child coordinators created by this object.
@property(nonatomic, nonnull, readonly)
MutableCoordinatorArray* childCoordinators;
// The currently 'active' child coordinator, if any. By default this is the last
// coordinator in |childCoordinators|, but subclasses need not adhere to that.
@property(nonatomic, nullable, readonly)
ChromeCoordinator* activeChildCoordinator;
// The view controller this coordinator was initialized with.
@property(nonatomic, nullable, readonly) UIViewController* baseViewController;
// The basic lifecycle methods for coordinators are -start and -stop. These
// are blank template methods; child classes are expected to implement them and
// do not need to invoke the superclass methods. Subclasses of ChromeCoordinator
// that expect to be subclassed should not build functionality into these
// methods.
// Starts the user interaction managed by the receiver.
- (void)start;
// Stops the user interaction managed by the receiver. Called on dealloc.
- (void)stop;
@end
#endif // IOS_CHROME_BROWSER_CHROME_COORDINATOR_H_