Commit fb1f6ed2 authored by 余玠's avatar 余玠

提供获取页面栈页面个数的接口

parent fc43d670
...@@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -45,6 +45,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)addUniqueViewController:(id<FLBFlutterContainer>)vc; - (void)addUniqueViewController:(id<FLBFlutterContainer>)vc;
- (void)removeViewController:(id<FLBFlutterContainer>)vc; - (void)removeViewController:(id<FLBFlutterContainer>)vc;
- (BOOL)isTop:(NSString *)pageId; - (BOOL)isTop:(NSString *)pageId;
- (NSInteger)pageCount;
#pragma mark - App Control #pragma mark - App Control
- (void)pause; - (void)pause;
......
...@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)addUnique:(id<FLBFlutterContainer>)vc; - (void)addUnique:(id<FLBFlutterContainer>)vc;
- (void)remove:(id<FLBFlutterContainer>)vc; - (void)remove:(id<FLBFlutterContainer>)vc;
- (BOOL)contains:(id<FLBFlutterContainer>)vc; - (BOOL)contains:(id<FLBFlutterContainer>)vc;
- (NSInteger)pageCount;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -79,6 +79,10 @@ ...@@ -79,6 +79,10 @@
return _idStk.lastObject; return _idStk.lastObject;
} }
- (NSInteger)pageCount{
return _idStk.count;
}
#if DEBUG #if DEBUG
- (void)dump:(NSString*)flag{ - (void)dump:(NSString*)flag{
NSMutableString *log = [[NSMutableString alloc]initWithFormat:@"[DEBUG]--%@--PageStack uid/name", flag]; NSMutableString *log = [[NSMutableString alloc]initWithFormat:@"[DEBUG]--%@--PageStack uid/name", flag];
......
...@@ -31,6 +31,12 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -31,6 +31,12 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Initializer #pragma mark - Initializer
+ (instancetype)sharedInstance; + (instancetype)sharedInstance;
/**
* 获取当前管理的页面栈中页面的个数
*
*/
+ (NSInteger)pageCount;
/** /**
* 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中 * 初始化FlutterBoost混合栈环境。应在程序使用混合栈之前调用。如在AppDelegate中
* *
......
...@@ -111,6 +111,11 @@ ...@@ -111,6 +111,11 @@
return _instance; return _instance;
} }
+ (NSInteger)pageCount{
id<FLBFlutterApplicationInterface> app = [[FlutterBoostPlugin sharedInstance] application];
return [app pageCount];
}
- (void)startFlutterWithPlatform:(id<FLBPlatform>)platform - (void)startFlutterWithPlatform:(id<FLBPlatform>)platform
onStart:(void (^)(FlutterEngine *engine))callback; onStart:(void (^)(FlutterEngine *engine))callback;
{ {
......
...@@ -116,6 +116,9 @@ ...@@ -116,6 +116,9 @@
return [_manager remove:vc]; return [_manager remove:vc];
} }
- (NSInteger)pageCount{
return [_manager pageCount];
}
- (BOOL)isTop:(NSString *)pageId - (BOOL)isTop:(NSString *)pageId
{ {
......
...@@ -31,6 +31,5 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -31,6 +31,5 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy,readwrite) NSString *name; @property (nonatomic,copy,readwrite) NSString *name;
- (instancetype)init NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_DESIGNATED_INITIALIZER;
- (void)surfaceUpdated:(BOOL)appeared; - (void)surfaceUpdated:(BOOL)appeared;
- (void)setEnableForRunnersBatch:(BOOL)enable;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -158,11 +158,6 @@ static NSUInteger kInstanceCounter = 0; ...@@ -158,11 +158,6 @@ static NSUInteger kInstanceCounter = 0;
[FLUTTER_APP.flutterProvider detach]; [FLUTTER_APP.flutterProvider detach];
} }
- (void)setEnableForRunnersBatch:(BOOL)enable{
//dummy function
NSLog(@"[DEBUG]- I did nothing, I am innocent");
}
#pragma mark - Life circle methods #pragma mark - Life circle methods
- (void)viewDidLayoutSubviews - (void)viewDidLayoutSubviews
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment