Category "swift"

How to detect Siri Remote 2 button presses on macOS?

There are apps for using Siri Remote 2 with macOS. (SiriMote, Remote Buddy). I want to create the same app myself, but I am stuck with detect button presses. I

How can I observe an array of CoreData objects in SwiftUI? [closed]

I am relatively new to SwiftUI and am having troubles finding a solution to a problem I have with my UI not updating when a change is made to

Best way to work with a small db in swift ios app from a performance point of view?

I'm using an sqlite db to populate an ios app with data about irregular verbs -- it's a language learning app. The db has 3 tables, verb categories, verbs, and

Variable was never mutated...or Constant being used before initialized

So I'm wanting to get jsonMeals data back and use it outside of this function. However it seems no matter where I place my json variable I get an error. Changin

How to send the URL Swift to javascript iOS

I'm working on voice recording functionality.Voice recording has been done through webView now when the user clicks on voice record recording starts, and making

"Undefined Symbol for architecture arm64"

Im new to swift programming. Im building a tic tac toe app for practice. when I want to run the app, the build fails with the error message: Undefined symbols f

How to pass out parameter to function from Swift FFI?

Let's say I have a function defined in Rust, which looks like this: #[no_mangle] pub unsafe extern "C" fn do_something( my_value: *mut MyStruct, some_pa

Unable to install Pod in Mac M1 pro

I was getting this error when I tried to run pod install require': dlopen(/opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle, 0x0009): tried

tableView(_:cellForRowAt:) crashes with com.apple.main-thread EXC_BREAKPOINT

There is one strange crash in Firebase Crashlytics logs that occurs quite often, saying: Crashed: com.apple.main-thread 0 AppName 0xd454 S

FB_SONARKIT_ENABLED=1 flag not working when initialising Flipper in iOS app (iOS NO APPLICATION SELECTED)

I followed all the steps from: https://fbflipper.com/docs/getting-started/react-native-ios/ (both automatic and manual installation). FB_SONARKIT_ENABLED=1 does

Trying to decode dynamic JSON response

I'm trying to decode the JSON response for all tags from the Pinboard API. I have a simple model I'd like to decode into: struct Tag: Coddle, Hashable {

How to decode JSON array as property of struct with JSONDecoder

I had data struct like this { "version": 1, "profile": [ { "type": "name", "value": "Hellow" }, {

Property initializers run before 'self' is available

Seems like I'm having a problem with something that shouldn't be the case... But I would like to ask for some help. There are some explanations here on the Stac

How to decode JSON array as property of struct with JSONDecoder

I had data struct like this { "version": 1, "profile": [ { "type": "name", "value": "Hellow" }, {

UITableViewCell does not show cell until I navigate to parent view controller and come back

My tableview does not show cell data until I tap on back button and return to table view controller. My app is loading data from Firebase. class ViewPostsViewCo

Getting the out of range index error when trying to make a Page Tab View from API array

This is my Model: class Api { func getRockets(completion: @escaping ([Rocket]) -> ()) { guard let url = URL(string: "https://api.spacexdata.com/v

How Do I relogin after getting a 401 back using URLSession and CombineAPI

I'm new to combine and URLSession and I'm trying to find a way to log in after I get a 401 error back. My Set up for the URLSession. APIErrors: enum APIError:

Segue Identifier is going missing in Swift 5.6

I've only been programming for a month, and I am trying to cobble together a mockup and I keep getting the following error: Terminating app due to uncaught exc

SwiftUI @AppStroage - 'Simultaneous accesses to *, but modification requires exclusive access'

In my project I was dealing with this issue. After many hours, I was able to track down the causes and reduce them into a small demo, but do not understand the

How to animate a view transition on a conditional view?

The setup is quite simple: State/Observable/Computet property, let's call it S1 Views (V1, V2) that depend on S1 The following conditions must hold: V1 should h