Swift 4 Protocol-Oriented Programming - Third Edition

Build fast and powerful applications by harnessing the power of protocol-oriented programming in Swift 4
Preview in Mapt

Swift 4 Protocol-Oriented Programming - Third Edition

Jon Hoffman

Build fast and powerful applications by harnessing the power of protocol-oriented programming in Swift 4
Mapt Subscription
FREE
$29.99/m after trial
eBook
$22.40
RRP $31.99
Save 29%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$22.40
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Swift 4 Protocol-Oriented Programming - Third Edition Book Cover
Swift 4 Protocol-Oriented Programming - Third Edition
$ 31.99
$ 22.40
Swift 3 Protocol-Oriented Programming - Second Edition Book Cover
Swift 3 Protocol-Oriented Programming - Second Edition
$ 31.99
$ 22.40
Buy 2 for $35.00
Save $28.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781788470032
Paperback210 pages

Book Description

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 book will help you understand the differences between object-oriented programming and protocol-oriented programming. It will demonstrate 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 book, you will have a thorough understanding of protocol-oriented programming and how to utilize it to build powerful and practical applications.

Table of Contents

Chapter 1: Starting with the Protocol
Protocol syntax
Protocol inheritance
Protocol composition
Using protocols as a type
Polymorphism with protocols
Type casting with protocols
Associated types with protocols
Delegation
Designing with protocols
Protocols in the Swift standard library
Summary
Chapter 2: Our Type Choices
Classes
Structures
Access controls
Enumerations
Tuples
Protocols
Value and reference types
Recursive data types for reference types only
Inheritance for reference types only
Dynamic dispatch
Swift's built-in types
Copy-on-write
Summary
Chapter 3: Extensions
Defining an extension
Protocol extensions
Text validation
Extensions with the Swift standard library
Conforming to the Equatable protocol
Summary
Chapter 4: Generics
Generic functions
Type constraints with Generics
Generic types
Associated types
Generic subscripts
Copy-on-write
Generics in a protocol-oriented design
Generics in the Swift standard library
Summary
Chapter 5: Object-Oriented Programming
What is object-oriented programming?
Requirements for the sample code
Swift as an object-oriented programming language
Issues with the object-oriented design
Summary
Chapter 6: Protocol-Oriented Programming
Requirements for the sample code
Swift as a protocol-oriented programming language
Summarizing protocol-oriented programming and object-oriented programming
Differences between object-oriented programming and protocol-oriented programming
The winner is...
Summary
Chapter 7: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary
Chapter 8: Case Studies
Logging service
Data access layer
Summary

What You Will Learn

  • Understand the differences between object-oriented programming and protocol-oriented programming
  • Explore the different types that Swift offers and what pitfalls to avoid
  • Delve into generics and generic programming
  • Learn how to implement Copy-On-Write within your custom types
  • Implement several design patterns in a protocol-oriented way
  • Design applications by prioritizing the protocol first and the implementation types second

Authors

Table of Contents

Chapter 1: Starting with the Protocol
Protocol syntax
Protocol inheritance
Protocol composition
Using protocols as a type
Polymorphism with protocols
Type casting with protocols
Associated types with protocols
Delegation
Designing with protocols
Protocols in the Swift standard library
Summary
Chapter 2: Our Type Choices
Classes
Structures
Access controls
Enumerations
Tuples
Protocols
Value and reference types
Recursive data types for reference types only
Inheritance for reference types only
Dynamic dispatch
Swift's built-in types
Copy-on-write
Summary
Chapter 3: Extensions
Defining an extension
Protocol extensions
Text validation
Extensions with the Swift standard library
Conforming to the Equatable protocol
Summary
Chapter 4: Generics
Generic functions
Type constraints with Generics
Generic types
Associated types
Generic subscripts
Copy-on-write
Generics in a protocol-oriented design
Generics in the Swift standard library
Summary
Chapter 5: Object-Oriented Programming
What is object-oriented programming?
Requirements for the sample code
Swift as an object-oriented programming language
Issues with the object-oriented design
Summary
Chapter 6: Protocol-Oriented Programming
Requirements for the sample code
Swift as a protocol-oriented programming language
Summarizing protocol-oriented programming and object-oriented programming
Differences between object-oriented programming and protocol-oriented programming
The winner is...
Summary
Chapter 7: Adopting Design Patterns in Swift
What are design patterns?
Creational patterns
Structural design patterns
Behavioral design patterns
Summary
Chapter 8: Case Studies
Logging service
Data access layer
Summary

Book Details

ISBN 139781788470032
Paperback210 pages
Read More

Read More Reviews

Recommended for You

Swift 3 Protocol-Oriented Programming - Second Edition Book Cover
Swift 3 Protocol-Oriented Programming - Second Edition
$ 31.99
$ 22.40
Protocol-Oriented Programming with Swift Book Cover
Protocol-Oriented Programming with Swift
$ 31.99
$ 22.40
Test-Driven iOS Development with Swift 4 - Third Edition Book Cover
Test-Driven iOS Development with Swift 4 - Third Edition
$ 31.99
$ 22.40
Salesforce CRM - The Definitive Admin Handbook (Third Edition) Book Cover
Salesforce CRM - The Definitive Admin Handbook (Third Edition)
$ 32.99
$ 23.10
Mastering Swift 4 - Fourth Edition Book Cover
Mastering Swift 4 - Fourth Edition
$ 35.99
$ 25.20
D3.js 4.x Data Visualization - Third Edition Book Cover
D3.js 4.x Data Visualization - Third Edition
$ 31.99
$ 22.40