Post

Replies

Boosts

Views

Activity

Comment on textSelection does not work
I have just tried and you can select the text. If you mean you don't get the blue range grabbers, then that's the intended behaviour. Documentation: "These menu items operate on the entire contents of the Text view; the person can’t select a range of text like they can on macOS."
Topic: UI Frameworks SubTopic: SwiftUI
Jul ’25
Comment on Computed property for Shape within the SwiftUI's views
It depends on how you want to abstract the shape (some Shape vs some View). If it's just the Shape you want to extract and conditionally apply, then using AnyShape is fine and won't introduce significant performance overhead. However, if you also want to customise other view properties or combine different views per condition, then using @ViewBuilder is recommended.
Topic: UI Frameworks SubTopic: SwiftUI
Jun ’25
Comment on Weird @Binding behavior, doesn't update the value until I set it into different one
It isn't a parameter but the notation for explicitly capturing the specified values from within a closure. Closures are a complex thing in Swift and you can read more in this article and see it in action, like you may have before here: https://www.hackingwithswift.com/articles/179/capture-lists-in-swift-whats-the-difference-between-weak-strong-and-unowned-references.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’23
Comment on textSelection does not work
I have just tried and you can select the text. If you mean you don't get the blue range grabbers, then that's the intended behaviour. Documentation: "These menu items operate on the entire contents of the Text view; the person can’t select a range of text like they can on macOS."
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’25
Comment on SWIFT UI - HTTP POST method sending as GET method
You need to make sure you set the Content-Type header like you do when using cURL: request.setValue("application/json", forHTTPHeaderField: "Content-Type").
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’25
Comment on Computed property for Shape within the SwiftUI's views
It depends on how you want to abstract the shape (some Shape vs some View). If it's just the Shape you want to extract and conditionally apply, then using AnyShape is fine and won't introduce significant performance overhead. However, if you also want to customise other view properties or combine different views per condition, then using @ViewBuilder is recommended.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jun ’25
Comment on phaseAnimator: prevent opacity change?
I'm not really familiar with Live Activities, but I understand that you get a context that has some state and attributes passed from your main app. I'm assuming when this changes, that is your trigger.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
May ’24
Comment on SwiftUI Orientation Change
That's great. I suggest you create a new post detailing your new issue as I don't have enough information here to fix it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’24
Comment on WatchOS Battery Level in SwiftUI
Can you please mark that answer as correct to close this thread and let others know your issue has been solved.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on How to create window without border between title bar and content view?
Can you please mark that answer as correct to close this thread and let others know your issue has been solved.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on customized Navigation bar
If that was the answer to your problem, can you please mark that reply as correct to also let others know your issue has been solved.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Weird @Binding behavior, doesn't update the value until I set it into different one
It isn't a parameter but the notation for explicitly capturing the specified values from within a closure. Closures are a complex thing in Swift and you can read more in this article and see it in action, like you may have before here: https://www.hackingwithswift.com/articles/179/capture-lists-in-swift-whats-the-difference-between-weak-strong-and-unowned-references.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on How to use the .onMove SwiftUI modifier to reorder SwiftData elements?
I'm not sure what you're asking. Would you not just use items.sorted { $0.orderIndex < $1.orderIndex } . If that's not the problem, then please add a new reply detailing the issue with proper code snippets.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on NavigationSplitView two and three column interfaces in the same app
I had asked Apple and my solution was based off of someone from the SwiftUI team’s response. So yes, you can switch between different column layouts but it would also be nice to have a better way. My feedback was FB12116429.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData crashes the app on iOS Beta 6
Xcode 15 beta 6 will only run for an iOS 17 beta 5 simulator. Since there has been no new Xcode release for iOS 17 beta 6, Xcode doesn’t know about this new version. To test for iOS 17 beta 6 you will need a device running it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData crashes the app on iOS Beta 6
The error is happening on iOS 17 beta 6. Xcode 15 beta 6 can build for both beta 5 and 6. So running on the simulator will run for beta 5 where there is no issue. Running on a device on beta 6 will cause the crash.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on How to form a search predicate using swift data with a one to many model
Can you make a new post about this as it should really be discussed in the comments of a different post.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23
Comment on How to form a search predicate using swift data with a one to many model
You can instead use the localizedLowercase computed property instead, because the lowercased() function isn't allowed.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’23