Post

Replies

Boosts

Views

Activity

Reply to Custom Modifier Using Text's underline(_:color:)
@OOPer It seems like your solution doesn't work when trying to use state logic inside the modifier (which does work with ViewModifier). An example: struct HulkSmash: TextModifier {   @State var isHulk: Bool = false   func body(text: Text) -> some View {     text.bold()       .font(isHulk ? .system(.largeTitle, design: .rounded) : .body)       .foregroundColor(isHulk ? .init(.systemGreen) : .init(.systemFill))       .onTapGesture {         print("tap triggered")         isHulk.toggle()       }   } } Here the tap is triggered, however, the view does not update. Do you have any idea why this doesn't work?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to watchOS `transferFile`
Thank you @darkpaw! Your error is different than WCErrorCodeFileAccessDenied, so at least I know that there might be a different issue in my code. Thanks so much. I'd keep coding as though the file has been transferred across You're right, but I'd also have to implement something in compiler conditionals on the watch side, otherwise I'll never be able to check the functionality after transferring the file...
Topic: App & System Services SubTopic: General Tags:
Sep ’22
Reply to SwiftData Predicates and .contains(where: )
I'm not exactly sure if this is the same issue, but from what I understand, collections, enums and other non-trivial value types are stored as binary data in CloudKit (you can check in CloudKit console) and their contents therefore can't be queried with a predicate. It's also mentioned here: https://www.hackingwithswift.com/quick-start/swiftdata/using-structs-and-enums-in-swiftdata-models
Aug ’24
Reply to Xcode says "Running .. on .. Apple Watch" all the time but never runs. Frustrating
Oddly enough, disabling WiFi both on the iPhone and watch seems to fix this for me (at least at the moment). for reference: https://stackoverflow.com/a/61053243/2064473
Replies
Boosts
Views
Activity
Jun ’21
Reply to Custom Modifier Using Text's underline(_:color:)
@OOPer It seems like your solution doesn't work when trying to use state logic inside the modifier (which does work with ViewModifier). An example: struct HulkSmash: TextModifier {   @State var isHulk: Bool = false   func body(text: Text) -> some View {     text.bold()       .font(isHulk ? .system(.largeTitle, design: .rounded) : .body)       .foregroundColor(isHulk ? .init(.systemGreen) : .init(.systemFill))       .onTapGesture {         print("tap triggered")         isHulk.toggle()       }   } } Here the tap is triggered, however, the view does not update. Do you have any idea why this doesn't work?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to watchOS `transferFile`
Thank you @darkpaw! Your error is different than WCErrorCodeFileAccessDenied, so at least I know that there might be a different issue in my code. Thanks so much. I'd keep coding as though the file has been transferred across You're right, but I'd also have to implement something in compiler conditionals on the watch side, otherwise I'll never be able to check the functionality after transferring the file...
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Previews doesn't work when used in a package that imports other packages.
I'm encountering the same error.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23
Reply to SwiftData Predicates and .contains(where: )
I'm not exactly sure if this is the same issue, but from what I understand, collections, enums and other non-trivial value types are stored as binary data in CloudKit (you can check in CloudKit console) and their contents therefore can't be queried with a predicate. It's also mentioned here: https://www.hackingwithswift.com/quick-start/swiftdata/using-structs-and-enums-in-swiftdata-models
Replies
Boosts
Views
Activity
Aug ’24