Swift 2 Design Patterns

Build robust and scalable iOS and Mac OS X game applications

Swift 2 Design Patterns

Julien Lange

1 customer reviews
Build robust and scalable iOS and Mac OS X game applications
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
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
 
Preview in Mapt

Book Details

ISBN 139781785887611
Paperback224 pages

Book Description

Swift is a multi-paradigm language. It has expressive features familiar to those used to work with modern functional languages, while also keeping the object-oriented features of Objective-C. It remains compatible with Apple’s legacy codes and frameworks. A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. It also gives implementation hints and examples. Knowledge about design patterns is also one of the best ways to make you different compared to other low-level developers.

This book shows you how to use Swift 2 to learn about 23 Gang of Four (GoF) design patterns, and is organized into three categories. The book will present you the five creational patterns, followed by the seven structural patterns, and finishing with the 11 behavioral patterns as defined by the GoF. Each chapter will introduce the pattern by defining its role, which common problems the pattern should be used for, its generic UML representation, how each objects presented in the class diagram participate in the pattern, and what the role of each of these objects is. The book then presents you with a concrete case as an illustration that will be used to implement the pattern using Swift.

Table of Contents

Chapter 1: Creational Patterns
The prototype pattern
The factory method pattern
The singleton pattern
The abstract factory pattern
The builder pattern
Summary
Chapter 2: Structural Patterns – Decorator, Proxy, and Bridge
Static and dynamic composition
The decorator pattern
The proxy pattern
The bridge pattern
Summary
Chapter 3: Structural Patterns – Composite and Flyweight
The composite pattern
The flyweight pattern
Summary
Chapter 4: Structural Patterns – Adapter and Facade
The adapter pattern
The facade pattern
Summary
Chapter 5: Behavioral Patterns – Strategy, State, and Template Method
The strategy pattern
The state pattern
The template method
Summary
Chapter 6: Behavioral Patterns – Chain of Responsibility and Command
The chain of responsibility pattern
The command pattern
Comparison between the chain of responsibility and command patterns
Summary
Chapter 7: Behavioral Patterns – Iterator, Mediator, and Observer
The iterator pattern
The mediator pattern
The observer pattern
Summary
Chapter 8: Behavioral Patterns – Visitor, Interpreter, and Memento
The visitor pattern
The interpreter pattern
The memento pattern
Comparing the three patterns
Summary

What You Will Learn

  • Choose the appropriate pattern depending on the problem to be solved
  • Understand the generic class diagram of each of the 23 GoF patterns and how each object participates in the pattern
  • Use Swift to implement these patterns even though the language doesn’t provide all of the object-oriented programming concepts such as abstract class, interface, and so on
  • Architect your software to avoid the overuse of memory, time spent on calculations, or high network traffic
  • Find the best way to organize your code to make it more secure from the outside world
  • Prepare your code to make it more flexible when the consumer changes or the third-party component hidden code changes
  • Structure your code to change the algorithm to apply at runtime
  • Deliver Flyweight responsibility to your objects

Authors

Table of Contents

Chapter 1: Creational Patterns
The prototype pattern
The factory method pattern
The singleton pattern
The abstract factory pattern
The builder pattern
Summary
Chapter 2: Structural Patterns – Decorator, Proxy, and Bridge
Static and dynamic composition
The decorator pattern
The proxy pattern
The bridge pattern
Summary
Chapter 3: Structural Patterns – Composite and Flyweight
The composite pattern
The flyweight pattern
Summary
Chapter 4: Structural Patterns – Adapter and Facade
The adapter pattern
The facade pattern
Summary
Chapter 5: Behavioral Patterns – Strategy, State, and Template Method
The strategy pattern
The state pattern
The template method
Summary
Chapter 6: Behavioral Patterns – Chain of Responsibility and Command
The chain of responsibility pattern
The command pattern
Comparison between the chain of responsibility and command patterns
Summary
Chapter 7: Behavioral Patterns – Iterator, Mediator, and Observer
The iterator pattern
The mediator pattern
The observer pattern
Summary
Chapter 8: Behavioral Patterns – Visitor, Interpreter, and Memento
The visitor pattern
The interpreter pattern
The memento pattern
Comparing the three patterns
Summary

Book Details

ISBN 139781785887611
Paperback224 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Swift Essentials Book Cover
Swift Essentials
$ 29.99
$ 21.00
Mastering Swift 2 Book Cover
Mastering Swift 2
$ 39.99
$ 28.00
AngularJS Web Application Development Blueprints Book Cover
AngularJS Web Application Development Blueprints
$ 29.99
$ 21.00
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
Mastering Swift 3 Book Cover
Mastering Swift 3
$ 35.99
$ 25.20