I am using the example from HWS but I'm having no luck getting buttons to show above the keyboard.
Xcode 13.2.1 / Physical device running iOS 15.3.1
Is this a known issue?
import SwiftUI
struct KeyboardView: View {
@State private var name = "Neil"
var body: some View {
TextField("Enter your name", text: $name)
.textFieldStyle(.roundedBorder)
.toolbar {
ToolbarItemGroup(placement: .keyboard) {
Button("Click me!") {
print("Clicked")
}
}
}
}
}
.toolBar
has to have aNavigationView
to operate. Same for.navigationTitle
,NavigationLink()
, etc. – BullivantNavigationView
is required for a keyboard toolbar to work. We aren't navigating anywhere. I think it's a bug. And I know that I had this working without aNavigationView
a few months ago, but now I can confirm it's not working for me without aNavigationView
. (Xcode 13.3.1, iOS 15.4.1) – Hufnagel