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

Commit

Permalink
Merge pull request #3 from teambition/feature/fix-tap-bug
Browse files Browse the repository at this point in the history
fix: fix container tap bug
  • Loading branch information
wzxha authored Apr 24, 2019
2 parents 51d5e4c + 8e1a406 commit 230f8d7
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions AlertController/AlertController/AlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,6 @@ open class AlertController: UIViewController {
super.viewWillAppear(animated)
}

override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

if !isAlert && cancelButtonTag != 0 {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(AlertController.handleContainerViewTapGesture(_:)))
containerView.addGestureRecognizer(tapGesture)
}
}

open override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
layoutView(self.presentingViewController)
Expand Down Expand Up @@ -615,16 +606,6 @@ open class AlertController: UIViewController {
}
}

// Handle ContainerView tap gesture
@objc func handleContainerViewTapGesture(_ sender: Any) {
// cancel action
let action = actions[cancelButtonTag - 1]
dismiss(animated: true) {
self.dimissAction?()
action.handler?(action)
}
}

// Handle DimmingView tap gesture
@objc func handleBackgroundTapGesture(_ sender: Any) {
if isEnableTapDimmingViewToDimissed {
Expand Down

0 comments on commit 230f8d7

Please sign in to comment.