https://github.com/inket/mbdropzone
Easy file drag & drop for OS X
https://github.com/inket/mbdropzone
Last synced: 6 months ago
JSON representation
Easy file drag & drop for OS X
- Host: GitHub
- URL: https://github.com/inket/mbdropzone
- Owner: inket
- Created: 2014-10-28T14:47:50.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-28T14:47:54.000Z (about 11 years ago)
- Last Synced: 2024-04-23T13:06:51.331Z (over 1 year ago)
- Language: Objective-C
- Size: 97.7 KB
- Stars: 13
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Info
This is a small NSView subclass that accepts file drag & drop and is easy to setup. It is currently being used in [MacSymbolicator](http://mahdi.jp/apps/macsymbolicator). It can probably be done much easier and with cleaner code (I am not proud), it was an experiment and I've learned so much since then.
Hope it's useful to you.


### Usage
- (void)setupDropzone {
MBDropZone* dropzone = [][MBDropZone alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
dropzone.text = @"Drop Crash Report";
dropzone.fileType = @".crash"; // Sets the icon and file type it accepts
dropzone.delegate = self;
}
- (void)dropZone:(MBDropZone*)dropZone receivedFile:(NSString*)file {
NSLog(@"User dropped '%@'", file);
}