Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

how to dismiss keyboard swiftui

#if canImport(UIKit)
extension View {
    func hideKeyboard() {
        UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
    }
}
#endif
Source by www.hackingwithswift.com #
 
PREVIOUS NEXT
Tagged: #dismiss #keyboard #swiftui
ADD COMMENT
Topic
Name
4+7 =