Cx330

Creating UIImage with renderingMode in Swift

2018-01-02 · 1 min read
iOS swift

for Swift 3

var image = UIImage(named:"myImage")?.withRenderingMode(.alwaysOriginal)

for Swift 2.x

var image : UIImage? = UIImage(named:"myImage.png").imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)

or

var image : UIImage? = UIImage(named:"myImage.png").imageWithRenderingMode(. AlwaysOriginal)