Swift 4 с customType:
let button = UIButton(frame: aRectHere) let buttonImage = UIImage(named: "imageName") button.setImage(buttonImage?.withRenderingMode(.alwaysTemplate), for: .normal) button.tintColor = .white