Coder Social home page Coder Social logo

bfcolorpickerpopover's Introduction

BFColorPickerPopover

Pod Version Pod Platform Pod License Dependency Status

Screenshot

Summary

BFColorPickerPopover is a subclass of NSPopover that includes the standard OS X color picker user interface. This helps reducing the inspector window and panel clutter on the screen, as the popover sticks to the content it belongs to. However it's still possible to transform it into an inspector style floating panel by simply dragging it off from the color well.

Requirements

BFColorPickerPopover was written using ARC and Modern Objective-C. ARC (with weak references) is supported since OS X 10.7. For Modern Objective-C you'll need Xcode 4.4 or later and LLVM. I also had to use a few undocumented methods, so I can't guarantee that Apple won't reject an app with this code. They aren't that strict with OS X apps though.

Instructions

Create a Podfile, if you don't have one already. Add the following line.

pod 'BFColorPickerPopover'

Run the following command.

pod install

Alternatively, you can just drag the BFColorPickerPopover folder into your your project in Xcode. Choose "Create groups for any added folders and make sure your target is checked.

BFColorPickerPopover is a singleton class. Use [BFColorPickerPopover sharedPopover] to access it. The reason for this is, that it uses NSColorPanel to create its GUI and there is only one shared NSColorPanel available per app.

You can use the usual showRelativeToRect:ofView:preferredEdge: method of NSPopover to show the shared BFColorPickerPopover instance. But there is also a subclass of NSColorWell included (BFPopoverColorWell) that already handles presenting the popover when needed.

Check out the example application for both approaches.

License

New BSD License. For the full license text, see here.

Credits

BFColorPickerPopover was created by Balázs Faludi.

bfcolorpickerpopover's People

Contributors

andrewschenk avatar drummerb avatar soffes avatar tylerberry avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.