Category "swift"

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

ld: entry point (_main) undefined. for architecture arm64

not sure what to do. i keep getting this message "ld: entry point (_main) undefined. for architecture arm64" I am unsure if it has to do with my process but I h

How to gracefully restart CBCentralManager, in Swift

How do I gracefully stop all CBCentralManager activity and then, later, restart it? He's my plan. Is anything missing? Stopping... If inadvertently still scann

Why does UIToolBar turn transparent/translucent when table view scrolls under it

I have a UITableViewController and when the user taps an "edit" button, I display a toolbar at the bottom of the screen. I create a shadow on top of the toolbar

Unable to call Device Activity in Screen Time Api From Parent Device

Using shared authorization I am able to authorize the child's device and able to see all the installed apps on the child's mobile on the parent device. But when

how to change cell background colour on selected item in UICollectionView and change other Cell colour to default in swift

I am new in swift and I am trying to change cell background colour of UICollectionView but its not working my code is like this in cellForItemAt if(cell.isSelec

Getting CFNetwork, CoreMotion Crashes after releasing iOS Application

After releasing my ios application, I started to get lots of crash such as CFNetwork, CoreMotion etc. And then I thought, I did something wrong on my project. I

XCUITest How to dismiss date picker popover

In iOS 15 I've got a date picker in my app that uses the .compact style so it presents the date and time selection UI as popovers. I can't find a way to dismiss

Type erasure in Swift Concurrency AsyncStream

Experimenting with swift concurrency, I would like to have a clean API for exposing an async sequence of a given element type and a throttled version of the sam

SwiftUI - Detect when ScrollView has finished scrolling?

I need to find out the exact moment when my ScrollView stops moving. Is that possible with SwiftUI? Here would be an equivalent for UIScrollView. I have no idea