iOS: Use interactive keyboard dismissal

This commit is contained in:
Shadowfacts 2020-09-27 22:39:47 -04:00
parent 6b98d55f59
commit cf1574c54a
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,7 @@ struct ContentView: View {
bottomBar bottomBar
} }
.onAppear(perform: tweakAppearance)
.onReceive(navigator.$currentURL, perform: { (new) in .onReceive(navigator.$currentURL, perform: { (new) in
urlFieldContents = new.absoluteString urlFieldContents = new.absoluteString
}) })
@ -104,6 +105,10 @@ struct ContentView: View {
.padding(.top, 4) .padding(.top, 4)
} }
private func tweakAppearance() {
UIScrollView.appearance().keyboardDismissMode = .interactive
}
private func commitURL() { private func commitURL() {
guard let url = URL(string: urlFieldContents) else { return } guard let url = URL(string: urlFieldContents) else { return }
navigator.changeURL(url) navigator.changeURL(url)