Category "swift"

Convert Integer to Roman Numeral String in Swift

I am looking to take an Integer in Swift and convert it to a Roman Numeral String. Any ideas?

Convert Integer to Roman Numeral String in Swift

I am looking to take an Integer in Swift and convert it to a Roman Numeral String. Any ideas?

Compute Diffie-Hellman key pair and shared secret in iOS with Swift

I need on iOS with Swift to: Generate a Diffie–Hellman key pair with a pre-agreed modulus P and a base G Compute a shared secret with a local private key,

'hitTest()' was Depecrated in iOS 14.0

I'm new to this and currently building an AR-related application, on the old version I stated this let results = self.hitTest(screenPosition, types: [.featurePo

NavigationLink inside LazyVGrid cycles all entries on back, SwiftUI

I have an image grid. Each image on tap should push a view on the NavigationView with the image details. The navigation link works as intended, but when I press

SwiftUI Modal Inherits SearchBar during Sheet Presentation

Consider the following example with a list and a button wrapped in a HStack that opens up a sheet: struct ContentView: View { @State var text: String = ""

Is there a way to preserve capitalisation of original picked file while using UIDocumentPickerViewController?

The iOS 14 SwiftUI app I am developing has two ways of importing the audio files it plays: users can open a UIDocumentPickerViewController and select an audio f

Pull to refresh in UICollectionView in ViewController

I used the following code at a UICollectionViewController override func viewDidLoad() { self.collectionView!.alwaysBounceVertical = true l

static let sharedInstance not accessible from Objective-C code

Problem: The declared static let sharedInstance is not accessible from Objective-C code when building the main app target. Code: @objc public protocol Manag

Print Struct name in swift

It is possible to know the name of a struct in swift ? I know this is possible for class: Example class Example { var variable1 = "one" var variable2 =

Fixing the size of a custom font in SwiftUI iOS 13+ when ignoring Dynamic Type

In an app I'm developing (SwiftUI for iOS13 and above), I have imported a custom font, and I load the font using the following method": func getDigitalXFontOfS

Create dictionary from an array of objects using property of object as key for the dictionary?

With Swift is it possible to create a dictionary of [String:[Object]] from an array of objects [Object] using a property of those objects as the String key for

static let sharedInstance not accessible from Objective-C code

Problem: The declared static let sharedInstance is not accessible from Objective-C code when building the main app target. Code: @objc public protocol Manag

Swift ui macOS popover on the button or on an image

I wish I could do such a thing as seen in the image. I'm trying to use this piece of code but I'm not quite understanding how to fix it. I wish I could use it

Remove objects with duplicate properties from Swift array

The question here involves removing duplicate objects from an array: Removing duplicate elements from an array in Swift I instead need to remove objects that

3D artwork that is exported as USDZ has different colors

I want to start by saying that I am new to SceneKit and playing with AR environments on iOS. I have a 3D model object, a van, as part of a Blender file(.blend)

How do you share a data model between a UIKit view controller and a SwiftUI view that it presents?

My data model property is declared in my table view controller, and the SwiftUI view is modally presented. I'd like the presented Form input to manipulate the d

SwiftUI Word Wrap for multiline text Word Hyphenation Problem

I'm facing the following problem with SwiftUI Text: In the following example SwiftUI breaks the word "Amazement" into "amazeme" on the first line and "nt" on th

RealityKit – Adding ModelEntity to an ARGeoAnchor

I am in USA (Houston, TX) and I am trying to add a ModelEntity in RealityKit to a specific geo location. But I am not able to see the entity anywhere. Am I doin

Setting tableHeaderView height dynamically

My application creates a UITableViewController that contains a custom tableHeaderView which may have an arbitrary height. I've been struggling with a way to set