Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speeding up the Pop animation #43

Closed
yigitserin opened this issue Jun 16, 2016 · 2 comments
Closed

Speeding up the Pop animation #43

yigitserin opened this issue Jun 16, 2016 · 2 comments

Comments

@yigitserin
Copy link
Contributor

yigitserin commented Jun 16, 2016

Hello there,

Is it possible to increase the buttons pop speed? Currently it takes about 1 second to all buttons to appear. I would like to decrease that.

Thanks for the work!

@kciter
Copy link
Owner

kciter commented Jun 30, 2016

I'm sorry for my late reply.
Now you can not. If you want, pull-request to me.

@yigitserin
Copy link
Contributor Author

Thanks for the reply, I managed to speed up to animation by reducing the delay to 0.05 from 0.1 here:

private func popAnimationWithOpen() {
    var itemHeight: CGFloat = 0
    var delay = 0.0
    for item in items {
        if item.hidden == true { continue }
        itemHeight += item.size + itemSpace
        item.layer.transform = CATransform3DMakeScale(1, 1, 1)
        item.frame.origin.y = -itemHeight
        item.layer.transform = CATransform3DMakeScale(0.4, 0.4, 1)
        UIView.animateWithDuration(0.3, delay: delay,
                                   usingSpringWithDamping: 0.55,
                                   initialSpringVelocity: 0.3,
                                   options: [.CurveEaseInOut], animations: { () -> Void in
                                    item.layer.transform = CATransform3DMakeScale(1, 1, 1)
                                    item.alpha = 1
            }, completion: nil)

        delay += 0.05
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants