Learning Swift - Second Edition

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

Learning Swift - Second Edition

This ebook is included in a Mapt subscription
Andrew J Wagner

1 customer reviews
Develop the skills required to create compelling, maintainable, and robust iOS and OS X apps with Swift
$0.00
$16.00
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

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