将色调颜色设置为swift 3中的图像

我有以下代码,显示uilabel右侧的图像,目前我的uilabel的颜色是黑色,但我想知道如何将图像的颜色更改为绿色

我的代码:

let image:UIImage=UIImage(named:"ic_premium")! let attachment = NSTextAttachment() attachment.image=image attachment.bounds = CGRect(x: 0, y: -3, width: 15, height: 15) let attributedString = NSMutableAttributedString(string: item_empresa[indexPath.item].nombre_emp!) attributedString.append(NSAttributedString(attachment: attachment)) cell.lbl_nombreEmpresa.attributedText = attributedString 

提前致谢

尝试下面的代码

 let image = UIImage(named:"ic_premium")! let templateImage = image.withRenderingMode(.alwaysTemplate) templateImage.tintColor = UIColor.green attachment.image = templateImage