Selection view, similar to macOS Preview.app. User-resizable, user-repositionable NSView subclass. Used by Pixea - free image viewer for macOS.
Simply instantiate AirSightResizeView
with the desired style and add to your view hierarchy. Set view class to AirSightResizeView
in IB.
#import <AirSightResizeView/AirSightResizeView.h>
...
- (void)viewDidLoad {
[super viewDidLoad];
// set (AirSightResizeView*) delegate to self
_selectionView.delegate = self;
}
animated
- animates selectionrespectsProportion
- respects ratiosquareSelection
- allows only square selectionknobColor
- knob colorselectedFrame
- selection rectselectableFrame
- allow selection in rect
@protocol AirSightResizeViewDelegate
- (void) selectionDidChanged:(NSRect)selectedRect;
- (NSRect) selectionWillChange:(NSRect)selectedRect;
- (NSRect) selectionWillMove:(NSRect)selectedRect;
- (void) interactionDidStarted;
- (void) interactionDidEnded;
For an example of how to use AirSightResizeView, please see the included example project.