Category "swift"

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

How to get the Iphone type from simulator (IOS)

There are a lot of solutions to find out on which device out app is running. iOS: How to determine the current iPhone/device model in Swift? But running in th

How to get battery life of Bluetooth Low Energy in Swift 4?

I am able to get a value for BLE battery life with the help of following questions: Read data from BLE device Reading a BLE Peripheral Characteristic and chec

Encountered an error communicating with IBAgent-iOS. Failed to boot device iPhone Xs

I am getting an Error on the top of my interface builder in Xcode 10.3 and while clicking on report bug and checking the log.txt file I found out that fails to

Property wrappers and SwiftUI environment: how can a property wrapper access the environment of its enclosing object?

The @FetchRequest property wrapper that ships with SwiftUI helps declaring properties that are auto-updated whenever a Core Data storage changes. You only have