Learning Swift - Second Edition

Develop the skills required to create compelling, maintainable, and robust iOS and OS X apps with Swift
Preview in Mapt

Learning Swift - Second Edition

Andrew J Wagner

1 customer reviews
Develop the skills required to create compelling, maintainable, and robust iOS and OS X apps with Swift
Mapt Subscription
FREE
$29.99/m after trial
eBook
$22.40
RRP $31.99
Save 29%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$22.40
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Learning Swift - Second Edition Book Cover
Learning Swift - Second Edition
$ 31.99
$ 22.40
Swift Functional Programming - Second Edition Book Cover
Swift Functional Programming - Second Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $32.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781785887512
Paperback308 pages

Book Description

Swift is Apple’s new programming language and the future of iOS and OS X app development. It is a high-performance language that feels like a modern scripting language. On the surface, Swift is easy to jump into, but it has complex underpinnings that are critical to becoming proficient at turning an idea into reality.

This book is an approachable, step-by-step introduction into programming with Swift for everyone. It begins by giving you an overview of the key features through practical examples and progresses to more advanced topics that help differentiate the proficient developers from the mediocre ones. It covers important concepts such as Variables, Optionals, Closures, Generics, and Memory Management. Mixed in with those concepts, it also helps you learn the art of programming such as maintainability, useful design patterns, and resources to further your knowledge. This all culminates in writing a basic iOS app that will get you well on your way to turning your own app ideas into reality.

Table of Contents

Chapter 1: Introducing Swift
Defining our goals for this book
Setting up the development environment
Running our first swift code
Understanding playgrounds
Learning with this book
Summary
Chapter 2: Building Blocks – Variables, Collections, and Flow Control
Core Swift types
Swift's type system
Printing to the console
Control flow
Functions
Bringing it all together
Summary
Chapter 3: One Piece at a Time – Types, Scopes, and Projects
Structs
Classes
Enumerations
Projects
Extensions
Scope
Access control
Summary
Chapter 4: To Be or Not To Be – Optionals
Defining an optional
Unwrapping an optional
Optional chaining
Implicitly unwrapped optionals
Debugging optionals
The underlying implementation
Summary
Chapter 5: A Modern Paradigm – Closures and Functional Programming
Functional programming philosophy
Closures
Building blocks of functional programming in Swift
Lazy evaluation
Example
Summary
Chapter 6: Make Swift Work For You – Protocols and Generics
Protocols
Generics
Extending generics
Putting protocols and generics to use
Summary
Chapter 7: Everything Is Connected – Memory Management
Computer data storage
Value types versus reference types
Automatic reference counting
Strong reference cycles
Lost objects
Structures versus classes
Summary
Chapter 8: Paths Less Traveled – Error Handling
Throwing errors
Handling errors
Cleaning up in error situations
Summary
Chapter 9: Writing Code the Swift Way – Design Patterns and Techniques
What is a design pattern?
Behavioral patterns
Structural patterns
Creational patterns
Using associated values effectively
Extending system types to reduce code
Lazy properties
Summary
Chapter 10: Harnessing the Past – Understanding and Translating Objective-C
Swift's relationship to Objective-C
Background of Objective-C
Constants and variables
Containers
Control flow
Functions
Types
Projects
Calling Objective-C code from Swift
Using functions
Summary
Chapter 11: A Whole New World – Developing an App
Conceptualizing the app
Setting up the app project
Configuring the user interface
Running the app
Allowing picture taking
Temporarily saving a photo
Populating our photo grid
Refactoring to respect model-view-controller
Permanently saving a photo
Summary
Chapter 12: What's Next? – Resources, Advice, and the Next Steps
Apple's documentation
Forums and blogs
Prominent figures
Podcasts
Summary

What You Will Learn

  • Form a solid understanding of the Swift 2 language
  • Get to know the practical aspects of how a computer program actually works
  • Understand the paradigms used by Apple’s frameworks so you are not intimidated by them
  • Utilize the vast resources written in Objective-C to better inform your Swift programming
  • Develop a basic portfolio of Swift code by learning the critical concepts
  • Experience both object-oriented and functional programming
  • Get to know the new coding techniques made available by Swift 2
  • Discover resources to ensure you never stop becoming a better developer

Authors

Table of Contents

Chapter 1: Introducing Swift
Defining our goals for this book
Setting up the development environment
Running our first swift code
Understanding playgrounds
Learning with this book
Summary
Chapter 2: Building Blocks – Variables, Collections, and Flow Control
Core Swift types
Swift's type system
Printing to the console
Control flow
Functions
Bringing it all together
Summary
Chapter 3: One Piece at a Time – Types, Scopes, and Projects
Structs
Classes
Enumerations
Projects
Extensions
Scope
Access control
Summary
Chapter 4: To Be or Not To Be – Optionals
Defining an optional
Unwrapping an optional
Optional chaining
Implicitly unwrapped optionals
Debugging optionals
The underlying implementation
Summary
Chapter 5: A Modern Paradigm – Closures and Functional Programming
Functional programming philosophy
Closures
Building blocks of functional programming in Swift
Lazy evaluation
Example
Summary
Chapter 6: Make Swift Work For You – Protocols and Generics
Protocols
Generics
Extending generics
Putting protocols and generics to use
Summary
Chapter 7: Everything Is Connected – Memory Management
Computer data storage
Value types versus reference types
Automatic reference counting
Strong reference cycles
Lost objects
Structures versus classes
Summary
Chapter 8: Paths Less Traveled – Error Handling
Throwing errors
Handling errors
Cleaning up in error situations
Summary
Chapter 9: Writing Code the Swift Way – Design Patterns and Techniques
What is a design pattern?
Behavioral patterns
Structural patterns
Creational patterns
Using associated values effectively
Extending system types to reduce code
Lazy properties
Summary
Chapter 10: Harnessing the Past – Understanding and Translating Objective-C
Swift's relationship to Objective-C
Background of Objective-C
Constants and variables
Containers
Control flow
Functions
Types
Projects
Calling Objective-C code from Swift
Using functions
Summary
Chapter 11: A Whole New World – Developing an App
Conceptualizing the app
Setting up the app project
Configuring the user interface
Running the app
Allowing picture taking
Temporarily saving a photo
Populating our photo grid
Refactoring to respect model-view-controller
Permanently saving a photo
Summary
Chapter 12: What's Next? – Resources, Advice, and the Next Steps
Apple's documentation
Forums and blogs
Prominent figures
Podcasts
Summary

Book Details

ISBN 139781785887512
Paperback308 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Python Machine Learning Book Cover
Python Machine Learning
$ 35.99
$ 25.20
Mastering Swift 2 Book Cover
Mastering Swift 2
$ 39.99
$ 28.00
Mastering Swift 3 Book Cover
Mastering Swift 3
$ 35.99
$ 25.20
Swift Essentials - Second Edition Book Cover
Swift Essentials - Second Edition
$ 27.99
$ 19.60
Practical Machine Learning Book Cover
Practical Machine Learning
$ 37.99
$ 26.60
Mastering Object-oriented Python Book Cover
Mastering Object-oriented Python
$ 26.99
$ 18.90