Commit f3383187 authored by _Finder丶Tiwk's avatar _Finder丶Tiwk

#Fix: FLBFlutterViewContainter通过xib/storyboard初始化时,显示错乱问题

parent 29531c8a
...@@ -86,15 +86,31 @@ static NSUInteger kInstanceCounter = 0; ...@@ -86,15 +86,31 @@ static NSUInteger kInstanceCounter = 0;
return @(_identifier).stringValue; return @(_identifier).stringValue;
} }
- (void)_setup
{
static long long sCounter = 0;
_identifier = sCounter++;
[self.class instanceCounterIncrease];
SEL sel = @selector(flutterViewDidShow:);
NSString *notiName = @"flutter_boost_container_showed";
[NSNotificationCenter.defaultCenter addObserver:self
selector:sel
name:notiName
object:nil];
}
- (instancetype)init - (instancetype)init
{ {
if(self = [super init]){ if(self = [super init]){
static long long sCounter = 0; [self _setup];
_identifier = sCounter++; }
[self.class instanceCounterIncrease]; return self;
[NSNotificationCenter.defaultCenter addObserver:self }
selector:@selector(flutterViewDidShow:) name:@"flutter_boost_container_showed"
object:nil]; - (instancetype)initWithCoder:(NSCoder *)aDecoder{
if (self = [super initWithCoder: aDecoder]) {
[self _setup];
} }
return self; return self;
} }
......
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