Use performZoom:
to simulate clicking your window's green "Zoom" button.
Your window gets the zoom size from windowWillUseStandardFrame:defaultFrame:
. Return a modified NSRect
, there, to zoom to a size other than the default zoomed frame.
- (void)windowDidLoad {
[super windowDidLoad];
[self.window performZoom:self];
}
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)newFrame {
// Implement a custom zoomed window size here, or return the default zoomed size.
return newFrame;
}