Borderless NSButton turns gray when clicked
Make your button type as NSMomentaryChangeButton. [myBtn setButtonType:NSMomentaryChangeButton]; If you use NSMomentaryPushInButton then you may get gray rectangle over the button when click.
Make your button type as NSMomentaryChangeButton. [myBtn setButtonType:NSMomentaryChangeButton]; If you use NSMomentaryPushInButton then you may get gray rectangle over the button when click.
The modern approach is much easier: [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { context.duration = 1; view.animator.alphaValue = 0; } completionHandler:^{ view.hidden = YES; view.alphaValue = 1; }]; If the view hierarchy is layer-backed, it’s actually sufficient to do: view.animator.hidden = YES;
-[NSAttributedString boundingRectWithSize:options:] You can specify NSStringDrawingUsesDeviceMetrics to get union of all glyph bounds. Unlike -[NSAttributedString size], the returned NSRect represents the dimensions of the area that would change if the string is drawn. As @Bryan comments, boundingRectWithSize:options: is deprecated (not recommended) in OS X 10.11 and later. This is because string styling is now dynamic … Read more