Post

Replies

Boosts

Views

Activity

Reply to navigationTitle Scroll Behavior Fails when NavigationSplitView has Overlay or ZStack
A workaround—stumbled across it and have no idea why it'd work (but it does): NavigationSplitView { ZStack { NoteListView(notes: notes, selection: $selection) // Workaround for https://developer.apple.com/forums/thread/738313 // Needs to be > 110? .padding(.top, -120) .padding(.top, 120) // Prevent notes from being covered by input .padding(.bottom, 100) NoteInputView(scrollProxy: scrollProxy) .frame(maxHeight: .infinity, alignment: .bottom) } .navigationTitle(Text("Notes")) } The padding needs to be sufficiently large for it to work on all iOS devices, e.g. -1 & +1 won't work. Roughly seems to correspond to the space that the expanded toolbar (e.g. large title) occupies.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Reply to @Transient update doesn't propagate to view
@Transient still does not publish in XCode 15.0 (non beta) @Attribute(.ephemeral) var isChecked = false does work for me, for the time being.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to navigationTitle Scroll Behavior Fails when NavigationSplitView has Overlay or ZStack
A workaround—stumbled across it and have no idea why it'd work (but it does): NavigationSplitView { ZStack { NoteListView(notes: notes, selection: $selection) // Workaround for https://developer.apple.com/forums/thread/738313 // Needs to be > 110? .padding(.top, -120) .padding(.top, 120) // Prevent notes from being covered by input .padding(.bottom, 100) NoteInputView(scrollProxy: scrollProxy) .frame(maxHeight: .infinity, alignment: .bottom) } .navigationTitle(Text("Notes")) } The padding needs to be sufficiently large for it to work on all iOS devices, e.g. -1 & +1 won't work. Roughly seems to correspond to the space that the expanded toolbar (e.g. large title) occupies.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to SwiftData: "Illegal attempt to establish a relationship 'item' between objects in different contexts
After lots of trial and error, I got this working when I run the app for the first time. But when I force quit, the app does not load subsequently. Similar to what all of you are reporting, it works with some of my entities, but not with others, without any easily discernible difference between them.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23