Post

Replies

Boosts

Views

Activity

Reply to Sections in SwiftUI Tables?
I could use a List but it's not as powerful as a Table. I want to achieve something similar that you can find with Finder. It's most likely on Apple's list (no pun intended) already but had other priorities. Let's hope for iOS 18 and macOS 15!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Also, this seems to be specific to the list selection in the sidebar in NavigationSplitView as I'm using the same app model elsewhere in my project and everything works fine. I did have the same crash in another part of my project where I use a similar UI, which was also using the app model. In that particular case, I could remove the property from the app model, which solved the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Why do you need a shared static property on AppModel? This is obviously just a demo project to demonstrate the issue. In my real project, that property has to be accessible from other parts of the app Since Folder conforms to identifiable in SidebarView could you just use ForEach(folders) { folder in? Doesn't make a difference. The crash output looks like this: @ObservationIgnored private let _$observationRegistrar = Observation.ObservationRegistrar() internal nonisolated func access<Member>( keyPath: KeyPath<AppModel , Member> ) { _$observationRegistrar.access(self, keyPath: keyPath) } internal nonisolated func withMutation<Member, MutationResult>( keyPath: KeyPath<AppModel , Member>, _ mutation: () throws -> MutationResult ) rethrows -> MutationResult { try _$observationRegistrar.withMutation(of: self, keyPath: keyPath, mutation) --> Thread 1: Simultaneous accesses to 0x281bcc760, but modification requires exclusive access } @ObservationIgnored private var _selectedFolder: Folder? = nil
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’23
Reply to Swift compiler crash in Xcode 15 beta 3 (15A5195k)
Here's a project to demonstrate the issue: import SwiftUI import Observation struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() } } typealias ResolveServiceCompletionBlock = (Bool, Error?) -> Void @Observable class ServiceBrowser: NSObject { fileprivate var resolveServiceCompletionHandler: ResolveServiceCompletionBlock? = nil } It seems like the issue is with the Observation protocol as removing @Observable works. Apple folks: FB12567650
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’23
Reply to UIPointerStyle.hidden() with SwiftUI?
With UIKit, it is possible to set the pointer style or just hide it through the UIPointerInteractionDelegate: func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? { // Hide the pointer in the screen view return UIPointerStyle.hidden() } I’m unable to find anything that would do the same on SwiftUI. Apple folks: FB12418053
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’23
Reply to Sections in SwiftUI Tables?
I could use a List but it's not as powerful as a Table. I want to achieve something similar that you can find with Finder. It's most likely on Apple's list (no pun intended) already but had other priorities. Let's hope for iOS 18 and macOS 15!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Was fine on macOS but now borked in the latest RC.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Still an issue with Beta 8. Perhaps beta 9 (if there's an update this week), RC or even 17.1 😬
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Can't use SF Symbols 5.0 in Xcode 15
I have the same issue if I run Xcode 15 on Ventura but it's fine on Sonoma. Were you able to fix this issue?
Topic: Design SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Also, this seems to be specific to the list selection in the sidebar in NavigationSplitView as I'm using the same app model elsewhere in my project and everything works fine. I did have the same crash in another part of my project where I use a similar UI, which was also using the app model. In that particular case, I could remove the property from the app model, which solved the issue.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to iOS 17b6: Simultaneous accesses to ..., but modification requires exclusive access crash using Observation and SwiftUI
Why do you need a shared static property on AppModel? This is obviously just a demo project to demonstrate the issue. In my real project, that property has to be accessible from other parts of the app Since Folder conforms to identifiable in SidebarView could you just use ForEach(folders) { folder in? Doesn't make a difference. The crash output looks like this: @ObservationIgnored private let _$observationRegistrar = Observation.ObservationRegistrar() internal nonisolated func access<Member>( keyPath: KeyPath<AppModel , Member> ) { _$observationRegistrar.access(self, keyPath: keyPath) } internal nonisolated func withMutation<Member, MutationResult>( keyPath: KeyPath<AppModel , Member>, _ mutation: () throws -> MutationResult ) rethrows -> MutationResult { try _$observationRegistrar.withMutation(of: self, keyPath: keyPath, mutation) --> Thread 1: Simultaneous accesses to 0x281bcc760, but modification requires exclusive access } @ObservationIgnored private var _selectedFolder: Folder? = nil
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Missing recommended icon for iPad when using new xCode 14 single size app icon
I have the same issue. Were you able to pass review still?
Replies
Boosts
Views
Activity
Aug ’23
Reply to SwiftUI toolbar item keyboard shortcut not showing when holding command key on iPad?
So this is the solution: Button { } label: { Label("Connect", systemImage: "bolt") .labelStyle(.titleAndIcon) } .keyboardShortcut("k", modifiers: .command) The label obviously needs a title (my mistake) but you have to specify .labelStyle(.titleAndIcon) to make the shortcut appear, which is not obvious at all.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to SwiftUI toolbar item keyboard shortcut not showing when holding command key on iPad?
Apple folks: FB12700187
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to DNSServiceNATPortMappingCreate broken (again) in macOS 13 beta 3 23A5286i
So it seems this may be a router failure on my end and was just a coincidence that it stopped working when I updated to the latest beta. It suddenly started working again this morning. I would still recommend to check the issue in case there is something indeed causing some instability.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to DNSServiceNATPortMappingCreate broken (again) in macOS 13 beta 3 23A5286i
Right. 14, not 13. Sorry!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Swift compiler crash in Xcode 15 beta 3 (15A5195k)
So adding @ObservationIgnored seems to work around the issue.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Swift compiler crash in Xcode 15 beta 3 (15A5195k)
Here's a project to demonstrate the issue: import SwiftUI import Observation struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() } } typealias ResolveServiceCompletionBlock = (Bool, Error?) -> Void @Observable class ServiceBrowser: NSObject { fileprivate var resolveServiceCompletionHandler: ResolveServiceCompletionBlock? = nil } It seems like the issue is with the Observation protocol as removing @Observable works. Apple folks: FB12567650
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to Symbol not found when running iPad app in Vision Pro Simulator
I tried adding a new target to my project just in case the issue was with the current target I was trying to run but I get the same error even if the new target doesn't include any of the components of the other target and is just a plain "Hello, world" SwiftUI app.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to UIPointerStyle.hidden() with SwiftUI?
With UIKit, it is possible to set the pointer style or just hide it through the UIPointerInteractionDelegate: func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? { // Hide the pointer in the screen view return UIPointerStyle.hidden() } I’m unable to find anything that would do the same on SwiftUI. Apple folks: FB12418053
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’23