Book Image

Swift Protocol-Oriented Programming - Fourth Edition

By : Jon Hoffman
Book Image

Swift Protocol-Oriented Programming - Fourth Edition

By: Jon Hoffman

Overview of this book

Protocol-oriented programming 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; therefore, it is important for every Swift developer to understand these core concepts and take advantage of them. The fourth edition of this book is improved and updated to the latest version of the Swift programming language. This book will help you understand what protocol-oriented programming is all about and how it is different from other programming paradigms such as object-oriented programming. This book covers topics such as generics, Copy-On-Write, extensions, and of course protocols. It also demonstrates how to use protocol-oriented programming techniques via real-world use cases. By the end of this book, you will know how to use protocol-oriented programming techniques to build powerful and practical applications.
Table of Contents (11 chapters)

What is object-oriented programming?

Object-oriented programming is a design philosophy. Writing applications with an object-oriented programming language is fundamentally different to writing applications with older procedural languages, such as C and Pascal. Procedural languages use a set of instructions to tell the computer what to do step by step, by relying on procedures (or routines). However, object-oriented programming is all about the object. This may seem like a pretty obvious statement given the name, but essentially, when we think about object-oriented programming, we need to think about the object.

The object is a data structure that contains information about the attributes of the object, in the form of properties and the actions performed by, or to, the object in the form of methods. Objects can be considered things and in the English language, they would...