Skip to Content
Learning Swift™ Programming
book

Learning Swift™ Programming

by Jacob Schatz
December 2014
Beginner
300 pages
8h 9m
English
Addison-Wesley Professional

Overview

Get started fast with Swiftprogrammingfor iOS and OS X

Learning Swift Programming is a fast-paced, hands-on introduction to writing production-quality iOS and OS X apps with Apple’s new programming language. Written for developers with previous experience in any other modern language, this book explains Swift simply and clearly, using relevant examples that solve realistic problems.

Author Jacob Schatz’s popular Skip Wilson video tutorials on YouTube have already helped thousands of Apple developers get started with Swift. Now, he helps you take full advantage of Swift’s advanced design, remarkable performance, and streamlined development techniques.

Step-by-step, you’ll move from basic syntax through advanced features such as closures and generics–discovering helpful tips and tricks along the way. After you’ve mastered Swift’s building blocks and learned about its key innovations, a full section of case studies walks you through building complete apps from scratch.

  • Compare Swift with Objective-C, JavaScript, Python, Ruby, and C

  • Collect data with arrays and dictionaries, and store it with variables and constants

  • Group commonly-used code into functions for easy reuse

  • Structure your code with enums, structs, and classes

  • Use generics to get more done with less code

  • Write closures to share small blocks of functionality

  • Use optionals to write more robust, crash-resistant, and cleaner code

  • Integrate existing Objective-C code into new Swift apps

  • Program on the bit and byte level with advanced operators

  • Implement efficient design patterns with protocols and delegates

  • Create animated 2D games with SpriteKit, and 3D games with SceneKit

  • Contents at a Glance

    1 Getting Your Feet Wet
        Building Blocks of Swift
        Optionals: A Gift to Unwrap
        Tuples
        Number Types and Converting Between Them
        Coming to Swift from Objective-C and C

    2 Collecting Data
        Using Arrays
        Modifying Arrays
        Using Dictionaries

    3 Making Things Happen: Functions
        Defining Functions
        More on Parameters

    4 Structuring Code: Enums, Structs, and Classes
        Enums
        Structs

    5 Making a Game
        Building a User Interface (UI)
        The Action-Packed View Controller

    6 Reusable Code: Closures
        What Are Closures?
        Closures in Other Languages
        How Closures Work and Why They’re Awesome

    7 Subscripts and Advanced Operators
        Writing Your First Subscript
        Bits and Bytes with Advanced Operators
        Customizing Operators
        Making Your Own Operators
        Bits and Bytes in Real Life

    8 Protocols
        Writing Your First Protocol
        Animizable and Humanizable
        Delegation
        Protocols as Types
        Protocols in Collections
        Optional Chaining

    9 Becoming Flexible with Generics
        The Problem That Generics Solve

    10 Games with SpriteKit
         Setting Up the Project
         The Start Screen
         Dangerous Ground
         A Hero to the Rescue
         Enemies in Motion
         Spawned Obstacles
         Smashing Physics

    11 Games with SceneKit
         Creating DAE Files
         Creating a New SceneKit Project
         Your SceneKit Files
         Making the Game
         Bridging the Gap to Objective-C

    12 Apps with UIKit
         Application Types
         Loading a Table View
         Loading Data from a URL

    Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
    and much more.

    Read now

    Unlock full access

    More than 5,000 organizations count on O’Reilly

    AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

    QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
    Julian F.
    Head of Cybersecurity
    QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
    Addison B.
    Field Engineer
    QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
    Amir M.
    Data Platform Tech Lead
    QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
    Mark W.
    Embedded Software Engineer

    You might also like

    Swift Functional Programming - Second Edition

    Swift Functional Programming - Second Edition

    Dr. Fatih Nayebi
    Programming iOS 13

    Programming iOS 13

    Matt Neuburg

    Publisher Resources

    ISBN: 9780133950410Purchase book