Skip to content

dehlen/DDImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

DDImageView

DDImageView gives you the ability to add a NSImageView to your Xcode project which is Drag&Drop enabled. Also the typically seen Drag&Drop Animation of NSImageViews was implemented.

Installation

Super simple. Just drag & drop DDImageView.h/.m into your project. In your Project, find the .xib or .storyboard file and go to the Identitiy inspector of your NSImageView. Just enter DDImageView in the Custom Class Textfield and you should be good to go.

Usage

If you want to support other or more files then just images have a look in

-(BOOL)performDragOperation:(id <NSDraggingInfo>)sender {

and change the NSPasteboard Types.

You can always customize the drawn control text and the animationDuration via the methods setControlText:(NSString *) and setAnimationDuration:(float)

Be sure to always call [imageView setNeedsDisplay:YES]; to make sure the refreshed values get drawn correctly.

This repository contains a simple project which you always can have a look at to implement this control in your application.

ARC

This version uses only ARC. If you still use MRC in your project feel free to fork this project. Also you will get 1 error by first start of the project. This is because it will recognize that you do not use ARC and will give you a solution how to implement this arc file in your non-arc project.

Contact

License

Copyright (c) 2012 David Ehlen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

NSImageView Subclass which adds Drag&Drop and Animations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published