Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect window resizing in Mac Catalyst?

How can I a get a notification when user resize the window while:

 NotificationCenter.default.addObserver(self, selector: #selector(function), name: NSWindowDidResizeNotification, object: nil)

is unavailable in Mac Catalyst

like image 782
Mansour Avatar asked Sep 29 '19 21:09

Mansour


1 Answers

Just like in iOS. Use windowScene(_:didUpdate:interfaceOrientation:traitCollection:) in your window scene delegate, or implement viewWillTransition(to:with:) in your view controllers.

like image 147
Léo Natan Avatar answered Oct 02 '22 12:10

Léo Natan