Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewController: UIViewController {
- var img1: UIImage!
- override func viewDidLoad() {
- super.viewDidLoad()
- guard let i1 = UIImage(named: "p3x3"),
- let i2 = UIImage(named: "p2x2"),
- let i3 = UIImage(named: "p1x1")
- else {
- fatalError("failed to load images")
- }
- i1.mergeWithTopmage(topImage: i2, completion: { img in
- img.mergeWithTopmage(topImage: i3, completion: { img in
- self.img1 = img
- })
- })
- }
- override func viewDidAppear(_ animated: Bool) {
- super.viewDidAppear(animated)
- let imgView = UIImageView(image: img1)
- view.addSubview(imgView)
- imgView.center = view.center
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement