Swift Memory Leaks Tutorial App
I changed var captain : Captain
to unowned var captain : Captain
. Alternately, weak var captain : Captain
would have worked, but I didn't want to make captain an optional when it was not in the starter code.
lazy var roster: () -> String = { [unowned self] in
var list = ""
for crewMember in self.crewMembers
{
list += crewMember + " "
}
return list + "\n"
}