Category "swift"

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

How to show MPMediaItem Artwork in a SwiftUI list?

I try to build a SwiftUI List of all local stored songs on my iPhone. Im using the MediaPlayer Framework of Apple to get the songs and storing them inside an En

Testing storyboard from within Swift Package

In the middle of factoring code from an app into a swift package and ran into a weird issue while adding test coverage. I reference the app's main storyboard in

Dynamic links / universal links not working in cold start

I use firebase dynamic links. They work perfectly fine when the app is in background and I use the application continue userActivity function. However if I cli

Programmatically Change multiplier of Alignment Constraint of Center X / Y

How can I programmatically change the multiplier in the simplest way? For Swift 2.0

Padding HStack in the top of any screen

I want to put an HStack which contains two Texts in the top of any device screen. the problem is when I use padding that I have to decide fixed size of padding.

Locale.current reporting wrong language on device

I'm trying to format currency values in an iOS app, and I'm using the current Locale settings on the device to use the appropriate currency formatting. In the

RealityKit – How to add a Video Material to a ModelEntity?

I use the code to add a picture texture in RealityKit and it works fine. var material = SimpleMaterial() material.baseColor = try! .texture(.load(named: "ima

Rotate UIButton 360 degrees

I've been trying to run an animation that rotates my UIButton 360 degrees using this code: UIView.animateWithDuration(3.0, animations: { self.vineTimeCapButt

Prevent UIAlertController from dismissing on UIAlertAction

I am working on one of the application where i am promoting user for force update using UIAlertController in which i don't wanted to allow user to perform any a