Question

I'm using ecslidingviewcontroller 2, which removed anchortopviewoffscreen methods.

What's the best way to move top view off screen to make room for search in the menu view controller?

Thank you.

Was it helpful?

Solution

Here's what I ended up doing:

UIViewController *topViewController = self.slidingViewController.topViewController;

CGFloat dX = self.view.frame.size.width - self.slidingViewController.anchorRightRevealAmount;

// You can replace kSearchAnimationDuration with 0.25 or define it somewhere
[UIView animateWithDuration:kSearchAnimationDuration animations:^{

    topViewController.view.layer.transform = CATransform3DTranslate(topViewController.view.layer.transform, dX, 0, 0);        
}];

let me know if you have a better method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top