-
Book Overview & Buying
-
Table Of Contents
Mastering Swift 5.3 - Sixth Edition
By :
If you are an Objective-C developer, and you are not familiar with modern languages such as Python or Ruby, the code in the previous screenshots may have looked pretty strange. The Swift language syntax is a huge departure from Objective-C, which was based largely on Smalltalk and C.
The Swift language uses modern concepts and syntax to create very concise and readable code. There is also a heavy emphasis on eliminating common programming mistakes.
Before we get into the Swift language itself, let's look at some of the basic syntax of the Swift language.
Writing comments in Swift code is a little different from writing comments in Objective-C code. We can still use double slash (//) for single-line comments and /** and */ for multiline comments; however, if we want to use the comments to also document our code, we need to use the triple slash (///) or multiline comment block.
You can auto-generate a comment template based...