Category "swift"

Generic delegate response handlers

I've got a class currently something like this class Client { var responseOneDelegate: ResponseOneDelegate? var responseTwoDelegate: ResponseTwoDelegat

Creating a macos windowless menu bar application with SwiftUI

I am looking for a solution to create a macos windowless menu bar application with SwiftUI. I have implement the function ralated to the menu bar, the problem i

Costum TabView renew the views

I have made a pretty simple costum TabView but when i enter the first view's navigation link and switch to other view using TabBar, then come back to the first

Swift - Unexpected rows added to CoreData

I have a CoreData base with 6 rows in it. I na ViewController, the data is displayed in a UITable, when I select a row in the table, the didSelectRow lists 6 ro

Is there a way to get Slack's focused channel name programmatically in macOS/Swift?

Is there a way that macOS/Swift app can retrieve Slack's currently-focused Workspace name and channel name? So, given that Slack app is running, is there any wa

How to enter the amount of shapes in for each identifiable loop SwiftUI

I am beginner in SwiftUI, updating my app and remaking it on SWIFTUI. Here is the screenshot what I had to do... Screenshot I've successfully done actually the

Parse results from JSON to a list dynamically

I do a JSON Request and get some information. func parseJSON(poiData: Data) { let decoder = JSONDecoder() do { let decodedData = try decoder.dec

Finding a SIMD<Float> between 2 points in RealityKit

I have implemented a function, which allows me to find a SIMD3 Vector between two points. private func getMidPosition(_ a: SIMD3<Float>,

MSAL SSO not working for app that built in different framework

We have iOS apps that are built in Xamarin, swift and objective c. We change the authentication of those apps to use Azure AD to easily implement SSO using MSAL

How do I observe changes on an array with Combine framework?

How can I observe changes on an array with Combine framework but without SwiftUI? Basically, I want this sink block to get called when an element is added or re

What is the best way to stop an image uploading and restart it using RxSwift?

I'm trying to create some functionality for uploading images to remote server using RxSwift. My upload function is below: func upload(image: UIImage) -> Sing

Is it possible to set preferred sample buffer size for AVCaptureOutput?

Say we have an AVCaptureAudioDataOutput object that has been set up with an AVCaptureSession to get data samples from the device's microphone. captureOutput(_:d

How do I fix "Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_audioPlaybackManager'"?

I have created a class called "AudioPlaybackManager" which is a MainActor class as a StateObject when the app starts up. Im getting this warning. How do I fix t

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