Post

Replies

Boosts

Views

Activity

Allowing taps only in vstack deep links within a HStack in widget
Hi, I would like to only allow taps on the deep link VStacks within the HStack. Here's the code snippet of the View: struct ThreeContactWidgetView: View { var entry: Provider.Entry var body: some View { HStack(spacing: 12) { Spacer() ForEach(contacts.prefix(3)) { contact in Link(destination: URL(string: "myApp://call?contactId=\(contact.identifier)")!) { VStack { Image(systemName: "person.crop.circle.fill") .resizable() .aspectRatio(contentMode: .fit) .clipShape(Circle()) Text("\((contact.givenName))") .font(.headline) .padding(.top, 4) } .frame(width: 100) } } Spacer() } .padding() .containerBackground(for: .widget) {} } } I tried placing Spacer().allowsHitTesting(false) for example. However, I was still able to tap on the Spacer() and go into the app, and strangely, uses the deep link of the last contact. Is it even possible to make certain parts of the widget un-tappable in the first place?
1
0
578
Oct ’23
Allowing taps only in vstack deep links within a HStack in widget
Hi, I would like to only allow taps on the deep link VStacks within the HStack. Here's the code snippet of the View: struct ThreeContactWidgetView: View { var entry: Provider.Entry var body: some View { HStack(spacing: 12) { Spacer() ForEach(contacts.prefix(3)) { contact in Link(destination: URL(string: "myApp://call?contactId=\(contact.identifier)")!) { VStack { Image(systemName: "person.crop.circle.fill") .resizable() .aspectRatio(contentMode: .fit) .clipShape(Circle()) Text("\((contact.givenName))") .font(.headline) .padding(.top, 4) } .frame(width: 100) } } Spacer() } .padding() .containerBackground(for: .widget) {} } } I tried placing Spacer().allowsHitTesting(false) for example. However, I was still able to tap on the Spacer() and go into the app, and strangely, uses the deep link of the last contact. Is it even possible to make certain parts of the widget un-tappable in the first place?
Replies
1
Boosts
0
Views
578
Activity
Oct ’23
Xcode not showing compile errors when app crashes
Hi Team, I am using Xcode 15. When my app crashes, Xcode does not show at which point of the code the app crashes when in preview mode using SwiftUI. Is there a setting I need to enable in order to show the position of compile error in the code when the app crashes? Breakpoints are not working as well. Thanks!
Replies
4
Boosts
0
Views
1.3k
Activity
Oct ’23