diff --git a/CHANGELOG.md b/CHANGELOG.md index 37593a2..f6b45ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,7 @@ # CHANGELOG +### v1.1.1 +- Fixed crash problem using WKWebView's scrollview. #18 -## *Unreleased* - -#### Added - -#### Removed - -#### Updated - -#### Fixed - -## **Released** ### v1.1 #### Added - Edge shadow #9 diff --git a/PullToDismiss.podspec b/PullToDismiss.podspec index 5341417..f20adb5 100644 --- a/PullToDismiss.podspec +++ b/PullToDismiss.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "PullToDismiss" - s.version = "1.1" + s.version = "1.1.1" s.summary = "Dismiss ViewController by pulling scroll view or navigation bar in Swift." s.homepage = "https://github.com/sgr-ksmt/PullToDismiss" # s.screenshots = "" diff --git a/Sources/PullToDismiss.swift b/Sources/PullToDismiss.swift index 1bca6e7..5640f89 100644 --- a/Sources/PullToDismiss.swift +++ b/Sources/PullToDismiss.swift @@ -32,6 +32,7 @@ open class PullToDismiss: NSObject { fileprivate var previousContentOffsetY: CGFloat = 0.0 fileprivate weak var viewController: UIViewController? + private var __scrollView: UIScrollView? private var panGesture: UIPanGestureRecognizer? private var backgroundView: UIView? private var navigationBarHeight: CGFloat = 0.0 @@ -47,6 +48,7 @@ open class PullToDismiss: NSObject { public init(scrollView: UIScrollView, viewController: UIViewController, navigationBar: UIView? = nil) { super.init() scrollView.delegate = self + __scrollView = scrollView self.viewController = viewController if let navigationBar = navigationBar ?? viewController.navigationController?.navigationBar { let gesture = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:))) @@ -60,6 +62,9 @@ open class PullToDismiss: NSObject { if let panGesture = panGesture { panGesture.view?.removeGestureRecognizer(panGesture) } + + __scrollView?.delegate = nil + __scrollView = nil } fileprivate var targetViewController: UIViewController? {