Created
August 29, 2018 22:05
-
-
Save RustyKnight/64cd35cd77a1cc7dfe6cfd6ec87a3792 to your computer and use it in GitHub Desktop.
Extension to hide the keyboard (resign first responder) globally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
extension UIViewController { | |
@objc func hideKeyboard() { | |
UIApplication.shared.sendAction(#selector(UIApplication.resignFirstResponder), to: nil, from: nil, for: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment