i know this question repeat but i cant get sultion
I have this image
And i want view background like this
i have tried all the this
i also try this
self.view.backgroundColor = UIColor(patternImage:
UIImage(named: "backgroundicon.png")!)
Thank you in advance
EDIT :
UIGraphicsBeginImageContext(self.view.frame.size)
UIImage(named: "backgroundicon.png")?.draw(in: self.view.bounds)
let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()
self.view.backgroundColor = UIColor(patternImage: image)
Result :
Here is what you need,
self.imageView.image = UIImage(named: "abcd.png")!.resizableImage(withCapInsets: .zero)
Thats all buddy :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With