Commit fb1f6ed2 authored by 余玠's avatar 余玠

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

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