-
Notifications
You must be signed in to change notification settings - Fork 38
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
Avoid API misusage #17
Comments
I was thinking in a similar direction some time ago but couldn't make the auto-completion in Xcode work (even if the code was compiling and all was good) so I deviated towards the current API structure. Do you have a working example of what you're proposing? I'd be curious to look at it |
Unfortunately this is private project, all I can do is extract a small chunk of code like above or create a sample project if that can help. I might have more time later this week to provide a working sample or I can fork and PR, what do you prefer? Code completion was hard to get, Xcode failed until I figured it out how I should write it (even with version 0.4.1). I'm using Xcode 9.2 on Sierra. |
If you have the time to grab that piece of code and shove it into an Xcode project I'll have a look 👍 |
Hi, public struct AnimatedSink<Base> {
public var type: AnimationType<Base>!
public var base: Base
public init(base: Base, type: AnimationType<Base>? = nil) {
self.base = base
self.type = type
}
} @amarcadet's solution works for me and with Xcode 9.4 code completion is working well. I would recommend adding this. |
First of all, congrats for this nice helper library, I once try to build something pretty similar but didn't make it, yours looks really great, simple and powerful. 👍
After using it on a recent project I have faced some issues by misusing the API.
I was looking to do a simple fade between two views instead of just hidding.
I first wrote this, but got caught by a runtime issue because
type
wasnil
here.After looking at your sample code I realized I wasn't using any of the default animations helpers, I just wanted a simple fade, without
fade
,flip
,tick
oranimation
. The.alpha
sink on its own was right for my needs.The current
.animated
property on its own does nothing if not used in junction with one of the default animated sink listed above.What do you think about adding something like this in replacement (or not) of the current
.animated
property sink?Which give:
I might have missed something in the API design, if that's the case sorry for inconvenience!
The text was updated successfully, but these errors were encountered: