Last active
May 17, 2019 11:19
-
-
Save rawnly/a1448698bb16a31d794dce3bd5cd9a16 to your computer and use it in GitHub Desktop.
Gist for the medium article
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
class ViewController: UIViewController { | |
// MARK: - UI Initialization | |
// The image that we will zoom/drag | |
var imageView = UIImageView() | |
// The dark overlay layer behind the image | |
// that will be visible while gestures are recognized | |
var overlay: UIView = { | |
let view = UIView(frame: UIScreen.main.bounds); | |
view.alpha = 0 | |
view.backgroundColor = .black | |
return view | |
}() | |
// Let's start | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Here some basic setup | |
view.addSubview(overlay) | |
view.bringSubviewToFront(imageView) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment