For Swift 2.0, this was my solution to get the following effect...
(the actual values may be different, depending on your situation)
let captureButton = UIButton()
captureButton.setTitle("CAPTURE DETAILS", forState: .Normal)
captureButton.frame = CGRectMake(0, 0, 200, 95)
captureButton.addTarget(self, action: Selector("showCaptureDetailsForm:"), forControlEvents: .TouchUpInside) // *** See update below for Swift 2.2 syntax
captureButton.setBackgroundImage(UIImage(named: "blueTopRight"), forState: .Normal)
let rightBarButton = UIBarButtonItem()
rightBarButton.customView = captureButton
let negativeSpacer = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FixedSpace, target: nil, action: nil)
negativeSpacer.width = -25;
self.navigationItem.setRightBarButtonItems([negativeSpacer, rightBarButton ], animated: false)
Swift 2.2 UPDATE:
For Swift 2.2, the action: Selector
method has changed, and should be typed as follows
captureButton.addTarget(self, action: #selector(YourViewController.showCaptureDetailsForm(_:)), forControlEvents: .TouchUpInside)