Skip to content

Instantly share code, notes, and snippets.

@MathVasc
Last active June 8, 2020 18:01
Show Gist options
  • Select an option

  • Save MathVasc/d2ca0db94ffb21cfae5c3bda37977fcc to your computer and use it in GitHub Desktop.

Select an option

Save MathVasc/d2ca0db94ffb21cfae5c3bda37977fcc to your computer and use it in GitHub Desktop.
Selectors
/*
An unsafe - and not recommended - way
to get the selector is using a String.
*/
let selector: Selector = Selector(("SomeClass.someMethodName"))
/*
A safe - and recommended - way
to get the selector is using the compiled method name.
*/
let selector: Selector = #selector(SomeClass.someMethodName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment