Swift Optionals (e.g. String?) are used to:
- Import frameworks
- Safely represent a value that may be missing (nil)
- Declare constants
- Make code run faster
Answer
B) Safely represent a value that may be missing (nil)
Optionals force developers to handle nil values safely.
Computer Science MCQ · More iOS: Architecture and Framework MCQs · Practise