Ebook: Swift Protocol-Oriented Programming: Increase productivity and build faster applications with Swift 5, 4th Edition
Author: Jon Hoffman
- Year: 2019
- Publisher: Packt Publishing
- Language: English
- pdf
Get up to speed with the protocol-oriented programming paradigm to ensure better code maintainability and increased performance with Swift programming
Key Features
- Use protocol-oriented programming to enhance your applications
- Use generics to create flexible frameworks
- Learn how to implement common design patterns in a protocol-oriented way
Book Description
Protocol-oriented programming (POP) is an incredibly powerful concept at the heart of Swift's design. Swift's standard library was developed using POP techniques, generics, and first-class value semantics, which makes it important for every Swift developer to understand these core concepts and use them effectively. This updated fourth edition will help you get to grips with the latest version of the Swift programming language.
You will start by understanding what protocol-oriented programming is and how it is different from other programming paradigms such as object-oriented programming. Next, the book will systematically guide you through memory management, before progressing to cover essential topics such as generics, Copy-On-Write, extensions, and protocols. As you advance, you'll focus on adopting design patterns in Swift. The concluding chapters will even demonstrate how you can use protocol-oriented programming techniques with the help of real-world use cases.
By the end of this book, you will have learned how to use protocol-oriented programming techniques to build powerful and practical applications.
What you will learn
- Explore the differences between object-oriented programming and protocol-oriented programming
- Understand why value types should be prioritized over reference types
- Delve into protocols, protocol inheritance, protocol composition, and protocol extensions
- Become well-versed with implementing COW (Copy-On-Write) within your custom value types
- Understand how memory management works in Swift and how to avoid common pitfalls
- Design applications by starting with the protocol rather than the implementation
Who this book is for
This book is for Swift developers who have basic knowledge of the Swift programming language and are looking to understand how they can use protocol-oriented programming techniques in their applications.
Table of Contents
- Starting with the Protocol
- Our Type Choices
- Extensions
- Generics
- Memory Management
- Object-Oriented Programming
- Protocol-Oriented Programming
- Adopting Design Patterns in Swift
- Case Studies