I\'ve looked around everywhere, but I can\'t find a way to do this. I need to create a black UIImage of a certain width and height (The width and height change, so I can\'t just
Like this
let image = UIGraphicsImageRenderer(size: bounds.size).image { _ in UIColor.black.setFill() UIRectFill(bounds) }
As quoted in this WWDC vid
There's another function that's older; UIGraphicsBeginImageContext. But please, don't use that.