Skip to content

imagetasks/AirSightResizeView

Repository files navigation

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.

About

Preview.app-like selection control for macOS. User-resizable, user-repositionable NSView subclass.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published