Category "swift"

Custom Decodable JSON - Get first array element

I have JSON data that looks like this: { // Other attributes here.... "id": "a4s5d6f8ddw", "images": { "selection": [ { "url": "https://

UICollectionViewCompositionalLayout: How to expand cells to same height?

I'm trying out the UICollectionViewCompositionalLayout as a way to build a UI where there are both a vertical and horizontal arrangement of cells. ie. one secti

How to change back button text in iPad in Swift UI?

Working on iPhone, iPad and Mac OS app, which has login screen. I took login View in NavigationView, when I tap on back button the login view will slide as spli

How can you verify a multiple code point emoji is supported?

For context, I'm trying to create a mapping from string code points to emojis and need to know if the system supports the emoji: ("1F9AE") -> "🦮" ("1

SWIFT Longitude and latitude from GoogleAutocomplete save in Firestore as nil

I am trying to save longitude and latitude to Firestore from GoogleAutocomlete but it saves as 0. I am able to save name and address successfully from the textf

Xcode 13.3.1 showing Build input files cannot be found error after changing my device

I recently changed my device from iPhone 8 to an iPhone 13 mini and tried to run my app on it but xcode is failing and showing me Build input files cannot be fo

What's difference between `add(_)` and `add(_) async`?

I don't understand what's the difference between add(_) and add(_) async method. Like the below code, the MyActor has two add methods and one of them uses async

SwiftUI navigationLink isActivie not working [closed]

Purpose My intention is to come back from view3 and return directly to view1 Current Status My view hierarchy here is view1 -> view2 ->

Is it possible to make the LazyVGrid header have the same appearance as a List header

Goal My goal is to make the LazyVGrid header look exactly the same as the List header. When utilizing the Grid view, the header is transparent and shows the con

Create common layout for Navigation Bar in SwiftUI So other SwiftUI views should reuse same Nav Bar

In iOS SwiftUI, How we can make a common layout for Navigation Bar. So we can use that in all project without re-write the same code. We can use ViewBuilder to

Return the data of a model directly instead of a dictionary Express.js and Mongoose

Probably the title isn't very clear and is a bit confusing, and to be honest, I do not really know how to ask this question since I'm new to JavaScript and Mong

window.open() in button inside a web view app not working only on ios

I have created a web view app in swift. There I came up with one issue that following click event is not working. <button onclick=" window.open('https://www.

Swift packages with the same name causing errors

I am trying to import two packages, both called PushNotifications, into Swift Package Manager. I need them both. However as they both have the same name I get t

How to move a view/shape along a custom path with swiftUI?

There doesn't seem to be an intuitive way of moving a view/shape along a custom path, particularly a curvy path. I've found several libraries for UIKit that all

Convert AVAudioPCMBuffer into MLMultiArray and get prediction from CoreML model

I try to send AVAudioPCMBuffer into a coreML model and get the output from it. Input of the model is MultiArray (Float32 0 × 64 × 0) and output is M

How to make a non-observable class's methods available to SwiftUI views?

I have a pretty complicated UI so I broke my view models into multiple observable object classes that manage each part of the UI. The 2 view model instances are

Disclosure group open/close animation

I'm trying to animate the opening and closing of a disclosure group. I've tried several attempts without being able to get any sort of animation. This code synt

List all files in an iCloud folder

I want to search a folder that exists in my iCloud Drive for files. How can I get the paths of all files inside an iCloud folder on an iOS device or on Mac (via

Unable to open url to the Mac App Store in an iOS app launched on Mac with Apple Silicon

I have this code to open a link to the App Store for the user to write a review: guard var urlComponents = URLComponents(string: "https://apps.apple.com/app/any

Framework doesn't build for macOS target: no such module 'SomeFramework' & failed to build module 'MyFramework'

Hello guys, I faced a weird problem with my framework imported into my app. MyFramework uses some other frameworks like OpenSSL etc. I build MyFramework with t