Skip to content

Instantly share code, notes, and snippets.

Last active December 13, 2015 09:41
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rnapier/4213dc64206b17df6935 to your computer and use it in GitHub Desktop.
Even more shenanigans when self is not required
// MyClass.swift
class MyClass {
func doSomething() {
private func refresh() {
println("I'm the global refresh function.")
// main.swift
// Oh dear, we didn't know that there was an internal private function called refresh...
extension MyClass {
func refresh() {
println("I'm an extension refresh")
// And our refresh() gets called. I wasn't expecting swizzling to happen quite so subltly.
// see also
Copy link

ilyannn commented Dec 13, 2015

Same here... global function names should start with an uppercase letter, instance names with lowercase letter. Can we move on, please :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment