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

Add delay between transitions #11

Closed
MaciDE opened this issue Jan 16, 2018 · 3 comments
Closed

Add delay between transitions #11

MaciDE opened this issue Jan 16, 2018 · 3 comments

Comments

@MaciDE
Copy link

MaciDE commented Jan 16, 2018

First of all thanks for this great project!

Is it possible to add an delay between the transition. For now it seems to be an endless animation and I would like to add a small delay between each gradient.

@gonzalonunez
Copy link
Owner

Hi @MaciDE 👋

This is definitely possible! It's what the group parameter in slide(_:_:) is designed for. This will give you access to the CAAnimationGroup that's later added to the layer.

Your code will look something like this:

skeletonCell.slide(to: .right) { group in
  group.beginTime = CACurrentMediaTime() + 0.2
  return group
}

@gonzalonunez
Copy link
Owner

I'm not entirely sure about the delaying logic, you should double check that! Also, I'll probably change the function signature to (CAAnimationGroup) -> Void in the future.

@gonzalonunez
Copy link
Owner

Going to go ahead and close this issue, feel free to reopen it if you encounter any problems!

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