Category "swift"

Is there an error prone way to exclude certain properties from struct during equality comparison without writting our own == function?

We like the auto equality behavior of struct, by just simply conform Equatable protocol. Sometimes, we would like to exclude some properties out from struct equ

Binding value from an ObservableObject

Aim: I have a model which is an ObservableObject. It has a Bool property, I would like to use this Bool property to initialise a @Binding variable. Questions:

CollectionView move to next cell automatically swift

I am trying to create horizontal slider like Flipkart. I am using collectionView with Horizontal scrolling and paging. Cell contains imageView. I am succeed in

How to send nested raw JSON in URLSession to Vapor API?

I have a Vapor API that has a route to register users. This route recibes a nested object in JSON format like this: { "name": "Test", "email": "test1@te

Error Domain=SSZipArchiveErrorDomain Code=-1 "failed to open zip file" UserInfo={NSLocalizedDescription=failed to open zip file}

_ = try? SSZipArchive.unzipFile(atPath: filePath, toDestination: downloadPath.absoluteString!, overwrite: true, password: nil, progressHandler: {

WKWebView open links from certain domain in safari

Within my app I am want to open links from within my domain (e.g.: communionchapelefca.org) in WKWebView but then have links from other domains open in Safari.

Connect to Postgres from Swift

In a Swift app, how does one connect to a Postgres database server? In Java, we use JDBC with an compliant driver to connect to a Postgres server, communicate

UIDocumentPickerViewController in SwiftUI on mac (macCatalyst)

So I've been meddling with "moving" a small SwiftUI iPad app to the Mac, and I've hit a bit of a speed bump with UIDocumentPickerViewController. I have wrapped

ld: Invalid value (Producer: 'LLVM13.0.0-rust-1.57.0-nightly' Reader: 'LLVM APPLE_1_1300.0.29.3_0') for architecture arm64

Trying to install and work with zkgroup. Build, run for specific iOS device working fine. But generic archiving is not working. Error text: ld: Invalid value (P

How to Remove Every Other Element in an Array in Swift?

So say I have an array: var stringArray = ["a","b","c","d","e","f","g","h","i","j"] Now, how do I delete "a", "c", "e", "g", and "i" (all the even number ind

Button border with corner radius in Swift UI

I'm trying to set a rounded border to a button but the border of the button is not correct. Code: Button(action: { print("sign up bin tapped")

reason: 'Killing app because it never posted an incoming call to the system after receiving a PushKit VoIP push callback.'

I'm looking for solutions but I has find nothing yet. My app receives only VoIP pushes and after iOS 13 I'm not able to receive push when the app is in backgrou

Deletable Table with TextField on SwiftUI

Environment Xcode 11.2.1 (11B500) Problem In order to implement editable teble with TextField on SwiftUI, I used ForEach(0..<items.count) to handle index.

CIColorControls wrong brightness

I am change brightness value of the image to negative value and trying to compare result image with apple photo editor. Original Edited by me Edited by A

How to reverse SwiftUI ZStack order?

trying to recreate a next/previous item on a stack of cards. I have my cards in a ZStack. The problem I’m having is that by default ZStack are in reverse

Which button was pressed in a custom swift cell

I am using three separate SWIFT buttons in custom cell in a tableView. Each button is a counter and therefore, I increment the label/text of the button when it

Unable to hide the navigationBar when embedding SwiftUI in UIKit

I am trying to hide the navigationBar when putting some SwiftUI inside of a UIKit UIViewController: override func viewWillAppear(_ animated: Bool) { super.vi

OTC View autolayout in SwiftUI

I'm new to swiftui and swift basically, i made One-time-code screen, and here i have a problem. When i run project on my old phone (iphone 6) when keyboard appe

gRPC-Core issue in Xcode - Value conversion issue - Implicit conversion loses integer precision

My code works perfectly fine. I have installed the Firebase Auth Package and it doesn't give me any errors. But as soon I add the FireStore Package then I start

SwiftUI - Add Border to One Edge of an Image

It's a pretty straight-forward question - How does one apply a border effect to only the wanted edges of an Image with SwiftUI? For example, I only want to appl