Protocol-Oriented Programming in Swift
210 pages
French
PDF
4.5

Protocol-Oriented Programming in Swift

Практическое руководство по протоколам Swift

Auteur :

Année :

Résumé :

Introduction

The book «Protocol-Oriented Programming with Swift» (2015) by Jon Hoffman is one of the first publications dedicated to the paradigm of protocol-oriented programming (POP) in the Swift language. Swift was originally designed as a protocol-oriented language, and the author details how to use protocols, extensions, and composition instead of traditional class inheritance. The book will be useful for iOS and macOS developers who want to write more flexible, testable, and reusable code.

What the book is about

The book consists of 10 chapters, each dedicated to a specific aspect of POP. It starts with the basics: what protocols are, how to declare them, and how to conform to them. Then the author moves on to more advanced topics: protocol extensions, protocol composition, using protocols with generics, and comparing POP with OOP. Special attention is given to practical examples — creating a game engine, working with delegates, and design patterns.

Who this book is for

The book is aimed at developers already familiar with the basics of Swift and having experience building applications for iOS or macOS. Beginners will find it challenging — knowledge of syntax, data types, and basic OOP is assumed. However, for those who want to transition from classical inheritance to a more modern approach, the book will be an excellent guide.

What the reader will learn

  • Protocol basics: declaration, conformance, required and optional

Recommendations