Category "swift"

How to know when SwiftUI keyboard search button tapped in .searchable search window

I am using the .searchable modifier in SwiftUI. Is there anyway to know when the user presses the search key on the keyboard? I know how to do this by using a

UITapGestureRecognizer on UIDatePicker not working in iOS 15

I have a row for a user to select a date, and I'm using the UIDatePicker to do this. When a user taps on it, I want it to change some text on the row as well as

SwiftUI/Combine: subscribe to value change of @Binding

I have a view with a view model, and actions in this view can change the view model. To be able to break out logic into reusable pieces, I have part of the view

I can't present a segue to another VC from a UIView class

I have a UIView class which i set it up as a pop-up that user needs to write a price and press a button to pay that amount, The problem is I can't set up the bu

Correct way to draw/edit a CVPixelBuffer in Swift in iOS

Is there a standard performant way to edit/draw on a CVImageBuffer/CVPixelBuffer in swift? All the video editing demos I've found online overlay the drawing (re

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