Category "swift"

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

Cmd+B in UIKeyComands not displaying first typed "b" afetr using the command - swift

I'm using UIKeyCommands - Cmd+B to bold text. The code works fine to bold the text. But after i use the Cmd+B and when I type "b" the first time it doesn't disp

Cmd+B in UIKeyComands not displaying first typed "b" afetr using the command - swift

I'm using UIKeyCommands - Cmd+B to bold text. The code works fine to bold the text. But after i use the Cmd+B and when I type "b" the first time it doesn't disp

UIVisualEffectView is erroneously also influenced by layers above it

In my app, I want a CTA button to be displayed under the ads. This is located on a UIVisualEffectView for better readability. In principle, it already works as

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

Why Swift Tuples can be compared only when the number of elements is less than or equal to 6?

I read in HackingWithSwift that Swift tuples can be compared with == operator only when the number of elements is less than or equal to 6. What is the reason be

Swift/JS Restore WebView Back Forward List

I am trying to figure out how to restore the back forward list in a WKWebView. Apple defaults the BackForwardList to be readonly. However, FireFox, Chrome, and

HealthKit background fetch without observing

I want to make regular HealthKit requests in the background in a BGTask. I don't want to observe changes in HealthKit necessarily. Is this possible?

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

how can I change UnsafeMutableBufferPointer to withUnsafeMutablePointer?

I got a warning for the following function after a recent update, I am not sure how to convert it with withUnsafeMutablePointer as indicated by Xcode, not very

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

iOS Deep link callbacks not working when the app is closed

I'm using a deep linking in my application and using this code in my SceneDelegate to segue to a view controller. func scene(_ scene: UIScene, openURLContexts U

Get the devices list from iPhone Bluetooth , including connected and unconnected devices

The Bluetooth search page of iPhone shows these offline Bluetooth headsets. I hope to get this list and show it in my app. Can I realize this function? How? th

Programmatic Control of Edit Widget Font Size?

SwiftUI offers .dynamicTypeSize(...) to control/limit the impact of user Text size preferences. An app developer, for example, can limit dynamic type to Dynamic

Change volume of audio track within AVMutableComposition

I'm trying to merge a pre-existing video with a newly recorded audio voiceover track. User can set the relative sound volume for the two audio tracks (audio bel

UILabels and UISlider for song time not updating in Mac Catalyst music player

I recently built a simple music app that does fine on my deactivated iPhone. I have since bought a Mac mini so I could run it natively on that platform with Mac

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