Category "swift"

How to convert CMSampleBuffer to OpenCV's Mat instance in swift

I am working on an OpenCV project where I am taking input from iPhone native camera as CMSampleBuffer now I wanted to create Mat instance that is required in Op

Is it possible to remove title underneath iOS home screen widget?

Many users ask me, can you remove title underneath the widget? But as per Apple's design guidelines, we can't keep the app name empty or remove the home screen

how to archive UITextView and UITextField data binding

problem description: After currently changing the attribute of UItextView, when I change the content of UITextView by entering text in UITextField, the f

SwiftUI Custom List Cell - disable horizontal padding/shrink in EditMode

I'm trying to create a custom List cell in SwiftUI, where the drag-icon in Edit Mode stays inside the cell. By default, the cell gets horizontally shrinked do m

SwiftUI Preview crash with await async iOS15 if returns a struct with UUID

I reduced to very simple code. If the struct has a Int is working, if there is an UUID the preview is crashing (it's working if I run on the simulator or real

Property with return value in Java/Kotlin?

This is a pretty basic question, but I haven't been able to find any answer on SO yet. I'm just curious, is there a corresponding way in Java or Kotlin to write

Perfect LDAP Swift does not compile on Linux

I am using PerfectLDAP and it works as designed in MacOS, however when I try moving it to docker the build process complains about missing memset: [15/898] Comp

Uitextfieldwith dashed line, focus, default dashed color lines in swift

I haven given spaces between chars with NSattributes.kern, need to change focus color of next char border when text enter, should be do with one textfield class

iOS - Failed to upload video file from swift to FastAPI server

I took the code for uploading the video file from this question, however, an error occurs. This is the code to select a video from an album: var videoURL: URL?

.day Component returns "incorrect" day in Swift

My date object returns "incorrect" day from some reason, I have no idea why. This output is taken from the debugger: (lldb) po date ▿ Optional<Date>

Add top shadow to TabView in SwiftUI

I have the following: I'm using a native TabView. I can change the background but I haven't been able to add a little shadow to the top of the UITabBar, I've t

Swift saving decimal to firebase

I am trying to get my numbers as accurate as possible when the user enters the information for fuel purchased. I also would like it so in the example below a us

How do you pass data dynamically is a Swift array?

Im creating a tinder like swipe app and I need a new CardData(name: "", age: "") to be created depending on how many profiles I pass through from my database. T

Swift: Unit testing delegate methods with 3rd party class as an argument

I know how to unit test with 3rd party dependencies by extending the class with your own protocol so that you can inject a mock dependency that implements that

Recenter the scrollview content Swift

I'm trying to recenter the scrollview view and move the frame, when the user current location goes to the out of the screen frame. Currently I have a PDF a

How can I make swift package management make offline? Every time I open a project, it begins downloading, which takes longer when the project is huge

Every time I open a project, it begins downloading, which takes longer when the project is huge.

Dynamically add textfields with a for each loop and a button in swiftUI

I am trying to use a ForEach loop to dynamically add textfields inside a form section with a button. Form { ForEach(0..<numberOfItems, id: \.

`Task` blocks main thread when calling async function inside

I have an ObservableObject class and a SwiftUI view. When a button is tapped, I create a Task and call populate (an async function) from within it. I thought th

swiftui matchedGeometryEffect with scaleEffect problem

Why when opening and closing the viewModel (color.green) , the circle tremble and vibrate and the model becomes above the circle when moving when i change the v

swiftui matchedGeometryEffect with scaleEffect problem

Why when opening and closing the viewModel (color.green) , the circle tremble and vibrate and the model becomes above the circle when moving when i change the v