Category "swiftui"

SwiftUI: How do you implement List + ForEach loop for child elements (shown in a disclosure group)?

Currently, my app uses only a list view to display folders (as seen below). All of the tutorials online suggest that for dynamic content (In my case, an array o

Is there a way in SwiftUI to transport and handle data from an property to the class?

I have two classes here. Music which is used to store music url and load metadata, and MusicManager which is used to store a list of music and sort them after l

SwiftUI: Strange empty popover near TextField

Each time when I write character in TextField - displayed empty popover near the field. It is displayed only on last MacOS/SwiftUI on few computers, but cannot

How to test receipt when Migrating iOS app from Paid to Freemium/Free in SwiftUI

I'm planning to update my app from a Paid app to a Free app with possible IAPs. I've come across the Receipt Validation, but I'm finding it very confusing. All

SwiftUI - Generating Picker options from Multi-Level Struct (created from JSON)

I'm struggling to populate Picker on SwiftUI from Multi-Level Struct that is generated from a JSON data source. The struct has the following format struct DataS

Error 'cannot find type 'UIHostingController' in scope'

Why could a distribution build be failed with SwiftUI? I added SwiftUI into my iOS 10+ project, and build it locally with @available(iOS 13.0, *) prefix, but wh

Core data creates keeps populating with default values and doesn't save on close

I am fairly new to core data. I am trying to make a form where each time I add a section header and text from a sheet view, it appears within a new section. The

Wrong geometry drag coordinates

I'm trying to drag the gray square inside the white square manteinig the starting point CGPoint(x: 0, y: 0) and respecting the extreme coordinates, see of the i

Cannot login to Agora RTM with Swift

So I am attempting to implement Agora RTM within my SwiftUI app. Below is the code I am using to attempt to log on but I keep getting error code 3. Any help wo

Bluetooth keyboard input in Swift 5 SwiftUI app (versus UIKit)

I'm porting an iOS app from UIKit to SwiftUI. In this app, I need to capture and respond to keyboard input from a Bluetooth keyboard. In the UIKit app, I was do

Selection of nested CoreData List SwiftUI

Im trying to make my List selectable so I can delete or share multiple instances! Im trying to do that, with this method: List(selection: $selection) Here's my

Why is Xcode crashing when I try to preview?

Every time I am trying to resume my preview canvas in Xcode I get this annoying error. I tried restarting, moving the project to another location, and changing

State of an instance is not updating -- SwiftUI

So I have this structure Task which has a @State completion: struct Task:Identifiable{ var id: Int @State var completion:Bool = false var priority:S

How do I center an Image view in pdf format with SwiftUI?

I have a vector (converted to Pdf) that I want to use as my background for my app. However, the Image is aligned all the way to the left as you'd expect when us

Xcode is damaged and refuse to run the code

When I press "Build" and/or "Run" buttons in Xcode (SwiftUI), it shows me an error and I get this message: One of the paths in DEVELOPMENT_ASSET_PATHS does not

How can I access the subviews in SwiftUI?

I am trying our SwiftUI and want to create a component on the lines of SwiftUI's components. So, here is what I am trying to do: Create a new view extending Vie

SwiftUI DatePicker jumps between short and medium date formats when changing the date

(Using Xcode 12.3 and iOS 14.3) I use a DatePicker component with the default style (DefaultDatePickerStyle) to display and edit a date: the component shows the

Why primitive View in SwiftUI has no body?

The View protocol requires a body property: public protocol View { associatedtype Body : View @ViewBuilder var body: Self.Body { get } } Why have some

How to make a button (or any other element) show SwiftUI's DatePicker popup on tap?

I'm trying to achieve the simplest possible use case, but I can't figure it out. I have a picture of calendar. All I want is to show DatePicker popup when tappi

SwiftUI picker on macOS

I try for my personal knowledge to learn SwiftUI. Then I test on my Mac, but my first feeling is that SwiftUI is much more iOS oriented than macOS. Am I right ?