Swift 4 Protocol-Oriented Programming - Third Edition.
Build fast and powerful applications by harnessing the power of protocol-oriented programming in Swift 4 About This Book Leverage the power of protocol-oriented programming in your applications and learn from real-world use cases Create a flexible code base with protocols and protocol extensions Lev...
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing,
2017.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: Starting with the Protocol
- Protocol syntax
- Defining a protocol
- Property requirements
- Method requirements
- Optional requirements
- 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 librarySummary
- 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: GenericsGeneric 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 languageSummarizing protocol-oriented programming and object-oriented programming
- Differences between object-oriented programming and protocol-oriented programming
- Protocol and protocol extensions compared with superclasses
- Implementing vehicle types
- Using value and reference types
- The winner is ...
- Summary
- Chapter 7: Adopting Design Patterns in Swift
- What are design patterns?
- Creational patterns
- The singleton design pattern
- Understanding the problem
- Understanding the solution
- Implementing the singleton patternThe builder design pattern
- Understanding the problem
- Understanding the solution
- Implementing the builder pattern
- The factory method pattern
- Understanding the problem
- Understanding the solution
- Implementing the factory method pattern
- Structural design patterns
- The bridge pattern
- Understanding the problem
- Understanding the solution
- Implementing the bridge pattern
- The facade pattern
- Understanding the problem
- Understanding the solution
- Implementing the facade pattern