diff --git a/TLYShyNavBar/TLYShyNavBarManager.h b/TLYShyNavBar/TLYShyNavBarManager.h index 38639ad..dbb1dc9 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.h +++ b/TLYShyNavBar/TLYShyNavBarManager.h @@ -35,6 +35,10 @@ */ @property (nonatomic, weak) UIScrollView *scrollView; +/* The extension view to be shown beneath the navbar + */ +@property (nonatomic, strong) UIView *extensionView; + /* The container contains the extension view, if any. Exposed to * allow the developer to adjust content offset as necessary. */ @@ -46,8 +50,6 @@ @property (nonatomic) CGFloat expansionResistance; // default 200 @property (nonatomic) CGFloat contractionResistance; // default 0 -- (void)setExtensionView:(UIView *)view; - @end diff --git a/TLYShyNavBar/TLYShyNavBarManager.m b/TLYShyNavBar/TLYShyNavBarManager.m index a06de6a..b173c84 100644 --- a/TLYShyNavBar/TLYShyNavBarManager.m +++ b/TLYShyNavBar/TLYShyNavBarManager.m @@ -238,13 +238,9 @@ static inline CGFloat AACStatusBarHeight() - (void)setExtensionView:(UIView *)view { - NSAssert([self.extensionViewContainer.subviews count] <= 1, - @"Please don't tamper with this view! Thanks!"); - - UIView *previousExtensionView = [self.extensionViewContainer.subviews firstObject]; - if (view != previousExtensionView) + if (view != _extensionView) { - [previousExtensionView removeFromSuperview]; + [_extensionView removeFromSuperview]; CGRect bounds = view.frame; bounds.origin = CGPointZero;