Category "swift"

UIKit - removing rows from sections

I'm new to Swift, trying to build a simple toDoList using UIKit. For now, I'm trying to approach it the simplest way possible, so the data is appended in viewDi

How can I define custom operators to deal with Range of String.Index in Swift?

I find using String.Index really needs a lot of code in Swift, especially when it comes to methods of Range Swift doesn't have. Like in above code where I don't

Receiver '**' for class message is a forward declaration Error. Swift Static Library use in Objective-C

I am trying to make a Swift Static library and apply it to Swift and Objective Project. import Foundation @objc open class Library001_Test: NSObject { publi

How can I set an NSDate object to midnight?

I have an NSDate object and I want to set it to an arbitrary time (say, midnight) so that I can use the timeIntervalSince1970 function to retrieve data consiste

Collectionview specific layout

I am trying to find an approach to get my collectionview to have this layout for the cells with paging The image should always be in center and have parts from

How to implement CA pinning in iOS to prevent man in the middle attack?

I have read several topics, blogs about SSL pinning in iOS and have implemented the following strategy to do SSL pinning way back in one of the app Current SSL

How to fix UI of GMSAutocompleteViewController in iOS 15?

Before iOS 15, the Autocomplete feature was totally fine. However, from iOS 15, the GMSAutocompleteViewController has the bug as can be seen in the following sc

How can i disable the swipe for the tab view in certain indexes before i swipe in swift UI?

TabView(index){ UIView } .gesture( DragGesture() .onChanged { if $0.startLocation.x > $0.location.x { //left // met

How to pull all product data from index in Algolia?

After reading the docs on how to search and browse an index with Algolia's Swift Client, it's not clear how I need to pull all product data from an index. In th

In UICollectionView not obeying zIndex of UICollectionViewLayoutAttributes

I'm trying to make the top cell of the collection be behind all the other cells by the zIndex factor ┌───────

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