A very tiny library that add visibility
concept (somethings like property hidden
but better) for NSView. It allows easily to show and hide views with animation and passion.
Besides, it allows to avoid using "negative boolean logic" (see Code Complete, page 269, Use positive boolean variable names for more information).
#import "NSView+MISSINGVisibility.h"
NSButton *button = [[NSButton alloc] initWithFrame:buttonFrame];
NSProgressIndicator *indicator = [[NSProgressIndicator alloc] initWithFrame:indicatorFrame];
indicator.hidden = YES;
// And later instead of use `button.hidden = YES;` you can use:
[button setVisible:NO animated:YES];
// And animation will start but property `isVisible` become `NO` synchronously.
// And you will be able access it and control it consistently. Like this:
[indicator setVisible:(!button.isVisible) animated:YES];
Nothing.
NSView+MISSINGVisibility is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "NSView+MISSINGVisibility"
Valentin Shergin, valentin@shergin.com
NSView+MISSINGVisibility is available under the MIT license. See the LICENSE file for more info.