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
Method slideOut won't slide out everytime #46
Comments
Will add |
👍 |
After check the implementation of |
@tbaranes you are right. that is the problem of |
We shouldn't use Something like that would be more appropriate: public func slideOutLeft(completion: AnimatableCompletion? = nil) {
let x = -frame.width * force
animateOutWithX(x, alpha: 1, completion: completion);
}
public func slideOutRight(completion: AnimatableCompletion? = nil) {
guard let unwrappedSuperview = self.superview else {
return
}
let x = unwrappedSuperview.frame.maxX * force
animateOutWithX(x, alpha: 1, completion: completion);
} The only bad point is that we can't use |
After a better looking in the code, the solution would be more something like this: public func slideOutDown(completion: AnimatableCompletion? = nil) {
guard let unwrappedSuperview = self.superview else {
return
}
let y = (unwrappedSuperview.frame.height - frame.minY) * force
animateInWithY(y, completion: completion)
} I will make some tests, and a PR if that's working on monday |
@tbaranes My concern is the animating view may not be the directly subview of the the root view. For example, VC.view -> UIStackView(not 100% width and height) -> UIView(one item within StackView) -> AnimatableView. I have some ideas to get the distance (width/height).
I don't know which one can be the solution yet. please let me know if you have any ideas. |
Oh right, I didn't think about the |
@tbaranes To slide out the container. we can use containerView, then put a VC within it. that's why i put the 3rd option above. But I haven't thought carefully for all options. But first thing would be side out of the screen. I think the library is hard to handle 100% of scenarios. It need to add a lot of |
I agree with that. Following the case, the option 3 seems to be the right one using with container view controllers. 👍 |
@tbaranes using the device width/height should be a feasible solution. In that case if we want to slide out from a sub view (container view) we still can slide out but it will move further. In our case, it looks faster that it should be because the visible distance is shorter than the actual moving distance. We can modify some parameters to customise the speed. |
I think it's add complexity following the usage case. Anyway, it's still a good option, improvable later if necessary. |
Following the code, the
slideOut
methods are always300 * force
, but if we are running this example on an iPad with a force to 1, it will never get the outside screen.Is there a reason to have hardcoding that constant?
The text was updated successfully, but these errors were encountered: