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 3
Extensions
Content Locked
Section 3
Text Validation
In numerous apps, across multiple platforms, we are often asked to validate user input either after the user has entered it. This validation can be done very easily with regular expressions; however, we do not want various regular expression strings littered throughout our code. We can solve this problem by creating different classes or structures that contain the validation code. - Develop validation framework without protocol extensions - Define protocol and create a class that conforms to protocol - Define our text validation types