SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.31k stars 744 forks source link

Ability to hide message without an animation #276

Closed foxware00 closed 5 years ago

foxware00 commented 5 years ago

I want the hide animation to be present, but in a particular case I want the custom view to disappear like isHidden = true instead of playing the animation. I see no easy way of achieving this. Am I missing something obvious?

wtmoose commented 5 years ago

No, nothing like that. You're the first to ask. I labelled this one as an enhancement request.

foxware00 commented 5 years ago

I'm happy to open a PR, i'm just not quite sure how you'd achieve this. I was thinking hide(animated: Bool = true) or similar functionality

wtmoose commented 5 years ago

Try hide(animated: false) on the head of master branch.

foxware00 commented 5 years ago

@wtmoose Are you saying you've added it? I can't seem to see any updates on master

wtmoose commented 5 years ago

Oops. Try now

foxware00 commented 5 years ago

@wtmoose Worked perfectly, thank you!

sundaleek commented 4 years ago

Hello @wtmoose . I hope you are stay safe during these time. Is there a way to present without animation?

wtmoose commented 4 years ago

@sundaleek would animating with zero duration work? If so, then yes you can do that. All of the animators have customizable duration. You'd instantiate the animator of your choice, configure the duration, and use config.presentationStyle = .custom(animator: animator).