Mansour
Mansour

Reputation: 535

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

Upvotes: 11

Views: 2671

Answers (1)

Léo Natan
Léo Natan

Reputation: 57040

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

Upvotes: 14

Related Questions