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.
- Host: GitHub
- URL: https://github.com/imagetasks/airsightresizeview
- Owner: imagetasks
- License: gpl-3.0
- Created: 2020-04-22T13:43:16.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T12:05:21.000Z (about 6 years ago)
- Last Synced: 2025-05-19T15:50:27.428Z (about 1 year ago)
- Topics: cocoa, nsview, objective-c, resizable
- Language: Objective-C
- Homepage:
- Size: 1.01 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
AirSightResizeView
============
# [](#)
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.