On iOS 6 SDK I wrote the following lines of code to display an image inside a button:
NSURL *thumbURL2 = [NSURL URLWithString:@\"http://example.com/thumbs/2.
For swift:
let aButton = UIButton.buttonWithType(UIButtonType.Custom) as UIButton