Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class ViewController: UIViewController {
- @IBOutlet var photo: UIImageView!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- photo.image = UIImage(named:"test.png")
- photo.contentMode = .scaleAspectFill
- let width = self.photo.bounds.size.width
- let height = self.photo.bounds.size.height
- let imageViewBackground = UIImageView(frame: CGRect(x:0,y:0,width:width,height:height))
- imageViewBackground.image = UIImage(named:"DG.png")
- imageViewBackground.contentMode = .scaleAspectFit
- photo.addSubview(imageViewBackground)
- photo.sendSubviewToBack(imageViewBackground)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement