[NEW]: expose the extension view. We may need it

This commit is contained in:
Mazyad Alabduljaleel 2014-07-08 16:37:20 +04:00
parent 78ac2c53d9
commit 796f5f5e1e
2 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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;