John-Lluch / SWRevealViewController

A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right !
Other
4.52k stars 988 forks source link

pushFrontViewController:animated: not animating #423

Open techrah opened 9 years ago

techrah commented 9 years ago

I have a pretty standard setup, Storyboard with entry point to a SWRevealViewController, a rear controller that hosts a menu using a table view and pushes various views. Animation works well.

However, I'm now trying to push a controller programatically using pushFrontViewController:animated: which does show the appropriate view but does not animate it into place.

I'm doing this in Swift and passing animated:true. The comments in the code states that it should perform the default animation (move to rightmost, replace, move back) but that's not happening for me.

Any ideas what might be wrong?

cbh2000 commented 9 years ago

The push animation is disabled is because it causes weird layout issues.

cbh2000 commented 9 years ago

I've fixed this problem outside of SWRevealViewController (in my own code). Looking into fixing it properly in a merge request...

cbh2000 commented 9 years ago

I ended up fixing this by using UINavigationController's setViewControllers:animated:. It's a more natural animation anyways, IMO.

I encountered a lot of problems trying to fix this properly inside of SWRevealViewController. Hence the workaround.

cbh2000 commented 9 years ago

Duplicate of #329.

bestimmaa commented 8 years ago

Same problem here, can you give some details on the workaround?

iDevelopper commented 8 years ago

For me it is animated !

bestimmaa commented 8 years ago

I'm glad to hear iDevelopper :) For me it is not ... after using it several times pushFrontViewController:animated is not animated anymore

iDevelopper commented 8 years ago

What is the animation you expect? Front goes a little right and after completely left?

bestimmaa commented 8 years ago

"Front goes a little right and after completely left?" exactly! :) This is what I expect and see a few times before it stops at some point. Do you have any ideas where to start looking? My guess it is something that affects most / all animations. Project however is to big to reduce it to a small test case :/

iDevelopper commented 8 years ago

Could you download SkiPhone App on the App Store and tell me if it is what you expect. It is free

bestimmaa commented 8 years ago

Jup, I'm sure about what animation I expect. And I got it working. The issue is it STOPS working and I'm looking for possible reasons ;)

iDevelopper commented 8 years ago

Have you modified the property rearViewRevealOverdraw somewhere in your code?

DQ92 commented 8 years ago

I had the same problem with animation between controllers, so I create custom segue:

class CustomPush: UIStoryboardSegue {

  override func perform() {
      var sw = self.sourceViewController.revealViewController()
      let transition: CATransition = CATransition()
      let timeFunc : CAMediaTimingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
      transition.duration = 0.35
      transition.timingFunction = timeFunc
      transition.type = kCATransitionReveal
      transition.subtype = kCATransitionFromLeft
      sw.view.layer.addAnimation(transition, forKey: kCATransition)
      sw.pushFrontViewController(destinationViewController, animated: true)
  }

}

iDevelopper commented 8 years ago

Are you interested in side views on top of main view?

https://github.com/iDevelopper/PBRevealViewController

iDevelopper commented 8 years ago

Then you have an segue identifier for each cell?