get index filter swift
let items: [String] = ["A", "B", "A", "C", "A", "D"]
print(items.enumerated().filter({ $0.element == "A" }).map({ $0.offset })) // -> [0, 2, 4]
Also in Swift:
- blur background swiftui
- how to replace certain characters in string swift
- swift url encode string
- swift initialize a view
- activity indicator swiftui
- swift string keep only numbers
- swift get day from available string
- button click programmatically swift
- how to change background color swift
- initializer generator xcode swift
- how to add two right bar button item xcode
- swift credit card validate
- uiimage swift src url
- switch statements swift
- ui alert swift yes no
- swift navigation bar title font
- get device height spritekit
- get address from latitude and longitude in swift
- swift uicollectionviewcell how to know when off screen
- convert secondsfrom1970 to date swift
- Resizing UITableView to fit content
- swift uialertcontroller textfield
- if statement swfit
- set root view controller ios 13