OK, this will only compile for telly now... Need to fix the realTopLayout thingie

[FIX]: fixed cleanup issues
This commit is contained in:
Mazyad Alabduljaleel 2014-06-16 23:29:05 +04:00
parent 734063f65b
commit 3f82e33642
3 changed files with 16 additions and 2 deletions

View File

@ -46,6 +46,8 @@
- (void)setExtensionView:(UIView *)view;
/* Needs to be called in viewWillAppear */
- (void)prepareForDisplay;
/* Needs to be called in viewDidLayoutSubviews */
- (void)layoutViews;
/* Needs to be called in two places.. Please refer to the demo */

View File

@ -79,7 +79,7 @@ static inline CGFloat AACStatusBarHeight()
self.extensionController.expandedCenter = ^(UIView *view)
{
return CGPointMake(CGRectGetMidX(view.bounds),
CGRectGetMidY(view.bounds) + weakSelf.viewController.topLayoutGuide.length);
CGRectGetMidY(view.bounds) + weakSelf.viewController.realTopLayoutGuide.length);
};
self.navBarController.child = self.extensionController;
@ -198,10 +198,15 @@ static inline CGFloat AACStatusBarHeight()
[self.extensionViewContainer addSubview:view];
}
- (void)prepareForDisplay
{
[self.navBarController expand];
}
- (void)layoutViews
{
[self.navBarController expand];
UIEdgeInsets scrollInsets = self.scrollView.contentInset;
scrollInsets.top = CGRectGetHeight(self.extensionViewContainer.bounds) + self.viewController.topLayoutGuide.length;

View File

@ -129,6 +129,13 @@ const CGFloat contractionVelocity = 300.f;
- (CGFloat)expand
{
self.view.hidden = NO;
if (self.hidesSubviews)
{
[self _updateSubviewsToAlpha:1.f];
}
CGFloat amountToMove = self.expandedCenterValue.y - self.view.center.y;
self.view.center = self.expandedCenterValue;