Skip to content

Instantly share code, notes, and snippets.

@mikebuss
Created November 4, 2018 01:00
Show Gist options
  • Save mikebuss/2321ab49c397d1d03f116870906562d3 to your computer and use it in GitHub Desktop.
Save mikebuss/2321ab49c397d1d03f116870906562d3 to your computer and use it in GitHub Desktop.
lazy-var-class-function.swift
class TestClass {
lazy var players = TestClass.initialPlayers()
class func initialPlayers() -> [String] {
var players = ["John Doe"]
return players
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment