Post not yet marked as solved
Hi,
Does anyone knows if it is possible (or there are plans) to enable associating a .searchable modifier with a keyboard shortcut?
It seems a no brainer and very useful for iPadOS or Catalyst.
Thanks
Hi,
In iPadOS can we use a .focusedSceneValue, defined from a command/Button inside a Scene, from inside the .command modifier attached to the scene?
Like this:
@main
struct test_focusedSceneValueApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
.commands {
NavigationCommands()
}
}
}
struct NavigationCommands: Commands {
@FocusedValue(\.filterAction) var filterAction
var body: some Commands {
CommandMenu("Navigate") {
Button("Test focusedSceneValue") {
filterAction?()
}
.keyboardShortcut("5")
}
}
}
struct ContentView: View {
@FocusState var isFiltering: Bool
@State private var focusField: String = "***** field *****"
var body: some View {
TextField("***** focus", text: $focusField)
.focused($isFiltering)
.focusedSceneValue(\.filterAction) {
print("test successful")
isFiltering = true
}
}
This code is almost the same from the sample code from the documentation, however I can only retrieved nil values from the @FocusedValue and not the defined value.
Thanks.
Post not yet marked as solved
Hi,
I love the new new ScrollViewReader, as it enables to scroll to an arbitrary position.
However I would like to use it with lists, especially the new Expanding Lists, as outlines (like NSOutlineView) with some sort of bookmarks are critical for an app that I’m porting to iOS.
Is that possible in any way, or are we, for now, limited to scroll views with nested ForEachs?
Thanks, and great work.