Category "swiftui"

How to define a protocol to include a property with @Published property wrapper

When using @Published property wrapper following current SwiftUI syntax, it seems very hard to define a protocol that includes a property with @Published, or I

Cannot use mutating getter on immutable value: 'self' is immutable error

I'm trying to reuse an older piece of Swift code, but getting an error 'Cannot use mutating getter on immutable value: 'self' is immutable error'. Xcode wanted

How to pass one SwiftUI View as a variable to another View struct

I'm implementing a very custom NavigationLink called MenuItem and would like to reuse it across the project. It's a struct that conforms to View and implements

UIPageViewController swipe ignores SwiftUI's navigationBarHidden(true)

I'm creating a SwiftUI app that needs a slider with hundreds of pages. Since there's no first-party solution that fits my needs, I've adapted UIPageViewControll

Round Specific Corners SwiftUI

I know you can use .cornerRadius() to round all the corners of a swiftUI view but is there a way to round only specific corners such as the top?

Open multiple previews at the same time in SwiftUI

I know we can open multiple previews of different screens at the same time in SwiftUI. Can anyone help me with the steps to achieve that?

This SwiftUI animation should only fade out. Why does it move to the right?

I'm having a hard time understanding why this happens. I reduced the problem to its minimum expression. I have a single Text view, that when removed, should jus

SwiftUI: How to make TextField become first responder?

Here's my SwiftUI code: struct ContentView : View { @State var showingTextField = false @State var text = "" var body: some View { return

Find all available images for Image(systemName:) in SwiftUI

Where can I find all the system images that are available in the initializer Image(systemName:)? I've only been using "chevron" and "star.fill" so far, as disco

Get `AttributeGraph: cycle detected` error when changing disabled state of text field

When I update the isDisabled state variable in my view, it updates the .disabled modifier of my text field as expected, but it then causes about 40 instances of

Get `AttributeGraph: cycle detected` error when changing disabled state of text field

When I update the isDisabled state variable in my view, it updates the .disabled modifier of my text field as expected, but it then causes about 40 instances of