Skip to content

Commit

Permalink
✨FEAT: AlertController 밖 화면 터치시 dismiss되도록 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
yeahg-dev committed Feb 20, 2023
1 parent a5ff4bc commit c6b72c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ extension UIViewController {
}
}

present(alertController, animated: false)
present(alertController, animated: true) {
let tapGesture = UITapGestureRecognizer(
target: alertController,
action: #selector(self.dismissAlertController))
alertController.view.superview?.subviews[0].addGestureRecognizer(tapGesture)
}
}

@objc func dismissAlertController(){
self.dismiss(animated: true, completion: nil)
}

}

0 comments on commit c6b72c7

Please sign in to comment.