Category "swift"

Git Clone with Swift Script

I want to clone the team projects into a predefined structure (as they are on the Git) on my local machine. Manually I have to create a new folder for every new

How the remove the yellow bar for "strong password" for SecureFields in SwiftUI?

I am new to SwiftUI and am trying out the SecureFields now. I am using two SecureFields in one VStack and for some reason when I use the iOS keyboard they show

MacOS IOkit get services by property name in Swift

I would like to get all services that contain specific properties. AppleDeviceManagementHIDEventService <class AppleDeviceManagementHIDEventService, id 0x1

Can I mix C++ and Swift in the same swift package, using the Swift Package Manager?

I would like to write one module in C++, and make some functions in C that are accessible in Swift. I am somewhat baffled, because no matter what I do, the SPM

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