Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ios/Fabric/RNCSafeAreaProviderComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ - (instancetype)initWithFrame:(CGRect)frame
if (self = [super initWithFrame:frame]) {
static const auto defaultProps = std::make_shared<const RNCSafeAreaProviderProps>();
_props = defaultProps;

[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(invalidateSafeAreaInsets)
name:UIKeyboardDidShowNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(invalidateSafeAreaInsets)
name:UIKeyboardDidHideNotification
object:nil];
}

return self;
Expand Down
15 changes: 15 additions & 0 deletions ios/RNCSafeAreaProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ @implementation RNCSafeAreaProvider {
BOOL _initialInsetsSent;
}

- (instancetype)init
{
if ((self = [super init])) {
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(invalidateSafeAreaInsets)
name:UIKeyboardDidShowNotification
object:nil];
[NSNotificationCenter.defaultCenter addObserver:self
selector:@selector(invalidateSafeAreaInsets)
name:UIKeyboardDidHideNotification
object:nil];
}
return self;
}

- (void)safeAreaInsetsDidChange
{
[self invalidateSafeAreaInsets];
Expand Down