You are previewing Professional Swift.
O'Reilly logo
Professional Swift

Book Description

Transition from Objective-C to the cleaner, more functional Swift quickly and easily

Professional Swift shows you how to create Mac and iPhone applications using Apple's new programming language. This code-intensive, practical guide walks you through Swift best practices as you learn the language, build an application, and refine it using advanced concepts and techniques. Organized for easy navigation, this book can be read end-to-end for a self-paced tutorial, or used as an on-demand desk reference as unfamiliar situations arise. The first section of the book guides you through the basics of Swift programming, with clear instruction on everything from writing code to storing data, and Section II adds advanced data types, advanced debugging, extending classes, and more. You'll learn everything you need to know to make the transition from Objective-C to Swift smooth and painless, so you can begin building faster, more secure apps than ever before.

  • Get acquainted with the Swift language and syntax

  • Write, deploy, and debug Swift programs

  • Store data and interface with web services

  • Master advanced usage, and bridge Swift and Objective-C

  • Professional Swift is your guide to the future of OS X and iOS development.

    Table of Contents

    1. Cover Page
    2. Title Page
    3. Copyright
    4. Dedication
    5. ABOUT THE AUTHOR
    6. CREDITS
    7. ACKNOWLEDGMENTS
    8. CONTENTS
    9. INTRODUCTION
    10. PART I: Building Applications with Swift
      1. Chapter 1: A Swift Primer
        1. WHAT IS SWIFT?
        2. WORKING WITH CONSTANTS AND VARIABLES
        3. WORKING WITH OPERATORS
        4. MAKING DECISIONS WITH CONTROL FLOW
        5. GROUPING TYPES WITH ENUMERATIONS
        6. WORKING WITH FUNCTIONS
        7. SUMMARY
      2. Chapter 2: Writing a Swift Program
        1. SETTING UP XCODE
        2. EXPERIMENTING WITH PLAYGROUNDS
        3. WRITING SWIFT IN XCODE
        4. DEBUGGING SWIFT APPLICATIONS
        5. SUMMARY
      3. Chapter 3: Classes, Structs, and Enums
        1. WORKING WITH CLASSES AND STRUCTS
        2. WORKING WITH PROPERTIES
        3. UNDERSTANDING METHODS
        4. UNDERSTANDING THE DIFFERENCE BETWEEN CLASSES AND STRUCTS
        5. WORKING WITH ENUMERATIONS
        6. SUMMARY
      4. Chapter 4: Concurrency in Swift
        1. WHAT IS CONCURRENCY?
        2. CONCURRENCY IN iOS AND OS X
        3. SUMMARY
      5. Chapter 5: Interfacing with Web Services
        1. UNDERSTANDING WEB SERVICES
        2. IMPLEMENTING A WEB SERVICES CLIENT
        3. SUMMARY
      6. Chapter 6: Storing Data with Core Data
        1. WHAT IS CORE DATA?
        2. USING CORE DATA WITH SWIFT
        3. SUMMARY
    11. PART II: Advanced Swift Concepts
      1. Chapter 7: Extending Classes
        1. WORKING WITH CLASS EXTENSIONS
        2. SPECIFYING BEHAVIOR WITH PROTOCOLS
        3. WORKING WITH GENERICS
        4. SUMMARY
      2. Chapter 8: Advanced Data Types
        1. WORKING WITH ENUMS AND ALGEBRAIC DATA TYPES
        2. WORKING WITH OPTIONAL TYPES
        3. UNDERSTANDING TYPE CASTING
        4. GROUPING VALUES WITH TUPLES
        5. CUSTOM OPERATORS
        6. USING FUNCTIONS AND CLOSURES
        7. SUMMARY
      3. Chapter 9: Bridging Swift and Objective-C
        1. THE SUCCESSOR TO OBJECTIVE-C
        2. INTRODUCING NAMESPACES AND MODULES
        3. HOW SWIFT AND OBJECTIVE-C INTERACT
        4. USING C AND C++ CODE WITH SWIFT
        5. SUMMARY
      4. Chapter 10: Debugging Swift Applications
        1. THE ART OF DEBUGGING
        2. CREATING CIRCLEVIEW
        3. PRINTING VALUES
        4. WORKING WITH DEBUGGERS
        5. EXAMINING ERRORS WITH LLDB, THE LLVM DEBUGGER
        6. SUMMARY
      5. Chapter 11: The Swift Runtime
        1. WHAT IS A RUNTIME?
        2. UNDERSTANDING THE OBJECTIVE-C RUNTIME
        3. EXPLORING THE SWIFT RUNTIME
        4. SUMMARY
      6. APPENDIX: An Overview of C