Swift 4 Protocol-Oriented Programming, 3rd Edition
- Length: 243 pages
- Edition: 3rd Revised edition
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2018-03-09
- ISBN-10: 1788470036
- ISBN-13: 9781788470032
- Sales Rank: #1171059 (See Top 100 Books)
Key Features
- Leverage the power of protocol-oriented programming in your applications and learn from real-world use cases
- Create a flexible code base with protocols and protocol extensions
- Leverage the power of generics in Swift 4 to create very flexible frameworks
Book Description
Swift has become the number one language used in iOS and macOS development. The Swift standard library is developed using protocol-oriented programming techniques, generics, and first-class value semantics; therefore, every Swift developer should understand these powerful concepts and how to take advantage of them in their application design.
This book will help you understand the differences between object-oriented programming and protocol-oriented programming. It will demonstrate how to work with protocol-oriented programming using real-world use cases. You will gain a solid knowledge of the various types that can be used in Swift and the differences between value and reference types. You will be taught how protocol-oriented programming techniques can be used to develop very flexible and easy-to-maintain code.
By the end of the book, you will have a thorough understanding of protocol-oriented programming and how to utilize it to build powerful and practical applications.
What you will learn
- Understand the differences between object-oriented programming and protocol-oriented programming
- Explore the different types that Swift offers and what pitfalls to avoid
- Delve into generics and generic programming
- Learn how to implement Copy-On-Write within your custom types
- Implement several design patterns in a protocol-oriented way
- Design applications by prioritizing the protocol first and the implementation types second
Table of Contents
Chapter 1. Starting with the Protocol
Chapter 2. Our Type Choices
Chapter 3. Extensions
Chapter 4. Generics
Chapter 5. Object-Oriented Programming
Chapter 6. Protocol-Oriented Programming
Chapter 7. Adopting Design Patterns in Swift
Chapter 8. Case Studies