How to find index of list item in Swift?
let arr = ["a","b","c","a"]
let indexOfA = arr.firstIndex(of: "a") // 0
let indexOfB = arr.lastIndex(of: "a") // 3
Also in Swift:
- generate random bool swift
- uitableviewcell automatic height
- swift and xcode and convert "Int to Int16"
- swift + data to string
- UI API called on a background thread
- swift resource exceeds maximum size
- Library not loaded: @rpath/App.framework/App
- swift for loop index
- swift pdf preview image
- reverse list swift
- loop backwards swift
- Resizing UITableView to fit content
- swift pop to specific view controller
- swift change button text
- swift get current time
- using swipe gesture recognizer swift
- navigationcontroller.pushviewcontroller
- How to find index of list item in Swift?
- swift print
- swift loop through array
- swift bring something to front of view
- remove padding hstack swiftui
- swift add horizontal line uiview programmatically
- how to show notification icon on tabbar item swift