mirror of
https://github.com/AU-COVIDSafe/mobile-ios.git
synced 2025-04-05 22:35:00 +00:00
16 lines
501 B
Swift
16 lines
501 B
Swift
![]() |
import Foundation
|
||
|
import UIKit
|
||
|
|
||
|
extension UIViewController {
|
||
|
// Calling this function will add a tap gesture to the view. On tap, the keyboard will be dismissed
|
||
|
func dismissKeyboardOnTap() {
|
||
|
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(OTPViewController.dismissKeyboard))
|
||
|
view.addGestureRecognizer(tap)
|
||
|
view.addGestureRecognizer(tap)
|
||
|
}
|
||
|
|
||
|
@objc func dismissKeyboard() {
|
||
|
view.endEditing(true)
|
||
|
}
|
||
|
}
|