I have a NSViewController named Hardness, and I need not to let user resize it. Of course, I can just resize it back every time the users tries, bu
This answer may be of some help in addition to the current one. There's also a nice simple way to accomplish this by using setHidden with NSWindowZoomButton
Setup the functionality as a sub-class of NSWindow:
Objective-C
#import "CustomWindow.h"
@implementation CustomWindow
- (void)awakeFromNib {
NSButton *zoomButton = [self standardWindowButton:NSWindowZoomButton];
[zoomButton setHidden:YES];
}
@end
Swift
import CustomWindow
class CustomWindow {
func awakeFromNib() {
var zoomButton: NSButton = self.standardWindowButton(NSWindowZoomButton)
zoomButton.setHidden(true)
}
}
Connect the custom class to your window in IB and the Zoom button should be now hidden!