canImport()
compiler condition do?Suggested approach: You should get straight to the point and say that canImport()
returns true if a module such as UIKit can be imported, then provide a practical example such as it allowing us to write code that does one thing using UIKit on iOS, and another thing using AppKit on macOS.
Estimated difficulty: Easy
See the full list of iOS interview questions
Link copied to your pasteboard.