SwiftExtensions/Sources/SwiftExtensions/View+hideKeyboard.swift

15 lines
301 B
Swift

//
// View+hideKeyboard.swift
// kaomojiEmoticonKeyboard
//
// Created by Robert McGovern on 15/11/2020.
//
import SwiftUI
public extension View {
func hideKeyboard() {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}