iOS 12 Programming for Beginners
上QQ阅读APP看书,第一时间看更新

Why optionals?

So, now, you are probably asking yourself: "Why do you have to do this?". Trust me, when I first learned about optionals, I felt the same way. Using optionals helps to protect your code. For now, understand that when you see a data type followed by a question mark, this variable is an optional. As we work with optionals more and more throughout this book, it will become more evident to you.