Skip to content

Instantly share code, notes, and snippets.

@dataxpress
Created October 8, 2014 14:59
Show Gist options
  • Save dataxpress/a61f3feedb96ae6178cf to your computer and use it in GitHub Desktop.
Save dataxpress/a61f3feedb96ae6178cf to your computer and use it in GitHub Desktop.
type of param but no name
// Playground - noun: a place where people can play
import Foundation
func myFunc(String){
// no way to access the value of the string passed in
}
// myFunc() // error
myFunc("Potato!") // works
/* I suppose it's useful for this situation: */
class MyClass{
init (){
NSNotificationCenter.defaultCenter().addObserver(self, selector: "someNotification:", name: "SomeNotificationName", object: nil)
}
func someNotification(NSNotification)
{
// this func is required to take an NSNotification but we explicitly don't care about the object being passed in
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment