Swift 3 Protocol-Oriented Programming - Second Edition

Build fast and powerful applications with the power of protocol-oriented programming
Preview in Mapt

Swift 3 Protocol-Oriented Programming - Second Edition

Jon Hoffman

1 customer reviews
Build fast and powerful applications with the power of protocol-oriented programming

Quick links: > What will you learn?> Table of content> Product reviews

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.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Swift 3 Protocol-Oriented Programming - Second Edition Book Cover
Swift 3 Protocol-Oriented Programming - Second Edition
$ 31.99
$ 22.40
Swift Functional Programming - Second Edition Book Cover
Swift Functional Programming - Second Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $32.98
Add to Cart

Book Details

ISBN 139781787129948
Paperback218 pages

Book Description

One of the most important additions to the new features and capabilities of the Swift programming language was an overhaul of Protocols. Protocol-oriented programming and first class value semantics have now become two incredibly powerful concepts at the heart of Swift’s design.

This book will help you understand the difference 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 solid knowledge of the different types that can be used in Swift and the differences between value and reference types. You will be taught how to utilize the advanced features of protocol-oriented programming to boost the performance of your applications.

By the end of the book, you will have a thorough understanding of protocol-oriented programming and how to utilize it to build powerful, practical applications.

Table of Contents

Chapter 1: Object-Oriented and Protocol-Oriented Programming
What is object-oriented programming?
Requirements for the sample code
Swift as an object-oriented programming language
Drawbacks to object-oriented design
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 2: Our Type Choices
The class
The structure
Access controls
The enumerations
The tuple
Protocols
Value and reference types
Recursive data types for reference types only
Inheritance for reference types only
Swift's built-in data types and data structures
Summary
Chapter 3: Catching Our Errors
Using the guard statement
Error handling
Error handling with return values
Error handling with do-catch
Using the defer statement
When to use error handling
Summary
Chapter 4: All About 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 and developing with protocols
Summary
Chapter 5: Lets Extend Some Types
Defining an extension
Protocol extensions
Text validation
Summary
Chapter 6: Working with Generics
Generic functions
Type constraints with generics
Generic types
Associated types
Generics in a protocol-oriented design
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
Calculator application
Summary

What You Will Learn

  • Understand the difference between object-oriented programming and protocol-oriented programming
  • Explore the different types that Swift offers and what pitfalls to avoid
  • Error handling with do-try-catch block
  • Delve into Generics and Generic programming
  • Implement several design patterns in a protocol-oriented way
  • How to design applications by prioritizing the protocol first and the actual type second

Authors

Table of Contents

Chapter 1: Object-Oriented and Protocol-Oriented Programming
What is object-oriented programming?
Requirements for the sample code
Swift as an object-oriented programming language
Drawbacks to object-oriented design
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 2: Our Type Choices
The class
The structure
Access controls
The enumerations
The tuple
Protocols
Value and reference types
Recursive data types for reference types only
Inheritance for reference types only
Swift's built-in data types and data structures
Summary
Chapter 3: Catching Our Errors
Using the guard statement
Error handling
Error handling with return values
Error handling with do-catch
Using the defer statement
When to use error handling
Summary
Chapter 4: All About 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 and developing with protocols
Summary
Chapter 5: Lets Extend Some Types
Defining an extension
Protocol extensions
Text validation
Summary
Chapter 6: Working with Generics
Generic functions
Type constraints with generics
Generic types
Associated types
Generics in a protocol-oriented design
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
Calculator application
Summary

Book Details

ISBN 139781787129948
Paperback218 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Swift Functional Programming - Second Edition Book Cover
Swift Functional Programming - Second Edition
$ 35.99
$ 25.20
Swift 4 Programming Cookbook Book Cover
Swift 4 Programming Cookbook
$ 35.99
$ 25.20
Mastering Django: Core Book Cover
Mastering Django: Core
$ 39.99
$ 28.00
Mastering Swift 3 Book Cover
Mastering Swift 3
$ 35.99
$ 25.20
TypeScript: Modern JavaScript Development Book Cover
TypeScript: Modern JavaScript Development
$ 69.99
$ 49.00
Core Data iOS Essentials Book Cover
Core Data iOS Essentials
$ 26.99
$ 18.90