An open API service indexing awesome lists of open source software.

https://github.com/imagetasks/airsightresizeview

Preview.app-like selection control for macOS. User-resizable, user-repositionable NSView subclass.
https://github.com/imagetasks/airsightresizeview

cocoa nsview objective-c resizable

Last synced: 9 months ago
JSON representation

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

Awesome Lists containing this project

README

          

AirSightResizeView
============

# [![AirSightResizeView](https://github.com/imagetasks/AirSightResizeView/blob/master/demo.gif?raw=true)](#)

Selection view, similar to macOS Preview.app. User-resizable, user-repositionable NSView subclass. Used by [Pixea - free image viewer for macOS](https://www.imagetasks.com/pixea/).

Usage
-----

Simply instantiate `AirSightResizeView` with the desired style and add to your view hierarchy. Set view class to `AirSightResizeView` in IB.

#import
...
- (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.