-
Notifications
You must be signed in to change notification settings - Fork 780
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
Refactoring TransitionAnimationType #137
Refactoring TransitionAnimationType #137
Conversation
static func fromString(string: String) -> TransitionAnimationType? { | ||
if String(TransitionAnimationType.Fade) == string { | ||
return .Fade | ||
} else if String(TransitionAnimationType.SystemCube(direction: .Left)) == string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that may not work since it is a fully qualified like SystemCube(IBAnimatable.TransitionFromDirection.Left)", we may need to do some like what we did in maskStarFromString
in MaskDesignable
, in IB, we may configure the string as "SystemCube(Left)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure. That part is really not finished 😅 I let it that way to talk that new implementation, but didn't find a nice solution yet.
In order to do as MaskDesignable
, we are will need to hard code all the enums, is that a good solution?
@tbaranes nice attempt , I really like the new |
Here two new commits who may finalise that PR if it seems correct to everyone:
Everything is working as expected! What do you think about that implementation? :) |
Very cool implementation. I like it very much. We may have more I will update the wiki to mention Please merge it when you feel is ready. 👍👍👍 Well done. |
Let's merge that first step! It's still improvable with less breaking change 😆 Could you update the CHANGELOG to explain the breaking change? Since it's a big one, I prefer let you write it to be clear. Also, if it's ok for you, we can release the IBAnimatable 2.1 👍 |
Cool, @tbaranes doing 2.1 now. |
Following the discussion in #134, I tried to review the implementation of
TransitionAnimationType
in order to make it thiner. The current implementation is answering that needs: the enum is really smaller, and the switch is more generic / readable.The architecture seems nice, but there are some points that need a generic solution:
TransitionAnimationType
from string -> how to implement it?For now, I just hard coded one case of
SystemCube
, andFade
, it's working as expected.Any suggestions for these issues? Until now, I didn't find any nicer solution than the implementation currently used in master.
If you want to make some tests, use this branch, it's still very experimental 💭
/!\ NOT READY TO BE MERGED /!\