We are trying to add an action to a user interface element. Consider the options that Xcode offers us if we try to connect a control from our interface builder file to our view controller class:

Like the method you use, Interface Builder asks us a few things.
- The interface designer knows which control is the sender (where we initiated the drag and drop Ctrl + ... this matches your
self.refreshControl , which we call addTarget ). - The interface designer knows which class is the target (we Ctrl + drag it).
- The interface designer asks for the name of the method we are going to create. In your case, you chose this when you wrote a method.
- The interface designer asks how to pass the sender. It gives us, in the case of a button, the option
AnyObject (default) or UIButton . In the case of UIRefreshControl parameters will be AnyObject or UIRefreshControl . This is passed as the sender object. - The interface designer asks us for what events this method should be called (as the
addTarget method addTarget ).
And finally, the Interface builder asks us which arguments should be passed:

Here we have three options.
We cannot pass any arguments, in which case we will have a method that looks like this:
func myFunc() { }
Or we can pass the "sender", in which case the method will look like this:
func myFunc(sender: AnyObject) { }
But the type of sender will change depending on what we are actually trying to send.
Or we could pass the sender and the type of event (useful if multiple events are bound to the same method):
func myFunc(sender: AnyObject, forEvent event: UIEvent) { }
If you do this through the constructor interface, we will also have @IBAction at the beginning, but this is not what we do in your example.
Now, if it was Objective-C, our method would look something like this:
- (void)myFunc:(id)sender { }
And Objective-C does not support overloading, so it will not allow another function in the same class to look like this:
- (void)myFunc:(BOOL)foo { }
You cannot have two methods with the same name.
Swift, however, supports method overloading, and thus the same class can have both of the following methods:
func myFunc(foo: AnyObject) { } func myFunc(foo: Bool) { }
These are completely different methods in Swift's eyes and are wonderful.
However, your code only has the latter. A method called myFunc that takes a Bool argument.
When you try to add the addTarget: Swift method, it looks for a method with the name you gave it ( myFunc: , which can take the UIRefreshControl argument. He cannot find overload.
Effectively, the error you get is the same as this error:

The fact is that Swift cannot find a method called myFunc: which can take an argument of UIRefreshControl .