Swift Quick Syntax Reference
Swift Quick Syntax Reference is a condensed code and syntax reference to the new Apple Swift programming language, which is the alternative new programming language alongside Objective-C behind the APIs found in the Apple iOS SDK 8 and OS X Yosemite SDK. It presents the essential Swift syntax in a well-organized format that can be used as a handy reference.
You won’t find any technical jargon, bloated samples, drawn out history lessons, or witty stories in this book. What you will find is a language reference that is concise, to the point, and highly accessible. The book is packed with useful information and is a must-have for any Swift programmer.
In the Swift Quick Syntax Reference, you will find a concise reference to the Swift language syntax using the new Playgrounds. Playgrounds lets you type a line of code and the result appears immediately.
What youll learn
- How to declare and print constants and variables
- What are and how to use numbers, strings, booleans, tuples, optionals, aliases, global and local variables, assertions and more
- How to use assignment, arithmetic, comparison, ternary conditional, range, and logical operators
- What are enumerations, arrays, dictionaries, loops, if/switch, control transfer, labeled statements
- How to do closures in Swift
- How to define or handle structures, classes, instances, class instance identity, properties, property observers, type properties, and type methods
- How to work with subscripts, inheritance, overriding methods/properties, initialization, type checking/casting, nested types, extensions, delegation, generics and more...
Who this book is for
This book is a quick, handy syntax reference for experienced Objective-C, Mac, and iOS programmers, and a concise, easily-digested introduction for other programmers new to Mac, iOS and of course Swift.
Table of Contents1. Hello World
2. Declaring Constants and Variables
3. Printing Variables and Constants
4. Code Comments
10. Type Aliases
11. Global and Local Variables
13. Assignment Operators
14. Arithmetic Operators
15. Comparison Operators
16. Ternary Conditional Operator
17. Range Operators
18. Logical Operators
23. if Statements
24. switch Statements
25. Control Transfer Statements
26. Labeled Statements
28. Nested Functions
32. Using Instances
33. Class Instance Identity Operators
35. Property Observers
36. Class Type Properties
37. Type Methods
40. Overriding Methods and Properties
43. Type Casting
44. Nested Types
49. Automatic Reference Counting