Index
A
- abstract base class / The abstract base class
- abstract factory pattern
- about / The abstract factory pattern
- using / Using the abstract factory pattern
- adapter pattern
- about / The adapter pattern
- using / Using the adapter pattern
- protocol, defining / The basics
- classes / The classes to adapt
- classes, using as adapters / Using classes as adapters
- extensions, leveraging / Leveraging extensions
- overview / The adapter pattern in a nutshell
- anti-patterns, Dependency Injection
- about / DI anti-patterns
- Control Freak / Control Freak
- Bastard Injection / Bastard Injection
- Service Locator / Service Locator
- anti-patterns, UIViewController
- about / UIViewController anti-patterns
- view instantiation / Early view instantiation
- view access, in initializer / Early view access in initializer
- view access, in properties / Early view access in properties
- arrays
- about / Arrays
- mutability / Mutability and operations
- operations / Mutability and operations
- iterating / Iterating, mapping, and reducing
- mapping / Iterating, mapping, and reducing
- reducing / Iterating, mapping, and reducing
- assertions / Assertions
- associated types
- Async code
- testing / Testing Async code
- automated delivery
- with fastlane / Using fastlane for automated delivery
- Automatic Reference Counting (ARC)
- about / ARC – what is that?
- value types / Value types
- strong references / Strong references
- weak references / Weak references
- unowned references / Unowned references
- Automatic Storyboard Injection / Automatic Storyboard Injection
B
- basic types, Swift
- about / Swift basic types
- ranges / Working with ranges
- errors, catching / Throwing and catching errors
- errors, throwing / Throwing and catching errors
- Bastard Injection anti-pattern / Bastard Injection
- Binding protocol
- implementing / Implementing the Binding protocol
- boxing-based type erasure
- about / Boxing-based type erasure
- abstract base class / The abstract base class
- private box / The private box
- public wrapper / The public wrapper
- bridge pattern
- about / The bridge pattern
- anatomy / Anatomy of the bridge pattern
- using / Using the bridge pattern
- bridging header / Importing Objective-C in Swift
- builder pattern
- about / The builder pattern, The builder pattern in a nutshell
- model, building / Model building
- metaprogramming, with Sourcery / Going further: metaprogramming with Sourcery
C
- callbacks
- about / Callbacks and closures
- issues / The issue with callbacks
- card reader, with state pattern
- about / The card reader
- enums, using / Using enums
- maintainability, refactoring / Refactoring for maintainability
- protocol, extracting / Extracting a single protocol
- single protocol, extracting / Extracting a single protocol
- states, implementing through structs / Implementing all states through structs, and moving the logic
- logic, moving / Implementing all states through structs, and moving the logic
- context object, refactoring / Refactoring the context object
- child view controllers
- about / Composition and child view controllers
- adding / Adding child view controllers
- removing / Removing child view controllers
- Choose a License
- reference / The LICENSE.md file
- classes / Classes and structs, Classes
- closure-based type erasure / Closure-based type erasure
- closures
- about / Closures, functions, and currying, Callbacks and closures
- using, as callbacks / Using closures as callbacks
- weak, using / Using weak and unowned
- unowned, using / Using weak and unowned
- features / Callbacks and closures
- memory management / Closures and memory management
- Cocoa design patterns, Swift
- about / Cocoa design patterns in Swift
- delegation / Delegation
- lazy initialization / Lazy initialization
- composite pattern
- about / The composite pattern
- tests and suites, representing / Using the composite pattern to represent tests and suites
- Composition Root / Composition Root
- composition view controllers
- concurrency
- mastering, with dispatch / Mastering concurrency with Dispatch
- queues / Tasks and queues
- tasks / Tasks and queues
- concurrent queue / Tasks and queues
- conditional conformance / Generics, conditional conformance, and associated types, Conditional conformance
- container types
- about / Container types
- arrays / Arrays
- dictionary / Dictionaries
- continuous integration
- about / Continuous integration
- Travis CI / Travis CI
- GitLab / GitLab.com
- Contributor Covenant
- reference / The CODE_OF_CONDUCT.md file
- Control Freak anti-pattern
- about / Control Freak
- stable dependencies / Stable and volatile dependencies
- volatile dependencies / Stable and volatile dependencies
- controllers
- refactoring / Refactoring controllers
- view controllers / View controllers
- model controllers / Model controllers
- implementing / The Controller
- convenience initializers / Advanced usage of the factory method pattern
- currying
- about / Closures, functions, and currying, Currying
- using / Currying
- cycles
- about / Leaks, cycles, and dangling references
- leaks / Leaking with cycles
D
- dangling references / Leaks, cycles, and dangling references, Dangling references
- data binding
- with Model-View-ViewModel (MVVM) pattern / MVVM and data binding
- Observable class, implementing / Implementing the Observable class
- Binding protocol, implementing / Implementing the Binding protocol
- two-way binding, on UITextField / Two-way binding on UITextField
- Decodable object
- responses, parsing / Parsing responses with Decodable
- decorator pattern
- about / The decorator pattern
- using / Using a decorator
- implementing / Going further with decorator
- overview / Decoration in a nutshell
- delegation
- about / Delegation
- using / Using delegation
- implementing / Implementing delegation
- Dependency Injection
- about / Dependency Injection, a primer, What is Dependency Injection?
- definition / Definition
- reference / Definition
- advantages / Why DI is useful
- separation of concerns / Separation of concerns
- testability / Testability
- with examples / Dependency Injection by example, Four ways to use Dependency Injection (with examples)
- Constructor Injection / Constructor Injection
- Property Injection / Property Injection
- Method Injection / Method Injection
- Ambient Context / Ambient Context
- binding / Bind the dependencies
- Composition Root / Composition Root
- anti-patterns / DI anti-patterns
- Dependency Injection Container
- using / Using a Dependency Injection Container
- need for / Why you should use a DI Container
- Typhoon framework / The Typhoon framework
- Swinject / Swinject
- Automatic Storyboard Injection / Automatic Storyboard Injection
- dictionary
- about / Dictionaries
- initialization / Initialization and mutability
- mutability / Initialization and mutability
- mapping / Iterating, mapping, and reducing
- reducing / Iterating, mapping, and reducing
- iterating / Iterating, mapping, and reducing
- dispatch
- concurrency, mastering / Mastering concurrency with Dispatch
- synchronization / Synchronization with Dispatch
- thread safety, through serial queue / Thread safety through serial queues
- execution, organizing with groups / Organizing execution with groups and semaphores
- execution, organizing with semaphores / Organizing execution with groups and semaphores
- documentation
- about / Documenting Swift
- Markdown language / The Markdown language
- formatting / Rich content
- additional callouts / Additional callouts
- structural annotations / Structural annotations
- HTML docs, generating / Generating HTML docs
- documentation block
- about / The anatomy of a documentation block
- summary / The anatomy of a documentation block
- discussion / The anatomy of a documentation block
- returned values / The anatomy of a documentation block
- parameters / The anatomy of a documentation block
- thrown errors / The anatomy of a documentation block
- dummy test double / Dummy test double: when we don't need to test the collaborator
E
- Encodable object
- requests, sending / Sending requests with Encodable
- enums
- about / Enums
- simple enums / Simple enums
- methods, adding / Adding methods
- values, associating / Associating values
- generic enums / Generic enums
- raw type enums / Raw type enums
- state of light, switching / Switching the state of light
- errors
- catching / Throwing and catching errors
- throwing / Throwing and catching errors
- event-based programming, with observer pattern
- about / Event-based programming
- NotificationCenter, using / Using NotificationCenter
- Key-Value Observing, using / Using Key-Value Observing
- observation, with Swift / Observation using pure Swift
F
- facade pattern
- about / The facade pattern and proxy pattern, The facade pattern
- network cache, building / Building a network cache with the facade pattern
- factory method pattern
- about / The factory method pattern
- using / Using the factory method pattern
- advanced usage / Advanced usage of the factory method pattern
- implementing / Wrapping up
- default implementations / Default implementations
- inheritance / Inheritance
- protocol extensions / Protocol extensions
- checklist / Checklist for using the factory method pattern
- fake test double / Fake test double: a simplified collaborator
- fastlane
- using, for automated delivery / Using fastlane for automated delivery
- reference / Using fastlane for automated delivery, Using Travis to upload on tags
- using / Getting started with fastlane
- executing / Your first lane
- beta version, deploying / Fastlane beta
- Travis, using to upload on tags / Using Travis to upload on tags
- flyweight pattern
- about / The flyweight pattern
- shopping list, creating / A shopping list using the flyweight pattern
- framework
- extracting / Extracting and sharing a framework, Extracting a framework
- sharing / Extracting and sharing a framework
- code, refactoring / Refactoring your code
- Functional Reactive Programming (FRP) / Reactive programming
- functions
- about / Closures, functions, and currying
- tuples, using / Using tuples in functions
- futures / Futures and promises, Futures and promises under the hood
G
- generalized existentials
- reference / Associated types
- generic enums / Generic enums
- generics
- about / Tuples, type aliases, and generics, Generics, Generics, conditional conformance, and associated types
- functions / Generic functions
- types / Generic types
- with protocols / Generics, protocols, and associated types
- with associated types / Generics, protocols, and associated types
- generics, Objective-C
- about / Lightweight generics in Objective-C
- typed NSArray*, using / Using typed NSArray* in Objective-C
- generic classes / Generic classes in Objective-C
- generics-based programming
- about / Generics-based programming
- functions / Generic functions
- implementing / Generic everything
- generic type / Elements of type erasure
- GitHub Pages
- HTML docs, publishing / Publishing to GitHub Pages
- GitLab
- about / GitLab.com, Some final words on Travis and GitLab
- reference / GitLab.com
- building / Building and testing
- testing / Building and testing
- SwiftLint, adding / Adding a linter, SwiftLint
- Google Analytics for Firebase / Using the adapter pattern
- Google Promises
- about / Google Promises
- all function / Google Promises
- any function / Google Promises
- always function / Google Promises
- await function / Google Promises
- recover function / Google Promises
- retry function / Google Promises
- Grand Central Dispatch (GCD) / Mastering concurrency with Dispatch
- groups
- execution, organizing / Organizing execution with groups and semaphores
- using / Using groups
H
- Hollywood Principle / Definition
- HTML docs
- generating / Generating HTML docs
- publishing, to GitHub Pages / Publishing to GitHub Pages
- HTTP
- with URLSession / HTTP with URLSession
J
- Jazzy
- about / Generating HTML docs
- reference / Generating HTML docs
K
- Key-Value Observing (KVO)
- about / The observer pattern, Reactive programming
- using / Using Key-Value Observing
- using, with Objective-C APIs / Using KVO with existing Objective-C APIs
- using, with Swift / Using KVO with Swift
L
- lazy initialization / Lazy initialization
- leaks
- about / Leaks, cycles, and dangling references
- with cycles / Leaking with cycles
- simple leak / A simple leak
- fixing / Fixing the leak
- weak, using / Using weak
- unowned, using / Using unowned
- library package
- creating / Creating a library package
- features, adding / Adding features to the library
- targets, adding / Adding more targets
M
- manual reference counting
- using / Using and misusing manual reference counting
- misusing / Using and misusing manual reference counting
- memory leaks / Memory leaks
- dangling pointers / Dangling pointers
- many-to-one communication / Delegation
- Markdown language / The Markdown language
- Massive View Controller syndrome / The controller layer
- memento pattern
- about / The memento pattern
- components / Components of the memento pattern
- Memento / Components of the memento pattern
- Originator / Components of the memento pattern
- CareTaker / Components of the memento pattern
- implementing / Implementing the memento pattern
- using / Using the memento pattern
- memory debugging
- about / Memory debugging
- project, configuring / Configuring your project
- memory graph hierarchy tool
- memory leak / Leaks, cycles, and dangling references
- memory management
- with closures / Closures and memory management
- metaprogramming
- with Sourcery / Going further: metaprogramming with Sourcery
- Mixpanel / Using the adapter pattern
- mocks
- for testing / Advanced testing with mocks, spy, and others
- mock test double / Mock test double: asserting collaboration
- Model-View-Controller (MVC) pattern
- about / A refresher on MVC
- theory / The theory behind the MVC pattern
- Model classes / The theory behind the MVC pattern
- View classes / The theory behind the MVC pattern
- Controller classes / The theory behind the MVC pattern
- example / A pure MVC example
- model layer / The model layer
- view layer / The view layer
- controller layer / The controller layer
- Model-View-ViewModel (MVVM) pattern
- about / Basics of the MVVM pattern
- Model / Basics of the MVVM pattern
- View / Basics of the MVVM pattern
- ViewModel / Basics of the MVVM pattern, ViewModel
- MVC, refactoring / Refactoring MVC into MVVM
- model layer / Model
- view layer / View
- benefits / Benefits and drawbacks of MVVM
- drawbacks / Benefits and drawbacks of MVVM, Drawbacks
- enhanced testing / Enhanced testing
- improved reusability / Improved reusability
- data binding / MVVM and data binding
- model controllers
- using / Using model controllers
- model layer
- about / The model layer
- controllers, refactoring / Refactoring controllers
N
- node.js request library / Creating a library package
- NSCopying
- with Sourcery / Going further – NSCopying with Sourcery
- implementing, automatically / Implementing NSCopying automatically
- mutable objects, implementing / Implementing mutable objects
- NSMutableCopying, implementing automatically / Implementing NSMutableCopying automatically
- nullability
- in Objective-C / Nullability and optionals in Objective-C
- NS_ASSUME_NON_NULL_BEGIN, using / Using NS_ASSUME_NON_NULL_BEGIN and NS_ASSSUME_NON_NULL_END
- NS_ASSSUME_NON_NULL_END, using / Using NS_ASSUME_NON_NULL_BEGIN and NS_ASSSUME_NON_NULL_END
- nullable, using / Using nullable, nonnull, _Nullable, and _Nonnull
- nonnull, using / Using nullable, nonnull, _Nullable, and _Nonnull
- _Nullable, using / Using nullable, nonnull, _Nullable, and _Nonnull
- _Nonnull, using / Using nullable, nonnull, _Nullable, and _Nonnull
O
- Objective-C
- Swift, exposing / Exposing Swift to Objective-C
- optionals / Nullability and optionals in Objective-C
- nullability / Nullability and optionals in Objective-C
- naming / Naming, renaming, and refining Objective-C for Swift
- renaming / Naming, renaming, and refining Objective-C for Swift
- refining / Naming, renaming, and refining Objective-C for Swift
- names, setting from Swift / Setting Objective-C names from Swift
- Swift names, setting / Setting Swift names from Objective-C
- generics / Lightweight generics in Objective-C
- Objective-C project
- setting up / Setting up your project
- importing, in Swift / Importing Objective-C in Swift
- Observable class
- implementing / Implementing the Observable class
- Observables
- using, with ViewModels / Using Observables with ViewModels
- observer pattern
- about / The observer pattern
- event-based programming / Event-based programming
- observation, using / Using observation
- open source project, maintaining tips
- README.md file / The README.md file
- LICENSE.md file / The LICENSE.md file
- CODE_OF_CONDUCT.md file / The CODE_OF_CONDUCT.md file
- issues / Issues, Pull Requests, and more
- pull requests / Issues, Pull Requests, and more
- feature addition / No is temporary, yes is forever
P
- private box / The private box
- promise frameworks
- PromiseKit / PromiseKit
- Google Promises / Google Promises
- promises / Futures and promises, Futures and promises under the hood
- protocol-oriented programming
- about / Getting started with protocol-oriented programming, Protocol-oriented programming
- protocols, defining / A refresher on protocols
- generics / Generics, conditional conformance, and associated types
- conditional conformance / Generics, conditional conformance, and associated types
- associated types / Generics, conditional conformance, and associated types
- template pattern / Template pattern with protocol-oriented programming
- protocol extensions
- about / Protocol extensions
- default implementations / Default implementations
- protocols
- about / Protocols
- declaring / Declaring a protocol
- conforming to / Conforming to a protocol
- conformance at declaration / Conformance at declaration
- conformance in extension / Conformance in an extension
- with generics / Generics, protocols, and associated types
- defining / A refresher on protocols
- requirements, adding / Adding requirements to protocols
- value types / Mutation and value types
- mutation / Mutation and value types
- full-fledged types / Protocols are full-fledged types
- Protocol with Associated Types (PATs) / Associated types
- prototype pattern
- about / The prototype pattern
- leveraging / Leveraging the prototype pattern
- NSCopying, with Sourcery / Going further – NSCopying with Sourcery
- implementing / The prototype pattern in a nutshell
- proxy pattern
- about / The facade pattern and proxy pattern
- request/response logging, implementing / Using the proxy pattern to implement request/response logging
- public wrapper / The public wrapper
Q
- queues
- about / Tasks and queues
- serial queue / Tasks and queues
- concurrent queue / Tasks and queues
R
- ranges
- Range / Working with ranges
- ClosedRange / Working with ranges
- as Sequence / Range as Sequence
- reference / Range as Sequence
- raw type enums / Raw type enums
- Reactive Programming (RP)
- about / Reactive programming
- RxSwift / RxSwift
- recommendation engine / A recommendation engine
- reference counting
- history / A brief history of reference counting
- manual reference counting, using / Using and misusing manual reference counting
- manual reference counting, misusing / Using and misusing manual reference counting
- reference counting, semantics
- about / The semantics of reference counting
- retain / Retain
- release / Release
- assign / Assign
- copying / Copying
- Reverse Polish Notation (RPN) / What is an reverse polish notation calculator?
- RPN Calculator app
- testing / Testing an RPN Calculator app, The first test, More tests
- testing, with Test-Driven Development (TDD) / TDD
- about / What is an reverse polish notation calculator?
- implementing / A simple RPN Calculator app
- tests, refactoring / Refactoring the tests
- operations, adding / Adding operations
- TDD code / Learnings from our first TDD code
- RxSwift
- about / RxSwift
- observers / Observables and observers
- observables / Observables and observers
- transformations / Transformations
- schedulers / Schedulers
- asynchronous networking / Asynchronous networking – an example
S
- semaphores
- execution, organizing / Organizing execution with groups and semaphores
- example / Example of a counting semaphore
- serial queue / Tasks and queues
- for thread safety / Thread safety through serial queues
- Service Locator anti-pattern / Service Locator
- singleton pattern
- about / The singleton pattern
- using / Using singletons
- creating / Singletons in a nutshell
- singletons
- testing / Testing singletons
- Smalltalk / Unit testing using XCTest
- Sourcery
- about / Going further: metaprogramming with Sourcery
- metaprogramming / Going further: metaprogramming with Sourcery
- reference / Going further: metaprogramming with Sourcery
- NSCopying / Going further – NSCopying with Sourcery
- Sourcery stencils
- reference / The type erasure pattern – a summary
- spy
- for testing / Advanced testing with mocks, spy, and others
- spy test double / Spy test double: verifying collaboration
- state machines
- about / Using state machines
- using / Using state machines
- state pattern
- about / The state pattern
- card reader / The card reader
- state machines, using / Using state machines
- strategy pattern
- about / The strategy pattern
- components / Components of the strategy pattern
- ice-cream shop example / The ice-cream shop example
- using / Using the strategy pattern
- strong references / Strong references, Leaking with cycles
- structs / Classes and structs, Struct
- stub test double / Stub test double: a predefined collaborator
- SUnit / Unit testing using XCTest
- Swift
- basic types / Swift basic types
- Objective-C project, importing / Importing Objective-C in Swift
- exposing, to Objective-C / Exposing Swift to Objective-C
- Objective-C names, setting / Setting Objective-C names from Swift
- names, setting from Objective-C / Setting Swift names from Objective-C
- classes, renaming / Renaming classes
- methods, renaming / Renaming methods and enum cases
- enum cases, renaming / Renaming methods and enum cases
- Cocoa design patterns / Cocoa design patterns in Swift
- Key-Value Observing (KVO), using / Using KVO with Swift
- reference / Getting started with protocol-oriented programming
- documentation / Documenting Swift
- SwiftLint / Adding a linter, SwiftLint
- Swift Package Manager (SPM)
- Package.swift / Creating a library package
- swURL folder / Creating a library package
- LinuxMain.swift / Creating a library package
- using, with Xcode / Using SPM with Xcode
- about / Adding a linter, SwiftLint
- Swinject
- swURL / Creating a library package
- synchronization
- with dispatch / Synchronization with Dispatch
- system under test (SUT)
- about / Testing in Isolation
- indirect input / Testing in Isolation
- indirect output / Testing in Isolation
T
- tasks / Tasks and queues
- template pattern
- with protocol-oriented programming / Template pattern with protocol-oriented programming
- recommendation engine / A recommendation engine
- summary / Summing up with the template method pattern
- Test-Driven Development (TDD) / Unit testing using XCTest
- test double / Testing in Isolation
- testing
- with mocks / Advanced testing with mocks, spy, and others
- with spy / Advanced testing with mocks, spy, and others
- in isolation / Testing in Isolation
- dummy test double / Dummy test double: when we don't need to test the collaborator
- fake test double / Fake test double: a simplified collaborator
- stub test double / Stub test double: a predefined collaborator
- spy test double / Spy test double: verifying collaboration
- mock test double / Mock test double: asserting collaboration
- testing, tips
- singletons, testing / Testing singletons
- Async code, testing / Testing Async code
- test, executing with cursor / Run only the test with the cursor
- tests, types
- unit tests / The importance of UI testing
- service tests / The importance of UI testing
- UI tests / The importance of UI testing
- third-party dependencies
- adding / Adding third-party dependencies
- thread safety
- through serial queues / Thread safety through serial queues
- transformations, RxSwift
- map / Transformations
- flatMap / Transformations
- scan / Transformations
- filter / Transformations
- merge / Transformations
- zip / Transformations
- Travis CI
- about / Travis CI, Some final words on Travis and GitLab
- projects, configuring / Configuring simple projects
- reference / Configuring simple projects
- complex build scenarios, configuring / Configuring more complex build scenarios
- Swift projects, configuring / Configuring pure Swift projects
- tuples
- about / Tuples, type aliases, and generics, Tuples
- declaring / Declaring tuples
- destructuring / Destructuring tuples
- using, in functions / Using tuples in functions
- two-way binding
- on UITextField / Two-way binding on UITextField
- type aliases / Tuples, type aliases, and generics, Type aliases
- typed NSArray*
- type erasure pattern
- about / The type erasure pattern
- reference / The type erasure pattern, Elements of type erasure
- elements / Elements of type erasure
- closure-based type erasure / Closure-based type erasure
- boxing-based type erasure / Boxing-based type erasure
- summary / The type erasure pattern – a summary
- Typhoon framework
- about / The Typhoon framework
- reference / The Typhoon framework
U
- UIKit
- reference / Adding child view controllers
- UI testing
- with Xcode / UI testing with Xcode
- importance / The importance of UI testing
- recording / Recording a UI test
- writing / Writing UI tests in code
- UITextField
- two-way binding / Two-way binding on UITextField
- UIViewController
- about / UIViewController
- reference / UIViewController
- life cycle / View controller life cycles
- anti-patterns / UIViewController anti-patterns
- unconstrained generics / Generic everything
- unit testing
- with XCTest / Unit testing using XCTest
- of RPN Calculator app / Testing an RPN Calculator app
- assertions / Assertions
- unowned references / Unowned references
- URLSession
- about / HTTP with URLSession
- executing / Making your first call with URLSession
- responses, parsing with Decodable object / Parsing responses with Decodable
- requests, sending with Encodable object / Sending requests with Encodable
V
- value types / Value types
- view controllers
- benefits / Composition and child view controllers
- ViewModels
- Observables, using / Using Observables with ViewModels
- visitor pattern
- about / The visitor pattern
- visitor protocols / Visitable and visitor protocols
- visitable protocols / Visitable and visitor protocols
- contributors / Contributors, thank you notes, and the visitor pattern
- thank you notes / Contributors, thank you notes, and the visitor pattern
- using / Using visitors
W
- weak references / Weak references
X
- Xcode
- Swift Package Manager (SPM), using / Using SPM with Xcode
- UI testing / UI testing with Xcode
- XCTest
- for unit testing / Unit testing using XCTest