windowWillResizetoSize
windowWillResize:toSize: is a delegate method in the NSWindowDelegate protocol in AppKit. It informs a window’s delegate that the window is about to be resized and provides an opportunity to adjust or veto the proposed size. The delegate can alter the size that will actually be used for the window as the user drags to resize.
Signature. In Objective-C, the method is declared as - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedSize;. In Swift, the corresponding signature
Behavior and timing. The method is called during live resizing, when the user drags the window’s edge
Common usage. Typical uses include enforcing minimum or maximum window dimensions, restricting the aspect ratio, or
Notes. The method is optional; you implement it on a class that conforms to NSWindowDelegate. If you