Category "swift"

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

How to cancel the delayed thread?

I am executing set of tasks, and in order to span them over time I've used Thread.sleep(forTimeInterval: ... ) It adds pauses between executions. Then, on the m

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

Swift // MLDataTable error: Couldn't lookup symbols:

import Cocoa import CreateML let data = try MLDataTable(contentsOf: URL(fileURLWithPath: "/Users/allan/Downloads/twitter-sanders-apple3.csv")) I got this erro

How to increase quality of rendered image for UIImageView?

I have an UIImageView with contentMode = .aspectFit. I have an image in imageView, which dimension is bigger than size of imageView. User can draw some lines an

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

swift Xcode Secure Text Entry Asterisk not show when Screen Mirroring / Recording

I have checked the Secure Text Entry and entered "pwdTextfield.isSecureTextEntry = true" as the code. Therefore, I can see the asterisk well inside password tex

Link to fat Static Library inside Swift Package

I’m trying to build a Swift Package that wraps a fat static library written in C: libndi_advanced_ios.a from NewTek's Apple Advanced NDI SDK. I am having

iOS Deep Link from Widget when App closed?

My widget has several links that the user can click, the link are set up as follows: Link(destination: URL(string: "widget://start")!) Now I am able to detect

RealityKit – Why AnchorEntity position is always (x: 0, y: 0, z: 0)

I am using the following to to place an object on a plane. It works but the position of the anchor is always coming out to be 0,0,0 even though it is based on t

window.webkit.messageHandlers is null on ios 15

window.webkit.messageHandlers gives null on ios 15, but when I set config.limitsNavigationsToAppBoundDomains = true; it works properly. But I don't want to res

Why does this swift async-await code fails with leaked continuation?

I am experimenting with Swift async-await and AsyncSequence protocol, Here is the code: struct AsyncNumbers<Element: Numeric>: AsyncSequence { private

SwiftUI - MapAnnotation is showing up in wrong position

I am trying to display multiple map annotations to Apple Maps In SwiftUI, but the annotations are showing in some wrong perspective. All positions are displayed

Swift Mjpeg Streaming Only Showing Single Frame

I am trying to create a Mjepg stream. I have followed a tutorial and it's not a lot of code to get a stream to lead but I don't understand why it's not working

How to create array of objects in firebase

I am working on a project developing a car rental app. The app can be accessed by admin and user both with different roles. So at the moment i'm saving the car

Make URL string not auto search when Apple Maps is opening threw my app

I have a function inside my button to open up Apple Maps and search for Kebab. However when Apple Maps is opening, Apple Maps have already chosen a Kebab restau