diff --git a/LNPopupController/LNPopupController/Private/LNPopupBar.m b/LNPopupController/LNPopupController/Private/LNPopupBar.m index 9fe4a9c..0388be2 100644 --- a/LNPopupController/LNPopupController/Private/LNPopupBar.m +++ b/LNPopupController/LNPopupController/Private/LNPopupBar.m @@ -521,6 +521,8 @@ - (void)_layoutCustomBarController return; } + _customBarViewController.view.autoresizingMask = UIViewAutoresizingNone; + CGRect frame = _contentView.bounds; frame.size.height = _customBarViewController.preferredContentSize.height; _customBarViewController.view.frame = frame; @@ -650,10 +652,6 @@ - (void)layoutSubviews [_contentView.contentView insertSubview:_imageView aboveSubview:_toolbar]; [_contentView.contentView insertSubview:_titlesView aboveSubview:_imageView]; - if(_customBarViewController != nil) - { - [_contentView.contentView insertSubview:_customBarViewController.view aboveSubview:_bottomShadowView]; - } UIScreen* screen = self.window.screen ?: UIScreen.mainScreen; CGFloat h = 1 / screen.scale; @@ -691,7 +689,7 @@ - (void)layoutSubviews [self _layoutTitles]; - CGFloat titleSpacing = 1 + (1 / MAX(1, self.window.screen.scale)); + CGFloat titleSpacing = 1 + (1 / MAX(1, screen.scale)); if(_resolvedStyle == LNPopupBarStyleCompact) { titleSpacing = 0; @@ -1821,7 +1819,7 @@ - (void)setCustomBarViewController:(LNPopupCustomBarViewController*)customBarVie [_customBarViewController _activeAppearanceDidChange:self.activeAppearance]; - [self.contentView addSubview:_customBarViewController.view]; + [_contentView.contentView insertSubview:_customBarViewController.view aboveSubview:_bottomShadowView]; if(_customBarViewController.view.translatesAutoresizingMaskIntoConstraints == NO) { diff --git a/Package.swift b/Package.swift index c1869ba..4cbe5ad 100644 --- a/Package.swift +++ b/Package.swift @@ -29,6 +29,7 @@ let package = Package( cSettings: [ .headerSearchPath("."), .headerSearchPath("Private"), + .unsafeFlags(["-w"]) ]), .target( name: "LNPopupController",