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