Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @objc func doubleTap(gestureRecognizer: UITapGestureRecognizer) {
- if self.productScrollView.zoomScale == 1 {
- self.productScrollView.zoom(to: self.zoomRectForScale(scale: self.productScrollView.maximumZoomScale, center: gestureRecognizer.location(in: gestureRecognizer.view)), animated: true)
- } else {
- self.productScrollView.setZoomScale(1, animated: true)
- }
- }
- let tintView = UIView()
- tintView.backgroundColor = UIColor(white: 0, alpha: 0.5)
- tintView.frame = CGRect(x: 0, y: 0, width: imageView.frame.width,
- height: imageView.frame.height)
- imageView.addSubview(tintView)
- let tintView = UIView()
- tintView.backgroundColor = UIColor(white: 0, alpha: 0.5)
- tintView.translatesAutoresizingMaskIntoConstraints = false
- imageView.addSubview(tintView)
- NSLayoutConstraint.activate([
- tintView.bottomAnchor.constraint(equalTo: imageView.bottomAnchor),
- tintView.leadingAnchor.constraint(equalTo: imageView.leadingAnchor),
- tintView.trailingAnchor.constraint(equalTo: imageView.trailingAnchor),
- tintView.topAnchor.constraint(equalTo: imageView.topAnchor),
- ])
Add Comment
Please, Sign In to add comment