Float
, Double
, and CGFloat
data types?Suggested approach: It’s a question of how many bits are used to store data: Float
is always 32-bit, Double
is always 64-bit, and CGFloat
is either 32-bit or 64-bit depending on the device it runs on, but realistically it’s just 64-bit all the time.
For bonus points, talk about how Swift 5.5 and onwards allows us to use CGFloat
and Double
interchangeably.
Estimated difficulty: Easy
Watch me answer this question in detail
See the full list of iOS interview questions
Link copied to your pasteboard.