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
Post
Replies
Boosts
Views
Activity
Why apple don't grant us the same discount for educational? Since all of us have to buy at least one real Mac for testing iOS app with M1 Mac, I think will be a great idea to have ONE discount for ONE paid and active developer ID.