Answers for "swift unwrap optional array"

0

how to unwrap arrays with optional value in swift

let arrayOfOptionals: [String?] = ["Seems", "like", "an", nil, "of", "optionals"]
let arrayWithNoOptionals = arrayOfOptionals.compactMap { $0 }
Posted by: Guest on December-06-2019

Code answers related to "Swift"

Browse Popular Code Answers by Language