Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
[ad_1]
After I got here throughout many of the examples, I discover nearly all of them are utilizing withRenderingMode
, when assigning an UIImage
to UIImageView
, UIButton
, …
Examples are :-
Motion Sheet with Picture for every choice on iOS
My preliminary ideas is that, the aim of utilizing withRenderingMode
, is to generate a brand new occasion of UIImage
, in order that altering the tint shade of an UI element, won’t have an effect on remainder of others.
I wrote a easy program with out utilizing withRenderingMode
class ViewController: UIViewController {
@IBOutlet weak var imageView1: UIImageView!
@IBOutlet weak var imageView2: UIImageView!
@IBOutlet weak var imageView3: UIImageView!
override func viewDidLoad() {
tremendous.viewDidLoad()
let chooseImage = UIImage(systemName: "photograph")
imageView1.picture = chooseImage
imageView2.picture = chooseImage
imageView3.picture = chooseImage
imageView1.tintColor = .crimson
imageView2.tintColor = .inexperienced
}
I count on all UIImageView
will find yourself of getting identical picture shade, but it surely does not occur.
Can anybody present an instance, on when utilizing withRenderingMode
is admittedly essential?
Thanks.
[ad_2]