I’m lost as to what the colleague’s computed property does in the Mediator wrapper class. It says in your book that is “uses a filter to find colleagues from colleagueWrappers that have already been released and then returns an array of non-nil colleagues”
What has been released though? For reference, I mean this computer property:
public var colleagues: [ColleagueType] {
var colleagues: [ColleagueType] = []
colleagueWrappers = colleagueWrappers.filter {
guard let colleague = $0.colleague else { return false }
colleagues.append(colleague)
return true
}
return colleagues
}
An explanation as to what the colleague wrapper class does would be really helpful too, it doesn’t really explain in the book what its purpose is.