Category "swiftui"

Using UISheetPresentationController in SwiftUI

I'm really struggling to wrap the new iOS 15 UISheetPresentationController for use in SwiftUI (for a half-modal). I understand that I should inherit UIViewContr

How to turn on showPhysics in a Swift UI SpriteView?

I have been playing with the SpriteView in iOS14 and its working quite well however, I noticed that some collisions that worked fine when using a UIViewcontroll

How can I force ProgressView to run its task again?

I have content that is loaded in the background. Loading is a long running task and I want to show data as soon as it's available. My view show loaded content a

Swift Switching from HTTPS to HTTP

This one's a weird one. I have a little API server that does some stuff that I want my mobile app to talk to. It has DNS and SSL correct configured, I can reach

SwiftUI: Animate subview when map annotation is selected

I have a MapView implementing UIViewRepresentable with the following coord function: func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView

"Expected to decode Dictionary<String, Any> but found an array instead.", underlyingError: nil; GitHub repo showing app; SwiftUI

I need to create an app that will be able to return all the repositories that a GitHub user owns. I created an app that contains of 3 files: CONTENT VIEW import

SwiftUI not detecting dark mode from setting

In SwiftUI on my device, I set the appearance to dark mode. However, my application doesn't change the background colour based on that appearance. For the color

View resizing when hiding tab bar with Introspect in SwiftUI

I'm using Introspect to hide the tab bar on child navigation link pages. However, I've noticed some odd behavior when the app is backgrounded and then brought b

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