Posts

Post not yet marked as solved
3 Replies
0 Views
Persisting navigation path seems to get these to work as expected: import SwiftUI class NavigationModel: ObservableObject {     @Published var presentedItems: [Int] = [] } struct SidebarEntry: Identifiable, Hashable {     let id = UUID()     var localizedName: String } let sidebarEntries = [     SidebarEntry(localizedName: "Files"),     SidebarEntry(localizedName: "Bookmarks"), ] // MARK: - main - @main struct NewNavigationTestApp: App {     @State private var sidebarSelection: SidebarEntry?     @StateObject var navigationModel =  NavigationModel()     var body: some Scene {         WindowGroup {             NavigationSplitView {                 List(sidebarEntries, selection: $sidebarSelection) { entry in                     NavigationLink("\(entry.localizedName)", value: entry)                 }             } detail: {                 ZStack { // workaround                     if let sidebarSelection {                         if sidebarSelection.localizedName == "Files" {                             TestStackView()                         } else if sidebarSelection.localizedName == "Bookmarks" {                             Text("Bookmarks View")                         } else {                             Text("Unknown View")                         }                     } else {                         Text("No selection")                     }                 }             }             .environmentObject(navigationModel)         }     } } // MARK: - FilesView - struct TestStackView: View {     @EnvironmentObject var navigationModel: NavigationModel     var body: some View {         NavigationStack(path: $navigationModel.presentedItems) {             List(0 ..< 999) { idx in                 NavigationLink("\(idx)", value: idx)             }             .navigationTitle("Numbers")             .navigationDestination(for: Int.self) { idx in                 Text("Hello \(idx)")             }         }     } }
Post marked as solved
1 Replies
0 Views
It's not a shortcut, but an additional effect on a text selection of the editor preference: Preferences > Text Editing > Code completion > Automatically insert closing braces ("}") (which is turned on by default) To test it, select a line and then enter a { - line will be wrapped as appeared in the video.
Post not yet marked as solved
1 Replies
0 Views
Replied In Books Broken?
Yes. It’s not mentioned in the realease notes under known issues. Will report it and see.