Skip to content

Instantly share code, notes, and snippets.

@yannxou
Created November 6, 2015 11:15
Show Gist options
  • Select an option

  • Save yannxou/14866feb2762cecbf068 to your computer and use it in GitHub Desktop.

Select an option

Save yannxou/14866feb2762cecbf068 to your computer and use it in GitHub Desktop.
Swift: Declaring var with private setter
// Var only setteable from private access level but with internal access (default) on its getter
private(set) var info = ""
// Var only setteable from private access level but with public access on its getter
public private(set) var info = ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment