Skip to content
This repository has been archived by the owner on Feb 17, 2020. It is now read-only.

Commit

Permalink
Invalidating KVO on dismiss.
Browse files Browse the repository at this point in the history
  • Loading branch information
benguild committed Oct 26, 2018
1 parent 2c961e0 commit f698238
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion PullToDismissTransition.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PullToDismissTransition"
s.version = "0.7.2"
s.version = "0.7.3"
s.homepage = "https://github.com/benguild/PullToDismissTransition"
s.summary = "(Beta) Uses `UIPercentDrivenInteractiveTransition` and `UIViewControllerAnimatedTransitioning` to quickly implement nice “pull-to-dismiss” interactions on modal view controller(s). — Also handles `UIScrollView` bounce toggling dynamically when necessary. "
s.license = 'MIT'
Expand Down
11 changes: 7 additions & 4 deletions PullToDismissTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,13 @@ public class PullToDismissTransition: UIPercentDrivenInteractiveTransition {
}

viewController.dismiss(animated: true) { [weak self] in
self?.delegate?.didFinishTransition(
for: viewController,
didDismiss: (viewController.presentingViewController == nil)
)
let didDismiss = (viewController.presentingViewController == nil)

if didDismiss {
self?.transitionDelegateObservation?.invalidate()
}

self?.delegate?.didFinishTransition(for: viewController, didDismiss: didDismiss)
}

delegate?.didBeginPullToDismissAttempt(on: viewController)
Expand Down

0 comments on commit f698238

Please sign in to comment.