In Xcode, how do you set the background of a UIButton as an image? Or, how can you set a background gradient in the UIButton?
UIButton
Code for background image of a Button in Swift 3.0
buttonName.setBackgroundImage(UIImage(named: "facebook.png"), for: .normal)
Hope this will help someone.