John-Lluch / SWRevealViewController

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

CoreAnimation warnings: stiffness/damping must be greater than 0 #515

Open leizh007 opened 8 years ago

leizh007 commented 8 years ago

I set up my controllers as below:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
        let rearController = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("UserControlCenterViewController")
        let revealController = SWRevealViewController(rearViewController: UINavigationController(rootViewController: rearController), frontViewController: UINavigationController(rootViewController: ThreadViewController()))
        revealController.delegate = self
        revealController.rearViewRevealOverdraw = 0
        revealController.rearViewRevealWidth = ThemeManager.sharedThemManager.RearViewRevealWidth
        self.window?.rootViewController = revealController
        self.window?.makeKeyAndVisible()
        return true
    }

but there's warning coming out when I run my app.

2015-11-28 17:39:32.772 HiPDA[14477:170115] CoreAnimation: stiffness must be greater than 0.

2015-11-28 17:39:32.774 HiPDA[14477:170115] CoreAnimation: damping must be greater than or equal to 0.

2015-11-28 17:39:32.774 HiPDA[14477:170115] CoreAnimation: stiffness must be greater than 0.

2015-11-28 17:39:32.774 HiPDA[14477:170115] CoreAnimation: damping must be greater than or equal to 0.
jorgeirun commented 8 years ago

I'm having the same warning..

CellerX commented 8 years ago

me too

CellerX commented 8 years ago

this is my code,if i change parameter.The warning is gone.

UIView.animateWithDuration(1.5, delay: 0.0, usingSpringWithDamping: 0.6, initialSpringVelocity: 1.5, options: [], animations: {
            self.view.layoutIfNeeded()
            }) { (_) in
                UIApplication.sharedApplication().keyWindow?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
        }