Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

Practical Design Patterns in Swift

via LinkedIn Learning

Overview

Build more functional, robust, and future-proof code using software design patterns. Learn how to implement the most popular "Gang of Four" design patterns with Swift.

Syllabus

Introduction
  • Explore the benefits of design patterns
  • What you should know
1. Design Patterns: Values and Limitations
  • What’s a software design pattern?
  • Applications of design patterns
  • Limitations
  • Creational, structural, and behavioral patterns
2. The Singleton Pattern
  • Purpose, pros, and cons
  • Read-only singletons
  • Concurrency issues
  • Making the singleton thread-safe
  • Readers-writer lock
3. The Prototype Pattern
  • Purpose: Cloning
  • Copying value types
  • Pitfalls of cloning reference types
  • Cloning reference types
4. The Factory Method Pattern
  • Polymorphic instantiation
  • Implementing the Factory Method
5. The Adapter Pattern
  • Working with incompatible interfaces
  • Classical Adapter
  • Adapter using type extensions
6. The Decorator Pattern
  • Enhancing a type without modifying it
  • The object Decorator
  • Decorator via Swift extensions
7. The Facade Pattern
  • Purpose: Simplify usage
  • Consolidating complex functionality
8. The Flyweight Pattern
  • Sharing of common data
  • Spaceships
9. The Proxy Pattern
  • The surrogate
  • Delayed initialization
10. The Chain of Responsibility Pattern
  • Request propagation
  • Request processor
11. The Iterator Pattern
  • Sequential access
  • Custom queue implementation
  • Adding for-in loop support to the queue
12. The Observer Pattern
  • Broadcasting
  • Notifying observers
13. The State Pattern
  • Aim: Reduce complex conditional logic
  • Coffee machine with nested conditionals
  • Refactoring: Identifying the states
  • Refactoring: Implementing the states
Conclusion
  • Next steps

Taught by

Karoly Nyisztor

Reviews

Start your review of Practical Design Patterns in Swift

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.