Sorry for these questions
I have 4 questions about Selector in swift.
FIRST Question
I am wondering what is the proper way to use selector in swift
closeBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Stop, target: self, action: Selector("closeBarButtonItemClicked:"));
VS
closeBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Stop, target: self, action: "closeBarButtonItemClicked:");
Should we use Selector("methodName:") or "methodName:" right away?
Both way works but which one is the correct way?
SECOND Question
How do we call a function with a parameter in Swift? Let's say I want to call a function like this
func methodName(parameterOne : String, parameterTwo: String)
THIRD Question
How do we call a type method using Selector in swift? is it even possible at all?
class SomeClass {
class func someTypeMethod() {
// type method implementation goes here
}
}
FOURTH Question
What is the purpose of that colon behind the function name in Selector?