Results for swift-concurrency
So Im currently developing an app in Swift/SwiftUI for the first time and I've run into an issue I don't quite understand. What Im ultimately trying t...
Swift 5.9 I'm trying to concurrently sort some number of non-overlapping subranges of an array. My approach thus far looks something like this: // Not...
Swift 5.9 I'm trying to concurrently sort some number of non-overlapping subranges of an array. My approach thus far looks something like this: // Not...
I have an actual class that I want to implement swift Hashable but I can't find the import for swift Hashable inside of Kotlin. If I wanted to impleme...
Why the following code doesn't print "cancelled". Am I checking task cancellation in a wrong way? import UIKit class ViewController: UIViewController...
I have some code below to merge video clips into one video. I don't have much experience with AVFoundation so Im not sure how to replace the depreciat...
This is a coding pattern I use frequently in other languages, e.g. Obj-C: I have a dictionary whose values are arrays, to which I may add zero or more...
I'm encountering an issue with my code and I'm trying to understand why the initial call to add fails with a "Missing argument" error, while it runs s...
This is how I simply upload images to Imgur using Alamofire and Swift: let url = URL(string: "https://api.imgur.com/3/upload")! private var headers: [...
I am writing a program and noticed that the NavigationLink I used is depreciated, so I wondering how I would do a updated version of this: NavigationL...
I am a bit lost in Combine at the moment. I have an ObservableObject. This is mostly because this model is used in SwiftUI and having properties @Publ...
I'm new to Swift, and trying to do something I thought should be fairly simple. I'm working through a class, and for the exercise code I have a view t...
I have a 3D interactive globe built with SceneKit where countries are represented with dots. The function below takes a position and animates the came...
We have a situation where our app compiles and links in Xcode 15.1, but crashes without a stack trace when run in a simulator or real device running i...
I need to write something like the following: var dict = [SomeEnum: SomeObject]() var someValue: SomeObject! = dict[.case1] if someValue == nil { so...
I have an interactive globe and I want to detect taps on the globe, so I can get their 3d position. When I override the function public override func ...
I have a basic 3d Interactive globe built with swift and SceneKit. When the view launches, the camera is pointing towards Africa. I want to rotate and...
I am not a swift developer. I need this swift code to get the current CPU utilization percentage on demand i.e. whenever I query it, I should get the ...
I'm Curious, is there a way to specify the Series that Swift Chart data belongs to, if you can't use API like .symbol(by:) and foregroundStyle(by:) (i...
I am new to Swift Concurrency and trying to understand Task -> ChildTask relationship. I created here two Tasks Parent Task : (1)Calls the test() me...
So I have this code using concurrent dispatch queue and barrier flag to support parallel reads but block reads/writes when writing: struct SafeDictEle...
I have two date objects. One parsed from a server call in this form "2023-11-14T17:45:55Z" and a date object from adding minutes to .now. I would like...
I am using CoreData in a SwiftUI project with a relationship as follows: Climb: - timestamp: Date - grade: Int16 - attempts: Int16 ... Session: - tim...
I'd like to write a function that will either doSomething() or doSomethingElse() depending on whether a passed parameter a is of type B. Where B is pa...
I'm using JSON Placeholder post api to make a HTTP POST request using Generics and Result Type in Swift. Here is my codable struct for request and res...
How do I undo the most recent local commits in Git?
How can I remove a specific item from an array in JavaScript?
How do I delete a Git branch locally and remotely?
How can I find all files containing a specific text (string) on Linux?
How to find all files containing specific text (string) on Linux?
How do I revert a Git repository to a previous commit?
How do I create an HTML button that acts like a link?
How do I check out a remote Git branch?