Question: When defining an IBAction, there's an option for Anyobject and UIButton, both works, what's the difference?

Answer: 
Yes, both works. The difference is just that by declaring it to a button, you get a typecasted reference as UIButton instead of AnyObject (or id in Objective-C). If you did not do that you will have to do it manually inside the code.

You should prefer leaving it to AnyObject in case the action has some code you would like to call from anywhere else, rather than just the button action.

For example a refresh button, you might have to do a refresh programatically. If you have set your action parameter to UIButton, you have to send an UIButton (but why??? You are doing it programatically, right?). Whereas if it is AnyObject, you can send 'self'. Which will also make you distinguish whether the refresh was done on action or programatically.

Hope that explains.
Sorry for no code. I am not into Swift coding much. Edits are welcome.

**EDIT**

So, even if it is AnyObject, it does have your UIButton properties. Just type cast it to use them.
If it's anyObject, then it doesn't have any of UIButton's properties. When you click the button and the IBAction fires, sender contains information about the thing that triggered the action. 

For example, for a UIButton, you might want to query the UIButton's text when the IBAction triggers. 

However, in a situation where the IBAction is connected to two different UI controls, let's say, a button and a slider, querying the sender when it's of type UIButton (while the triggering UI element is the UISlider) will crash the program. If you have AnyObject, you'll be able to test if the sender is a UIButton or a UISlider, and then do something. 

In general, if you don't care about sender, leave it blank, so people reading your code will know that you aren't using sender for anything.