Guest User

Untitled

a guest
Jun 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. @objc func doubleTap(gestureRecognizer: UITapGestureRecognizer) {
  2.  
  3. if self.productScrollView.zoomScale == 1 {
  4. self.productScrollView.zoom(to: self.zoomRectForScale(scale: self.productScrollView.maximumZoomScale, center: gestureRecognizer.location(in: gestureRecognizer.view)), animated: true)
  5. } else {
  6. self.productScrollView.setZoomScale(1, animated: true)
  7. }
  8.  
  9. }
  10.  
  11. let tintView = UIView()
  12. tintView.backgroundColor = UIColor(white: 0, alpha: 0.5)
  13. tintView.frame = CGRect(x: 0, y: 0, width: imageView.frame.width,
  14. height: imageView.frame.height)
  15. imageView.addSubview(tintView)
  16.  
  17. let tintView = UIView()
  18. tintView.backgroundColor = UIColor(white: 0, alpha: 0.5)
  19. tintView.translatesAutoresizingMaskIntoConstraints = false
  20. imageView.addSubview(tintView)
  21. NSLayoutConstraint.activate([
  22. tintView.bottomAnchor.constraint(equalTo: imageView.bottomAnchor),
  23. tintView.leadingAnchor.constraint(equalTo: imageView.leadingAnchor),
  24. tintView.trailingAnchor.constraint(equalTo: imageView.trailingAnchor),
  25. tintView.topAnchor.constraint(equalTo: imageView.topAnchor),
  26. ])
Add Comment
Please, Sign In to add comment