CCNStatusItem is a subclass of NSObject to act as a custom view for NSStatusItem. It supports a customizable statusItemWindow handling any viewController for presenting the content.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
CCNStatusItem Example

Flattr this git repo Travis Status


CCNStatusItem is a subclass of NSObject to act as a custom NSStatusItem. Running on Yosemite it has full support for the class NSStatusBarButton which is provided by NSStatusItem via the button property.


  • Yosemite's dark menu mode will be automatically handled
  • Proximity drag detection
  • Support for Drag&Drop
  • Custom Views as StatusItems
  • Support for switching the StatusItem on/off (in case you're using both the StatusItem and a Dock Icon)

It supports a customizable statusItemWindow that will manage any NSViewController instance for presenting the content.

This screenshot presents the current example application:

CCNStatusItem Example Application


You can add CCNStatusItem by using CocoaPods. Just add this line to your Podfile:

pod 'CCNStatusItem'


After it's integrated into your project you are just a few lines of code away from your (maybe) first NSStatusItem with a custom view and a beautiful looking popover window. A good place to add these lines of code is your AppDelegate:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [[CCNStatusItem sharedInstance] presentStatusItemWithImage:[NSImage imageNamed:@"statusbar-icon"]
                                         contentViewController:[ContentViewController viewController]];

That's all! You will have some options to change the design of this statusItem popover window using CCNStatusItemWindowConfiguration. In the example above internally CCNStatusItem uses [CCNStatusItemWindowConfiguration defaultConfiguration] to set a default design and behavior of the status bar popover window. The next example will show you how to change this design and behaviour:

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    // configure the status item
    CCNStatusItem *sharedItem = [CCNStatusItem sharedInstance];
    sharedItem.windowConfiguration.presentationTransition = CCNPresentationTransitionSlideAndFade;
    sharedItem.proximityDragDetectionHandler = ^(CCNStatusItem *item, NSPoint eventLocation, CCNStatusItemProximityDragStatus dragStatus) {
        switch (dragStatus) {
            case CCNProximityDragStatusEntered:
                [item showStatusItemWindow];

            case CCNProximityDragStatusExited:
                [item dismissStatusItemWindow];
    [sharedItem presentStatusItemWithImage:[NSImage imageNamed:@"statusbar-icon"]
                     contentViewController:[ContentViewController viewController]];

Some Side Notes

The statusItem popover's frame size will be determined automatically by calling preferedContentSize on the contentViewController. So you shouldn't forget to set it to a reasonable value. Using XIB's for building the content a good way to do so is returning:

- (CGSize)preferredContentSize {
    return self.view.frame.size;


CCNStatusItem has been written using ARC and "modern" Objective-C 2. It supports OS X 10.10 Yosemite and above.


The code is provided as-is, and it is far off being complete or free of bugs. If you like this component feel free to support it. Make changes related to your needs, extend it or just use it in your own project. Pull-Requests and Feedbacks are very welcome. Just contact me at []([CCNStatusItem] Your component on Github) or send me a ping on Twitter @TheCocoaNaut.


The complete documentation you will find on CocoaDocs.


This software is published under the MIT License.

Software that uses CCNStatusItem

  • Review Times - A small Mac tool that shows you the calculated average of the review times for both the Mac App Store and the iOS App Store
  • SalesX - SalesX is the simplest way to reach your iTC sales reports