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

Added custom animations capability. #39

Merged
merged 4 commits into from
Jun 13, 2016
Merged

Added custom animations capability. #39

merged 4 commits into from
Jun 13, 2016

Conversation

basememara
Copy link
Contributor

Now you can create your own custom animations and feed it into NVActivityIndicatorView!

To use, conform your custom animation class to NVActivityIndicatorAnimationDelegate and use it:

startActivityAnimating("Loading...", type: CustomActivityIndicator())

@ninjaprox ninjaprox merged commit ba7f9ce into ninjaprox:master Jun 13, 2016
@ninjaprox
Copy link
Owner

I think this is useful feature and would like to release this in version 3.x. However, I merged to master branch by mistake so I will reverted these commits on master and they are still there on features/custom-animation. Sorry for this inconvenience 👻.

@ninjaprox
Copy link
Owner

Btw, thanks to this, we have new audio equalizer animation in version 2.x 🎵.

@basememara
Copy link
Contributor Author

Nice, glad I could help. Sounds good for v3. I think the code I put for this can be cleaned up a bit. I make an assumption in it that if the customType is nil then use the enum, which doesn't sit well with me.

Also, it would be great if you can post a roadmap in the readme if you had one in mind. Maybe we can add/adjust ideas and PR's 🤔

@basememara
Copy link
Contributor Author

Oh and next time I create a PR, I'll ask you to open a branch 👍

@basememara
Copy link
Contributor Author

Hey I have a better idea on implementing this. Instead of an overloaded function, maybe we create an extra enum case called Custom that would accept an animation instance, like this:

startActivityAnimating(type: .Orbit)
startActivityAnimating(type: .Custom(MyAnimation())

@ninjaprox
Copy link
Owner

Great, that's also what I'm thinking of. However NVActivityIndicatorType is enum with raw values for now so if using .Custom(MyAnimation(), we need to change the whole NVActivityIndicatorType to enum with associated values and it will affect other places.
Secondly, NVActivityIndicatorView is supporting to change its type on IB as well so we need to find out a way compatible with this or trade off this ability.
Additionally, it would be great to fully support Obj-C as well (currently some APIs are unavailable in Obj-C) in version 3.x.

@ninjaprox
Copy link
Owner

As for roadmap and ideas, PR discussions, sure, we can learn from other projects to manage by using issues, tags,... Will find an appropriate way and kick it off.

@basememara
Copy link
Contributor Author

Oooo I don't support giving obj-c love. What makes this lib unique and modern is that its pure Swift, so tying it to legacy will add awkwardness. I vote for letting obj-c die +1. I say v3 should be Swift 3 themed.

@ninjaprox
Copy link
Owner

Can't agree more.

@Samback
Copy link

Samback commented Jul 14, 2016

As I see this solution is really look like what I did at #42

@ninjaprox ninjaprox modified the milestone: v3.x Aug 16, 2016
@ninjaprox ninjaprox mentioned this pull request Feb 16, 2017
@ninjaprox ninjaprox mentioned this pull request Feb 27, 2018
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

Successfully merging this pull request may close these issues.

3 participants