Category "swift"

Core Bluetooth. How can I check does peripheral already connect?

During development I got a problem witch related to the connection central and peripheral. When one of the central already connected with perepheral I have to d

Build error for macOS in Swift Package for iOS platform

I am trying to add support for Swift Package Manager to one of my frameworks. The framework is iOS specific (I make use of UIKit on it), so I added the platform

How to remove '\u{ef}' character from String Swift

let's say I have a string var a = "#bb #cccc #ddddd\u{ef}" and i am setting it to textview like this let text = a.trimmingCharacters(in: .whitespacesAndNe

Making parts of text bold in SwiftUI

I was wondering how I would make only sections of a text bold while keep the rest 'regular' in SwiftUI. I currently have: Text("Coronavirus Disease of 2019")

How do I handle NSInlineData from Bluetooth scanning?

I want to use data that is passed through Bluetooth scan. and I want to split and use data from NSInlineData. I import data via Bluetooth scan as follows. fun

Images inaccessible from asset catalog in a SwiftUI framework

I've created an iOS framework that contains a single SwiftUI View. I've then added an Asset Catalog with a single image. Trying to access that image from the Sw

Using Vision and RealityKit Rotates Counterclockwise and Distorts(Stretches?) Video

I am attempting to learn object detection in iOS, and then mark the place of the detected object. I have the model trained and installed in the project. My next

GestureRecognizer in scrollView not working

I moved all my UIElements in a scrollView to avoid a loaded UIViewcontroller. But now the GestureRecognizers on the view does not work anymore. My View hierarc

How to add space and resize image for rightView of UITextField

I need to make this kind of text fields but I don't know how can I make spacing for rightView. Here is a code where I'm trying to set rightView image let i

UIKit automatically switch to another VC after launch screen appear

I'm trying to automatically switch from lauch screen to home screen after 3 sec. This is code in entry point view controller override func viewDidAppear

iOS: Detect if the device is iPhone X family (frameless)

In my app there is some logic for frameless devices (iPhoneX, Xs Xs max, Xr). Currently it works base on the model of the devices, so, I detect the model by Dev

Swift - Get array item with an IndexSet

I have my Contact object: struct Contact: Codable, Identifiable { var id: Int = 0 var name: String var lastName: String var phoneNumber: String

Is there someone who used animationDidStop or animationDidStart for SCNAnimation Player?

I am getting animation from a scene file with func animationFromSceneNamed(path: String) -> SCNAnimationPlayer? { let scene = SCNScene(named: path)

How Can I Adjust TextField Placeholder Color : SwiftUI

I found that I can customize TextField style in swift like this.. struct BottomLineTextFieldStyle: TextFieldStyle { func _body(configuration: TextField<

How to get selected place coordinates in google places autocomplete prediction in table view ios swift

i am able to get google places auto complete results in table view using below code. now i am looking for how to get coordinate of selected place of tableview?

Error deleting records from a SwiftUI List and Realm

Has anyone been able to successfully integrate Realm with SwiftUI, especially deleting records/rows from a SwiftUI List? I have tried a few different methods bu

Unable to access SPM classes in Swift classes referencing Obj-C classes

I'm currently working on moving one of our apps dependencies from Cocoapods to SPM. The dependency is written purely in Swift, but our codebase using it is both

How can I reproduce Picker's selection binding?

I'm building a custom view and I'm trying to manipulate the active state of its children. I have this: struct Menu<Content>: View where Content: View {

failed to produce diagnostic for expression, Xcode 11.4, Moya

After updating to Xcode 11.4, I started to get this error Failed to produce diagnostic for expression please file a bug report On: let provider = MoyaProvider

Can’t pass data correctly to modal presentation using ForEach and CoreData in SwiftUI

Im trying to pass data of some object from list of objects to modal sheet, fetching data from CoreData. The problem is that no matter what object I click on i