How to draw a UILabel with a different blend mode in draw(_ rect: CGRect) in Swift
So I have a UILabel that is being drawn on top of a gradient image (that is a UIImageView ). It looks sorta like this: I'm trying to change the blendMode of the graphics context in the UILabel 's draw(_ rect: CGRect) function so that it draws the label but blended with the background with a softLight blending mode. Here is what I want it to look like: Here is the code I have in the draw(_ rect: CGRect) function: override func draw(_ rect: CGRect) { // Drawing code if let context = UIGraphicsGetCurrentContext() { context.setBlendMode(.softLight) self.textColor.set() self.drawText(in: rect) } }