Category "swiftui"

SwiftUI how to align the view‘s leading to the most super view’s leading?

I’m new to SwiftUI and I’m making a widget. The default code included a text view which is both x-centered and y-centered in the super view(which I

I'm trying to use "objectWillChange.send()" in an protocol extension but it's not working, any idea why?

I've a SwiftUI navigation view showing a list of players. I designed the view model protocols as follows. protocol PlayerListStateProviding: ObservableObject

SwiftUI - How can I blur the default background color of a view?

no code to show here, but I would like to know how it may be possible to do this. I have tried to use .blur(radius: (20) on a view, but it tends to blur the

SwiftUI UIApplication.shared.isIdleTimerDisabled = true just on one View

How can i turn Sleep off when just one View is Appeared ? UIApplication.shared.isIdleTimerDisabled = true stop the screen from going to sleep on every View. how

SwiftUI: How do I "zoom in" to a specific CardView on a tiled interface?

I am trying to build a tiled interface out of CardViews. I want the user to be able to tap on a Card and have that Card expand to take up the available space,

SwiftUI List rows in Edit Mode do not allow Buttons actions/NavigationLinks to work?

SwiftUI List rows in Edit Mode do not allow Buttons actions to work I note (as well as NavigationLinks too). Is there a way to get this working? Goal - Want

SwiftUI + Dynamic action closure for Button

I am exploring SwiftUI and I was able to create a subclass of Button. The subclass contains image & title properties, which makes it a reusable component.

Binding value from an ObservableObject

Aim: I have a model which is an ObservableObject. It has a Bool property, I would like to use this Bool property to initialise a @Binding variable. Questions:

UIDocumentPickerViewController in SwiftUI on mac (macCatalyst)

So I've been meddling with "moving" a small SwiftUI iPad app to the Mac, and I've hit a bit of a speed bump with UIDocumentPickerViewController. I have wrapped

Button border with corner radius in Swift UI

I'm trying to set a rounded border to a button but the border of the button is not correct. Code: Button(action: { print("sign up bin tapped")

Deletable Table with TextField on SwiftUI

Environment Xcode 11.2.1 (11B500) Problem In order to implement editable teble with TextField on SwiftUI, I used ForEach(0..<items.count) to handle index.

How to perform an action after NavigationLink is tapped?

I have a Plus button in my first view. Looks like a FAB button. I want to hide it after I tap some step wrapped in NavigationLink. So far I have something like

SwiftUI - nested list

I'm trying to create a nested hierarchical list, so that for each task I can have subtasks like in iOS reminders app: First attempt was to embed another list

SwiftUI Create property with the application's local notification .authorizationStatus

I'm looking to create a property that will track the user's notification authorization setting for the application. (The ultimate goal here is to alert the user

How to reverse SwiftUI ZStack order?

trying to recreate a next/previous item on a stack of cards. I have my cards in a ZStack. The problem I’m having is that by default ZStack are in reverse

Unable to hide the navigationBar when embedding SwiftUI in UIKit

I am trying to hide the navigationBar when putting some SwiftUI inside of a UIKit UIViewController: override func viewWillAppear(_ animated: Bool) { super.vi

OTC View autolayout in SwiftUI

I'm new to swiftui and swift basically, i made One-time-code screen, and here i have a problem. When i run project on my old phone (iphone 6) when keyboard appe

SwiftUI - Add Border to One Edge of an Image

It's a pretty straight-forward question - How does one apply a border effect to only the wanted edges of an Image with SwiftUI? For example, I only want to appl

How to show MPMediaItem Artwork in a SwiftUI list?

I try to build a SwiftUI List of all local stored songs on my iPhone. Im using the MediaPlayer Framework of Apple to get the songs and storing them inside an En

Focus on the next TextField/SecureField in SwiftUI

I've built a login screen in SwiftUI. I want to focus on the password SecureField when the user is finished entering their email. How can I do this? struct Logi