Post not yet marked as solved
Post marked as unsolved with 1 replies, 597 views
As a official documentation all delegate methods of UIScrollViewDelegate are usable and supported with Mac Catalyst. I've done this sample UIViewController:
class sideMagnifier: UIViewController,UIScrollViewDelegate {
var immagineDaMagnificare = UIImage()
@IBOutlet weak var imgToMagnify: UIImageView!
	@IBOutlet weak var scrollToMagnify: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
self.imgToMagnify.clipsToBounds = true
self.scrollToMagnify.delegate = self
imgToMagnify.image = immagineDaMagnificare
self.scrollToMagnify.minimumZoomScale = 1.0
self.scrollToMagnify.maximumZoomScale = 4.0
let larghezzaContainer = UIScreen.main.bounds.width
let altezzaContainer = UIScreen.main.bounds.height
imgToMagnify.translatesAutoresizingMaskIntoConstraints = false
imgToMagnify.widthAnchor.constraint(equalToConstant: larghezzaContainer).isActive = true
imgToMagnify.heightAnchor.constraint(equalToConstant: altezzaContainer).isActive = true
}
func scrollViewDidZoom(_ scrollView: UIScrollView) {
print("zoom")
}
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
return self.imgToMagnify
}
@IBAction func dismissButtonTapped(_ sender: UIButton) {
self.dismiss(animated: true)
}
}
In iOS all works , pan and zoom even in simulator or real devices are working perfectly.
In MacCatalyst nothing works and events aren't firing. Seems that delegate is totally ignored, so, what is wrong here? Mine code, the documentation, whatever? Thanks