Category "swift"

How to write auto-toggle Publisher operator?

because of a requirement to auto remove Text after its appearance in 2 seconds, I want to write this operator but still cannot figure out the best way to implem

Swift Playground with async/await "cannot find 'async' in scope"

I'm trying to run this async function on Xcode Playground: import Foundation import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution = true e

AVAudioFile write not working Swift iOS 14

I have the following function: private func getPCMBuffer(utterance: AVSpeechUtterance, completion: @escaping (Result<AVAudioPCMBuff

'async' call in a function that does not support concurrency swift ios Xcode async/await

I'm trying to use async/await with Swift 5.5. I have my async function, but whenever I try to call it, I get this error: 'async' call in a function that does

Convert pixel array to DNG in SWIFT ... without libtiff/libjpeg?

I have raw image data, a pixel array (actually a single string of data) that I want to convert to the most basic and minimal DNG format/file. I saw different ap

Alternative of WKScriptMessageHandler for WKWebView and native communication?

Is there any alternative way other than WKScriptMessageHandler to communicate from Javascript to native code?

Background Task to Fetch HealthKit Data

I am using iOS 13 where Background Task framework there. My Query is Can it will be possible to fetch HealthKit Data in Background Mode. Can i send these Healt

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

How to switch the statusBarStyle with the new syntax to remove deprecated warnings?

how am I supposed to change this piece of code? The current solutions for this problem either cover older iOS versions or are unanswered. This is the line: UIAp

How to upload video chunks to server and download them in real time in iOS

I'm creating an iOS app where I want a user to be able to live stream a video, however, users who join the live stream after it starts, start watching the strea

Need to implement App Tracking Transparency?

I have the following in my AppDelegate //added these 3 methods func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:

MVVM in TableView Cell

hope you're well, i am working on an app which uses TableView for showing feeds to user using ViewModel and my ViewModel contains a variable which contains data

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

Execution of combined Booleans in swift

I'm having a question about a computed property where I'm using a combination of computed Booleans to get a result. I understand the logic behind the code, but

Xcode swift iOS project gives "usr/bin/python no such file or directory" error when try to build project

I am experiencing the problem after the macOS 12.3 Monterey update. I get the following error when I want to run the project. There is a code looking for "/usr/

Am unable to receive HTTP responses with UIViewController set as URLSessionDelegate

Wed 5/18 Additional Info added at Step 5 I am able to create a URLSesion, build a request with a file to upload and successfully call it from my app. On my serv

Xcode randomly modifies my schemes content

Whenever I switch branch or trigger a build, I'm getting my xschemes modified by Xcode, it seemed to happens since the last OS version. My schemes are shared am

How to rotate the Drag&Drop preview in Swift

I have a problem rotating the preview when I drag a button. In this project I drag a button that represents a street that you can rotate, so when the user rotat

Understanding MetricKit...didRecieve?

I recently added MetricKit to my app, and I've done the research and think I understand how this works by using the documentation example. I've added the Metri

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