Category "swift"

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

UNNotificationRequest requires unique identifier, but fires on duplicates too

I call local Notifications like so let center = UNUserNotificationCenter.current() let content = UNMutableNotificationContent() content.title = title content.bo

Could not get GOOGLE_APP_ID in Google Services file from build environment

For setting up firebase i am using two config 1.GoogleService-Info-test.plist, 2.GoogleService-Info-prdn.plist for UAT and Production. For installing crashlytic

WheelDatePicker is invisible in iOS 15.0

I'm building an app in SwiftUI that needs DatePicker in the custom alert. Each time I use DatePicker with a WheelDatePickerStyle, it is invisible in IOS 15.0 (a

Could not find module for target 'x86_64-apple-ios-simulator'

I have my custom framework and it works properly in XCode 10. I rebuild it in XCode 11 beta 3, then integrated into the app, and get the following error: Could

String iterator in swift

I try to create an iterator for string processing in swift that will return every time the next chracter. But with no luck. (The final goal is to write a parser

reverse .label in swift

I want my text to appear .white when in normal mode and .black when in dark mode. How do I do that? .label only makes the text .black in normal and .white in da

SceneKit : how to get distance between two SCNNode ? (ObjC and Swift)

I wonder how to get distance between two SCNNode (ObjC and Swift) Thanks

Simplest way to throw an error/exception with a custom message in Swift?

I want to do something in Swift that I'm used to doing in multiple other languages: throw a runtime exception with a custom message. For example (in Java): th

In SwiftUI, where are the control events, i.e. scrollViewDidScroll to detect the bottom of list data

In SwiftUI, does anyone know where are the control events such as scrollViewDidScroll to detect when a user reaches the bottom of a list causing an event to ret

Occlusion Material or Hold-Out Shader in ARKit and SceneKit

I have seen some examples demo of ARKit where material A is blocking material B, kind of creating occlusion effect, or black hole, or masking. But all of them s

ARKit how position nodes base on horizon and not the camera orientation?

When I add a new node with ARKit (ARSKView), the object is positioned base on the device camera. So if your phone is facing down or tilted, the object will be i

How to access a Swift enum associated value outside of a switch statement

Consider: enum Line { case Horizontal(CGFloat) case Vertical(CGFloat) } let leftEdge = Line.Horizontal(0.0) let leftMaskRightEdge

Getting the result of input from one view to another SwiftUI [closed]

I have this view: struct CreateBoardView: View { @State public var BoardName: String = "" var body: some View { ZStack {

What is the "some" keyword in Swift(UI)?

The new SwiftUI tutorial has the following code: struct ContentView: View { var body: some View { Text("Hello World") } } The second line the

Could not find a valid GoogleService-Info.plist in your project

When I run my swift 3.2 code with Xcode 9 beta 4 this is the error I get: *** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp c

TextField in Table behavior

I'm trying to use the new SwiftUI Table with TextField's in each row. However, the behavior of the text field's is weird, for 3 reasons: Clicking on a text fiel