Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo
Swift Quick Syntax Reference

Book Description

"

Swift Quick Syntax Reference is a 120-page 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 Mac 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. This reference is small and handy and ideal for taking with you to your appointments.

"

Table of Contents

  1. Cover
  2. Title
  3. Copyright
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. About the Author
  8. About the Technical Reviewer
  9. Introduction
  10. Chapter 1: Hello World
    1. Xcode
      1. Install Xcode
      2. Create a New Playground
  11. Chapter 2: Declaring Constants and Variables
    1. Constants
      1. Constants Are Immutable
    2. Variables
      1. Variables Are Mutable
    3. Type Inference
    4. Data Types
  12. Chapter 3: Printing Variables and Constants
    1. Creating a Command-Line Tool
      1. Printing to the Console
      2. String Interpolation
  13. Chapter 4: Code Comments
    1. One-Line Code Comments
    2. Multiline Comments
    3. Nested Code Comments
  14. Chapter 5: Numbers
    1. Integers
      1. Integer Sizes
    2. Floating-Point Numbers
  15. Chapter 6: Strings
    1. Unicode Characters
    2. Character Data Type
    3. Concatenation
    4. Comparing Strings
    5. String Interpolation
  16. Chapter 7: Booleans
  17. Chapter 8: Tuples
  18. Chapter 9: Optionals
    1. Forced Unwrapping
    2. Optional Bindings
  19. Chapter 10: Type Aliases
  20. Chapter 11: Global and Local Variables
    1. Scope Defined
    2. Global Variables
  21. Chapter 12: Assertions
  22. Chapter 13: Assignment Operators
    1. Compound Operators
  23. Chapter 14: Arithmetic Operators
    1. Remainder Operator
    2. Order of Operations and Parentheses
    3. Increment and Decrement Operators
    4. Unary Minus Operator
    5. Compound Operators
    6. String Concatenation
  24. Chapter 15: Comparison Operators
  25. Chapter 16: Ternary Conditional Operator
  26. Chapter 17: Range Operators
    1. Closed Range Operator
    2. Half-Open Range Operator
  27. Chapter 18: Logical Operators
  28. Chapter 19: Enumerations
  29. Chapter 20: Arrays
    1. Array Mutability
      1. Adding Items to Arrays
      2. Removing Items from Arrays
      3. Changing Items in Arrays
    2. Iterating Over Array Items
  30. Chapter 21: Dictionaries
    1. Referencing Dictionary Items
    2. Updating Dictionary Items
    3. Iterating Over Dictionary Items
  31. Chapter 22: Loops
    1. for-condition-increment Loop
    2. for-in Loop
    3. While Loop
    4. do-while Loop
  32. Chapter 23: if Statements
    1. else Keyword
  33. Chapter 24: switch Statements
    1. switch Keyword
      1. Case Keyword
  34. Chapter 25: Control Transfer Statements
    1. continue Statement
    2. break Statement
    3. fallthrough Statement
  35. Chapter 26: Labeled Statements
  36. Chapter 27: Functions
    1. Parameters
  37. Chapter 28: Nested Functions
  38. Chapter 29: Closures
  39. Chapter 30: Structures
    1. Structure Instances
    2. Accessing Structure Properties
    3. Structure Functions
  40. Chapter 31: Classes
    1. Class Instances (Objects)
    2. Accessing Class Properties
    3. Class Functions
  41. Chapter 32: Using Instances
    1. Reference vs. Copy
  42. Chapter 33: Class Identity Operators
    1. Class Equality Identity Operator
    2. Class Inequality Identity Operator
  43. Chapter 34: Properties
    1. Lazy and Computed Properties
      1. Lazy Properties
      2. Computed Properties
  44. Chapter 35: Property Observers
  45. Chapter 36: Class Type Properties
    1. Value Type Properties
  46. Chapter 37: Type Methods
    1. Type Methods for Value Types
  47. Chapter 38: Subscripts
  48. Chapter 39: Inheritance
  49. Chapter 40: Overriding Methods and Properties
  50. Chapter 41: Initialization
  51. Chapter 42: De-initialization
  52. Chapter 43: Type Casting
    1. Type Casting Instances
  53. Chapter 44: Nested Types
  54. Chapter 45: Extensions
  55. Chapter 46: Protocols
  56. Chapter 47: Delegation
    1. Implementing Delegation
      1. Defining a Protocol
      2. Adopting the Protocol
      3. Implement Protocol
      4. Adding Delegate Property
      5. Assigning Delegate Property
    2. Using Delegation
  57. Chapter 48: Generics
    1. Type Checking
  58. Chapter 49: Automatic Reference Counting
    1. Strong References and Reference Cycles
  59. Index