Category "swift"

Click on a MapAnnotation to expand view - SwiftUI

I have a MapAnnotation in SwiftUI. On user interaction with a annotation, can I display another piece of information, i.e., change the label or show additional

How to use Transfer Learning for Text classification in Apples Create ML?

I was watching https://developer.apple.com/videos/play/wwdc2019/428/, where Transfer Learning is used for text classification in Create ML. I wanted to do the s

Incomplete file/copyright headers in Swift Package with Xcode 12 / 13

Is there any way to automatically add package/target name and copyright + company name to the header when creating new files while developing a swift package wi

Firebase chat adds message in other conversation when online

We have implemented a chat application both in iOS and Android which is 1:1 chat, and the structure is also well designed. Recently we figured out a bug which s

SPM with Git-LFS The operation couldn’t be completed. (XCBUtil.BinaryReaderError error 2.)

I have created a swift package manager which contains a very large file, that's why I have uploaded it in git-lfs ( Large file storage). When I add the Swift de

SPM with Git-LFS The operation couldn’t be completed. (XCBUtil.BinaryReaderError error 2.)

I have created a swift package manager which contains a very large file, that's why I have uploaded it in git-lfs ( Large file storage). When I add the Swift de

RealityKit – Get ModelEntity Size as SIMD3<Float>

Is there anyway to know the size of the ModelEntity as SIMD3? Once, I get the size, I want to pass it to the CollisionComponent. let box = ModelEntity(mesh: Me

Sheet inside ForEach doesn't loop over items SwiftUI

I have an issue using a sheet inside a ForEach. Basically I have a List that shows many items in my array and an image that trigger the sheet. The problem is th

SF Symbols Hierarchical, Palette, and Multicolor rendering mode colors?

At WWDC 2021 Apple announced SF Symbols 3, which will support new multi-color SF Symbols in iOS 15 and macOS 12. New color-rendering modes that add depth and e

AVFAudio - Is it safe to perform file copy immediately after AVAudioRecorder.stop()

We start a voice recording via self.avAudioRecorder = try AVAudioRecorder( url: self.recordingFileUrl, settings: settings ) self.avAudioRecorder.record

How to use completion block for UIView.animate()?

I'm working on a project to learn animations and am having trouble using the completion block for the UIView.animate(withDuration:) func. MY animation is a shoe

Core data - TableView - Toggle - Index out of range

I have a data model like this. The data is connected to core data. import Foundation import CoreData @objc(Aktie) class Aktie: NSManagedObject { @NSManaged

Interacting with the view controller behind

I know there are several posts on SE relating to this issue but I couldn't get around them to find a proper solution for my situation. I've a map view inside a

How to retrieve PHAsset from PHPicker?

In WWDC20 apple introduced PHPicker - the modern replacement for UIImagePickerController. I'm wondering if it's possible to retrieve PHAsset using the new photo

How to send an array of JSON object as a parameter value in request body ios swift

Hello I'm using Invoice generator api JSON Input https://invoice-generator.com/developers#json-input In the documentation of the API it is mentioned that the it

SwiftUI | Using onDrag and onDrop to reorder Items within one single LazyGrid?

I was wondering if it is possible to use the View.onDrag and View.onDrop to add drag and drop reordering within one LazyGrid manually? Though I was able to make

SwiftUI - 2 Handle Range Slider

Is there a way, using SwiftUI, to create a Slider with 2 handles? I'm working on a project that that requires settings a low and high point for a random value t

Unit Testing Combine

I'm having difficulties testing Combine. I'm following: https://www.swiftbysundell.com/articles/unit-testing-combine-based-swift-code/ Which tests: final class

How to exclude UIViewControllers other than views from Swizzle Method?

I am trying to override viewDidAppear() methods of my custom ViewControllers and i found a solution using swizzle method. It works but when keyboard is visible,

MacOS swift: having trouble in obtaining output data from Pipe()

I am trying to run command lines to take screenshots in my Xcode project and using Pipe() to log output data. When I build and run this project in Xcode, I can