iOS: notch superview change to first object
This commit is contained in:
parent
365124dfc9
commit
510cdf53cb
@ -32,7 +32,13 @@ - (instancetype)initWithContext:(DoricContext *)doricContext {
|
|||||||
- (void)inset:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
- (void)inset:(NSDictionary *)argument withPromise:(DoricPromise *)promise {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
if (@available(iOS 11.0, *)) {
|
if (@available(iOS 11.0, *)) {
|
||||||
UIView *superView = [UIApplication sharedApplication].windows.lastObject;
|
UIView *superView;
|
||||||
|
if (self.doricContext.vc) {
|
||||||
|
superView = self.doricContext.vc.view.window;
|
||||||
|
} else {
|
||||||
|
superView = [UIApplication sharedApplication].windows.lastObject;
|
||||||
|
}
|
||||||
|
|
||||||
CGFloat top = superView.safeAreaInsets.top;
|
CGFloat top = superView.safeAreaInsets.top;
|
||||||
CGFloat left = superView.safeAreaInsets.left;
|
CGFloat left = superView.safeAreaInsets.left;
|
||||||
CGFloat bottom = superView.safeAreaInsets.bottom;
|
CGFloat bottom = superView.safeAreaInsets.bottom;
|
||||||
|
Reference in New Issue
Block a user