Skip to content

Commit 6f2d016

Browse files
[fix] Slide Down animation
1 parent 28cb021 commit 6f2d016

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Source/WSPopupViewController.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public class WSPopupViewController: WSScrollViewController {
198198
private func restoreAnimatedProperties() {
199199
view.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.3)
200200
popupView.alpha = 1
201-
scrollView.contentInset.top = 0
201+
scrollView.contentInset = .zero
202202
}
203203

204204
@objc public func dismissKeyboard() {
@@ -212,15 +212,14 @@ public class WSPopupViewController: WSScrollViewController {
212212

213213
@objc public func dismissPopupWithSlideDownAnimation() {
214214
dismissKeyboard()
215-
215+
216216
UIView.animate(
217217
withDuration: 0.5, delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, options: .curveLinear, animations: { () -> Void in
218218
self.view.backgroundColor = .clear
219219
self.popupView.alpha = 0
220-
self.scrollView.contentInset.top = 2000 //hide
221-
self.scrollView.contentOffset.y = 2000 //hide
220+
self.scrollView.contentInset.top = UIScreen.main.bounds.height
222221
}, completion: { isFinished in
223-
self.dismiss(animated: true, completion: nil)
222+
self.dismiss(animated: false, completion: nil)
224223
})
225224
}
226225

0 commit comments

Comments
 (0)