I have a UIImageView
which has another added UIImageView
on top as subview, seen below:
self.imageView.image = UIImage(named: "original_image.png")
let demoStampImage = UIImage(named: "demo_stamp.png")
let frame = CGRect(x: (UIScreen.main.bounds.width / 2) - 50, y: (UIScreen.main.bounds.height / 2) - 50, width: 100, height: 100)
let demoStampImageView = UIImageView(image: demoStampImage)
demoStampImageView.frame = frame
self.imageView.addSubview(demoStampImageView)
set in viewDidLoad
and i can see it nicely on the screen. But later on, when i access this self.imageView
to share it, i only see original image without subview, seen below.
@objc func shareIt() {
let imageToShare = [ self.imageView.image ] -> Here image has no subview
//Code goes on...
}
Please help me, what could be the cause and what can overcome this issue? I appreciate it all.