Skip to content

Instantly share code, notes, and snippets.

@amichnia
Created February 16, 2019 13:46
Show Gist options
  • Save amichnia/56287b0d6ae31f2fb6887225e18d50f8 to your computer and use it in GitHub Desktop.
Save amichnia/56287b0d6ae31f2fb6887225e18d50f8 to your computer and use it in GitHub Desktop.
// Somewhere in the wild west
import MyFramework
...
// This should work
let publicClass = MyPublicClass()
publicClass.doSomethingWithPrivateClass()
...
// This should not be possible, nor even compile,
// as it should not be able to see MyPrivateClass !!!
let privateClass = MyPrivateClass()
privateClass.doSomethingInternal(withSecretAttribute: 13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment