Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.31 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.31 KB

AirSightResizeView

AirSightResizeView

Selection view, similar to macOS Preview.app. User-resizable, user-repositionable NSView subclass. Used by Pixea - free image viewer for macOS.

Usage

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;
}

Properties:

  • animated - animates selection
  • respectsProportion - respects ratio
  • squareSelection - allows only square selection
  • knobColor - knob color
  • selectedFrame - selection rect
  • selectableFrame - allow selection in rect

Delegate methods:

@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.