Skip to content

Instantly share code, notes, and snippets.

@wotjd
Created January 10, 2023 11:14
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 wotjd/d3ce8de43e0f7d4c02af7b9d4926c17d to your computer and use it in GitHub Desktop.
Save wotjd/d3ce8de43e0f7d4c02af7b9d4926c17d to your computer and use it in GitHub Desktop.
protocol AProtocol {
func callAsFunction()
}
class AClass: AProtocol {
func callAsFunction() { print("hi there") }
}
let a: any AProtocol = AClass()
a() // prints "hi there"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment