Suggested approach: Extensions add functionality to specific data types, e.g. Int
. Protocol extensions add functionality to protocols, for example all kinds of integers at the same time – Int
, Int8
, UInt64
, and so on.
For bonus points you could go on to talk about how protocol extensions enable protocol-oriented programming.
Estimated difficulty: Intermediate
See the full list of iOS interview questions
Link copied to your pasteboard.