Category "swift"

Swift Playgrounds iPad - parse from json Financial Modelling Prep API

G’day I’m trying to pull financial data from the FMP API. import SwiftUI import PlaygroundSupport import Foundation let url = URL(string: "https://

Memory leak issue virtual camera macOS, swift SwiftUI zoom caphost

We are developing a application with virtual camera plugin for macOS by using swiftUI & swift. It has also C++ & objective C library. When we use that p

Transfer object via WatchConnectivity from iOS to watchOS

I am trying to transfer EventKit Data like EKCalendars / EKEvents / EKReminder from iOS to watchOS via WatchConnectivity. The connection works but I cannot push

SwiftUI - Adding a keyboard toolbar button for only one TextField adds it for all TextFields

Background I have two TextFields, one of which has a keyboard type of .decimalPad. Given that there is no 'Done' button when using a decimal pad keyboard to clo

Pass data JSON API to .sheet(isPresented) SwiftUI

How to pass data to .sheet(isPresented) I have 10 names that I get from my JSON API, but when I click on the name, the .sheet(isPresented) shows one name. In al

iOS 15 only view modifier causes crash on iOS 14 even with if #available(iOS 15.0, *)

I'm using SwiftUI's drag & drop modifiers. Since, iOS 15 gives an option to customise the onDrag modifier with a preview I'm using it as shown below. Issue:

Marking makeUIView func makes view NOT conform to UIViewRepresentable?

I am trying to update my map's style URL immediately when the device changes from light/dark mode in my SwiftUI app. The error below shows on every line where "

Swift PDFKit how to scroll to specific point programmatically

I have vertical scrolling pdfView: var pdfView = PDFView() pdfView.displayDirection = .vertical pdfView.usePageViewController(false) pd

SwiftUI Navigation Title Text Priority (of two texts)

I have two texts that I would like to display in a navigation title: ... .navigationTitle(Text(getTitle()) + Text(" (\(selection + 1)/\(sequenceObject.h

SwiftUI: Get sidebar isCollapsed state on macOS

I'm using a NavigationView to create a sidebar on macOS. I can toggle the sidebar using this code: Button { NSApp.keyWindow?.firstResponder?.tryToPerform(

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>