Skip to content

Instantly share code, notes, and snippets.

@efthemiosprime
Created July 22, 2017 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save efthemiosprime/f1ba6eb258ff8592f5237db241f677f7 to your computer and use it in GitHub Desktop.
Save efthemiosprime/f1ba6eb258ff8592f5237db241f677f7 to your computer and use it in GitHub Desktop.
what's wrong
class Employee {
var manager: Employee?
var reports: [Employee] = []
}
let hulio = Employee()
hulio.reports = [Employee(), Employee(), Employee()]
hulio.reports.forEach{ $0.manager = hulio}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment