Book Image

Swift 4 Protocol-Oriented Programming [Video]

By : Jon Hoffman
Book Image

Swift 4 Protocol-Oriented Programming [Video]

By: Jon Hoffman

Overview of this book

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 course will help you understand the differences between Object-Oriented Programming and Protocol-Oriented Programming. It demonstrates 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 course, you will have a thorough understanding of Protocol-Oriented Programming and how to utilize it to build powerful and practical applications.
Table of Contents (8 chapters)
Chapter 5
Object-Oriented Programming
Content Locked
Section 2
Issues with the Object-Oriented Design
Two of the issues that we saw with the object-oriented design were directly related to each other, and are the result of Swift being a single-inheritance language. Remember a single-inheritance language is a language that limits a class to having not more than one superclass. An object-oriented design with a single-inheritance language, such as Swift, can lead to bloated superclasses because we may need to include functionality that is needed by only a few of the subclasses. This leads to the second issue related to Swift being a single-inheritance language, which is the inheritance of functionality that a type does not need. - Look at the simple mistakes that we can do while performing or defining code