Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

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]
Comment

PREVIOUS NEXT
Code Example
Swift :: swift go back to previous view controller 
Swift :: swiftui textfield multiline 
Swift :: how to download swift 
Swift :: generate random bool swift 
Swift :: swift change status bar color 
Swift :: swift ways to setup constraints 
Swift :: alert swiftui 
Swift :: post request in swift 
Swift :: swift round double to 2 decimal places 
Swift :: and in swift7 
Swift :: swift get device screen size 
Swift :: ios swift create new background thread 
Swift :: dismiss keyboard when tap outside swift 5 
Swift :: view controller modal fullscreen programmatically swift 5 
Swift :: remove cocoapods swiftr 
Swift :: How to hide view in swiftui 
Swift :: how to set the font of text in swiftui 
Swift :: switch button swift 5 
Swift :: swiftui tabview background color 
Swift :: setting a local notification at specific time every day swift 
Swift :: Single Line Comment 
Swift :: uikit call swiftui view 
Swift :: Swiftui run action before navigationlink inside on button 
Swift :: Swift Add Two Numbers 
Swift :: Swift static Methods 
Swift :: dequeueReusableCellWithIdentifier returns nil 
Swift :: ios swift local storage with icloud 
Swift :: how to get list of value from specific keys in array object in swift 
Swift :: check and uncheck cells in uitableview swift 5 
Swift :: Swift Syntax of Nested Function 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =