Results for swift
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...
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...
I have my first application for Swift Charts. I am using LineMark to create a chart linked to an array that updates live with data from the CoreMotion...
I currently have this custom UIView to show 3 dots. The selected dot being the biggest. Here's how it looks: But the issue is, sometimes when the cur...
String.Encoding struct features several unicode related implementations: https://developer.apple.com/documentation/swift/string/encoding utf8 utf16 a...
Consider the following simple JSON: { "title": "Some title", "subtitle": "Some subtitle", "button_type": "rounded" } This is my current approach...
I want if user check the checkbox one then other one should be unchecked , currently user can select both. I have seen some example but here I need to...
I have simple codeable json. I am using for each loop for iteration, here I comparing the product based on id. If the id exists, then it should increa...
I am trying to build a drawing app just for fun in swift UIKIt programmatically but now I just ran into a problem I am trying to create a palette of c...
I have a huge json data obtained from HTTP response and I need only a particular portion to be decoded as a model. { "root1": { "items": [...
I have an Ionic application. I compiled this in Xcode for iOS and it works. I also created a widget for this application. My wish is that if the appli...
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?