We still use string literals to define the properties of an event. That is something I would like to change in this episode. The Journey enum defines the list of events the API supports. We take a similar approach for the properties of an event.
Subscribe to Cocoacasts Plus to watch this episode.
Building Type-Safe APIs in Swift
Defining Properties
by Bart Jacobs in Programming
Swift 5
Xcode 14
iOS 16
Building Type-Safe APIs in Swift
- 
      
1 Eliminating Stringly Typed Code
06:31
 
- 
      
      
08:21
 
- 
      
3 Defining Properties
06:22
 
- 
      
      
05:30
 
- 
      
5 Decoupling the Analytics Library
09:50
 
- 
      
7 Looking Beyond Code Coverage
09:39
 
- 
      
      
08:23