Suggested approach: Both check and unwrap optionals, but
guard forces an early return if its check fails – your code will literally not compile unless you exit the scope. Furthermore, any variables that
guard unwraps stay in scope after the
guard block, whereas with
if let the variables are available only inside the scope.
Estimated difficulty: Easy
See the full list of iOS interview questions
targetEnvironment()compiler condition do?
Link copied to your pasteboard.