Optionals
The last few posts have been a summary and consolidation of what I know about Swift. It was a cathartic process, talking through what I know about it at this point and reminding myself of why I am learning it too! This blog will from now on detail my immediate thoughts and reflections about what I learn with Swift. This one starts from page 52 of 'Learn to Code in Swift 4' by Kevin McNeish. The first few chapters have been an introduction to Swift, how to navigate the Ebook, a bit about Xcode and about objects/classes. This feels like a good point to begin my 'live' reflections: Optionals ! Optionals allow you to specify that a variable or constant may return 'nil' (nothing). Now what exactly that means I'm not sure about, at this point. They seem to be an important element of Swift so I need to get my head around them. Apparently they let you be more precise - telling the code when it's OK for a value to be empty, and when not. So, if an unexpected ...