Suggested approach: This statement means that Swift’s String
type conform to the Collection
protocol, which allows us to loop over characters, count how long the string is, map the characters, select random characters, and more.
For bonus points, move on to talk about the Collection
protocol itself – how it means we have a consistent way to work with strings, arrays, sets, and more.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
Codable
?
Codable
protocol do?
Float
, Double
, and CGFloat
data types?
map()
and compactMap()
?
Link copied to your pasteboard.