With the above setup, we can easily end up in undefined situations when loadItems is called multiple times before a pending request has been completed (we might include a search control, or a pull-to-refresh mechanism, for example, which can result in many requests).
var model: StatusCellModel! {
didSet {
statusLabel.text = model.statusText
usernameLabel.text = model.usernameText
commentIconImageView.image = model.commentIcon
favoriteButton.setTitle(model.favoriteButtonTitle, for: .normal)
}
}