Category "swift"

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

Firestore query with inequality filters on multiple fields

I am building a calendar on IOS using Swift, with a Firestore back-end. I am retrieving all the events for each day in a month at one time. Currently I can only

SwiftUI Toolbar item getting clipped when back button is pressed

I've run in to a strange behavior in SwiftUI that I can't seem to work around. Given the following simple example app I experience this behavior: The toolbar it

Is there any way to load the GLTF file which is compressed by Draco?

I am looking for a way how to load the draco compressed .gltf on iOS. I am using GLTFSceneKit to render the gltf file which is exported by Blender. But if I com

Setting UIView.isAccessibleElement to true disables clicking of subview in voiceovermode

So I have a custom view controller that displays a dialog with a couple of buttons. When the view appears I want voiceover to read out some basic information d

Simple way to run SwiftLint for our Swift package

So far what I found is this blog article: It's time to use Swift Package Manager which recommends integrate SwiftLint and other tools with Package.swift. I was

Simple way to run SwiftLint for our Swift package

So far what I found is this blog article: It's time to use Swift Package Manager which recommends integrate SwiftLint and other tools with Package.swift. I was

How to animate collection view layout change while using `layoutAttributesForElements`?

I made a custom collection view flow layout that can toggle (with animation) between "film-strip" and "list" layouts. But after adding some fancy animations to

Re-authenticate with provider in Firebase and SwiftUI

I managed to re-authenticate the users with Apple, Facebook, Google, Email, and Phone in Firebase with SwiftUI, but when the users re-authenticate with Facebook

Add a xib file to a Swift Package

I want to start using modular code with the new Swift Package Manager integration with Xcode 11. The problem is that I can't seem to add any kind of UI files t

Unique Integer Value

I need a way to generate unique integer values in swift //string let g = NSUUID().UUIDString How can I accomplish the above in int format?

SwiftUI TextField doesn't commit change when tapping another TextField

I am building some basic form functionality in my app at the moment and I am having trouble with TextFields not changing the value in the relevant binded variab

Difference between creating ViewModifier and View extension in SwiftUI

I'm trying to find out what is practical difference between these two approaches. For example: struct PrimaryLabel: ViewModifier { func body(content: Conte

NSString.boundingRect fails with "[NSNull renderingMode]: unrecognized selector sent to instance" when specifying font

I'm trying to make a collection view where the cells just consist of a label, and I want the width of each cell to match the width of the text. In order to find

Swift: task {} before iOS 15?

I am following tutorials to understand SwiftUI, and specifically how to call an API when a view appears. I saw this: List(results, id: \.trackId) { item in

How to fix memory issues given by Instrument tools in Swift?

I have memory issues, especially for the error XPC connection interrupted The screen is freezing for a few seconds.. So, I've been learning how to use th

Detect if the active keyboard has a physical `Fn` key in Swift

I want to use the Fn modifier key if available, and if not, offer the user a different modifier. But only offer it to users without a Fn key. Some external keyb