March 2020
Intermediate to advanced
392 pages
10h 10m
English
Now that we have our response models ready, we can connect them to the models behind them.
Create the models by following these steps:
init(user: User, addresses: [AddressResponse]? = nil) { self.id = user.id self.firstname = user.firstname self.lastname = user.lastname self.email = user.email self.addresses = addresses }
The function takes in a user and, optionally, addresses to assign them to its properties.
init(_ address: Address) { self.id = address.id self.street = address.street self.city = address.city self.zip = address.zip self.userId = address.userId ...Read now
Unlock full access