Post

Replies

Boosts

Views

Activity

Reply to onDeleteCommand modifier
In beta 6 of Xcode 12/Big Sur, I've been able to get this working on macOS simply by attaching this modifier to a List, like so: var body: some View { 	List { 		/* Your list-populating ForEach goes here */ 	} 	.onDeleteCommand(perform: { print("Delete command received!") }) } A pitfall to look out for: I use .deleteDisabled() conditionally on each NavigationLink in my List, and that's ignored by .onDeleteCommand(), so I return early in the action if my disable condition is met. The .onDelete() modifier on the ForEach respects .deleteDisabled() when I two-finger swipe on the Mac's trackpad, though.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’20
Reply to Text insertion in UIViewRepresentable-wrapped UITextField goes haywire after inserting emoji
Okay, this bug can be resolved if you make the following change to the updateUIView(_: context:) function: func updateUIView(_ uiView: UIViewType, context: UIViewRepresentableContext<WrappedTextView>) { &#9;&#9;if (uiView.text != text) { &#9;&#9;&#9;&#9;uiView.text = text &#9;&#9;} &#9;&#9;if isFirstResponder && !context.coordinator.didBecomeFirstResponder { &#9;&#9;&#9;&#9;uiView.becomeFirstResponder() &#9;&#9;&#9;&#9;context.coordinator.didBecomeFirstResponder = true &#9;&#9;} }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’20
Reply to App Store Distribution fails on valid com.apple.developer.healthkit.access value
Same issue for me regarding HealthKit — I don't want health record access, but I cannot remove the key from my entitlements file without removing the HealthKit entitlement entirely. Uploads to TestFlight worked fine with an empty array for com.apple.developer.healthkit.access on 12 January, 2021, but started failing for me yesterday. I've filed FB8972571.
Jan ’21