diff --git a/LNPopupController/LNPopupController/Private/LNPopupBar+Private.h b/LNPopupController/LNPopupController/Private/LNPopupBar+Private.h index 02ea3e85..01df6f2f 100644 --- a/LNPopupController/LNPopupController/Private/LNPopupBar+Private.h +++ b/LNPopupController/LNPopupController/Private/LNPopupBar+Private.h @@ -115,6 +115,8 @@ inline __attribute__((always_inline)) LNPopupBarStyle _LNPopupResolveBarStyleFro @property (nonatomic) BOOL _applySwiftUILayoutFixes; +@property (nonatomic, strong) UIFont* swiftuiInheritedFont; + @property (nonatomic, strong) UIView* swiftuiTitleContentView; @property (nonatomic, strong) UIViewController* swiftuiImageController; diff --git a/LNPopupController/LNPopupController/Private/LNPopupBar.m b/LNPopupController/LNPopupController/Private/LNPopupBar.m index c567c264..cfd8cf35 100644 --- a/LNPopupController/LNPopupController/Private/LNPopupBar.m +++ b/LNPopupController/LNPopupController/Private/LNPopupBar.m @@ -992,6 +992,18 @@ - (void)setSwiftuiTitleContentView:(UIView *)swiftuiTitleContentView [self _setNeedsTitleLayoutRemovingLabels:YES]; } +- (void)setSwiftuiInheritedFont:(UIFont *)swiftuiInheritedFont +{ + if([_swiftuiInheritedFont isEqual:swiftuiInheritedFont]) + { + return; + } + + _swiftuiInheritedFont = swiftuiInheritedFont; + + [self _setNeedsTitleLayoutRemovingLabels:YES]; +} + - (void)setSwiftuiHiddenLeadingController:(UIViewController *)swiftuiHiddenLeadingController { if(_swiftuiHiddenLeadingController == swiftuiHiddenLeadingController) @@ -1308,6 +1320,11 @@ - (void)_updateTitleInsetsForProminentBar:(UIEdgeInsets*)titleInsets //DO NOT CHANGE NAME! Used by LNPopupUI - (UIFont*)_titleFont { + if(_swiftuiInheritedFont) + { + return _swiftuiInheritedFont; + } + CGFloat fontSize = 15; UIFontWeight fontWeight = UIFontWeightMedium; UIFontTextStyle textStyle = UIFontTextStyleBody; @@ -1345,6 +1362,11 @@ - (UIColor*)_titleColor //DO NOT CHANGE NAME! Used by LNPopupUI - (UIFont*)_subtitleFont { + if(_swiftuiInheritedFont) + { + return [UIFont fontWithDescriptor:_swiftuiInheritedFont.fontDescriptor size:_swiftuiInheritedFont.pointSize - 2.5]; + } + CGFloat fontSize = 15; UIFontWeight fontWeight = UIFontWeightRegular; UIFontTextStyle textStyle = UIFontTextStyleBody;