Ability to set custom views for every state #954
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
With this PR you can set any view as the progress hud for any of its states.
It includes basically a few more methods:
You can add any
UIView
as custom view, but you can go a step further and make that view implements the newSVCustomHUDView
protocol, which includes three optional methods:As I said, I know that you want to keep the library simple and usually you don't merge any customization PRs. So, why I am submitting this anyway? I think that some of the PRs provided for customization are useful just for a few use cases, but I also believe that this one is flexible enough to satisfy a lot of cases. For instance, if you want to add a set of
UIImage
instances to perform an animation, you just need to create aUIImageView
then assign those images and set thisUIImageView
as the custom view for the required state. It also works if you need to perform an animation with aUIBezierPath
orCAShapeLayer
; you just need to prepare your view, set it and you are done.Also, I believe that this goes just a little further from the current customization. Whereas now you can add a
UIImage
for any state, with this PR you will be able to set a whole view, but the concept is quite similar.If you think that you could want to merge this into the main project, please submit an answer and I'll complete it.
In any case, thanks for your project. It's awesome :)