Support Home

Code for the community

This page contains some of the code I’ve written and want to share with the community. The code was either written in a professional capacity as part of bigger projects (these tend to be the individual classes) or as “fun” projects in my spare time.

Licence

You may use the code on this page as long as you agree and adhere to the license, viewable on the Code License page. It basically says that you can use the code as you wish, in open-source, free or commercial products, as long as you provide credit to us in your about box.

Donations

You don’t have to pay or donate to use this code, but if you find it useful feel free to purchase a copy of one of our products!

  • KNKVC

    KNKVC is an implementation of Cocoa's NSKeyValueCoding and NSKeyValueObserving in C# .NET, which is a specific implementation of the Observer pattern.

    This set of classes gives Cocoa developers back a key part of their skillset when working in other languages, and everyone else a dead-simple, easy-to-use key-value coding and observing system. Most of the client-facing functionality is implemented using class extensions, meaning you can simply import the KNKVC namespace and start simplifying your code!

    KNKVC Requires .NET 3.5.

  • Dewey

    Dewey is an open-source Collections editor for the Sony Reader PRS-505 (and maybe the PRS-700, but I don't have one to test). It is written in Cocoa and requires Mac OS X 10.5 or higher.

  • image

    KNAppGuide

    KNAppGuide is a Cocoa framework for embedding "guides" into your application. Visually inspired by Apple Guide from the System 7 and 8 era, this framework brings this idea to the modern world of Cocoa.

  • image

    iPhone Browser

    iPhone Browser is a sample project that demonstrates the AFC classes I’ve written. These classes are intended to be an object-oriented, Cocoa-friendly framework to talk to AFC devices such as the iPod touch and iPhone.

  • image

    KNBundledDocumentResourceManager

    KNBundledDocumentResourceManager is a class for correctly managing resources in document bundles. It's goal is to abstract away the task of keeping the contents of your document's Resources folder consistent with the document's persisted state on disk.

    Features

    • Entirely abstracts this task away from your application.
    • Works with a nil bundle (i.e., before the document is saved).
    • Keeps track of all resources used throughout the lifetime of the instance, allowing undo past save points.

  • KNPopUpDatePicker

    KNPopUpDatePicker is an NSDatePicker subclass that presents a pop-up graphical style picker when the parent control gains focus.

    KNPopUpDatePicker requires MAAttachedWindow by Matt Gemmell.

    Features

    • Simple to use - just change the class of your pickers to KNPopUpDatePicker.
    • If you have NSWindow+Fade in your application, KNPopUpDatePicker will automatically fade the pop-up picker in and out.
    • Pays attention to the control's bindings to ensure bindings are update correctly.

  • image

    KNListSettingController

    A UITableViewController subclass that presents a list of settings, and automatically puts the value for that setting into NSUserDefaults when a setting is chosen.

  • KNUITableViewCells

    This download contains two custom UITableView cells - one containing a switch and the other a secondary blue description label. Both are used extensively in the iPhone OS, and I strongly believe they should both be in UIKit. Still, until that happens you can use these.

  • image

    KNFlippedAwareImageView

    An NSImageView subclass that provides the following:

    • The control is aware of the image’s flipped status, and will draw the image the right way up regardless.
    • The control sizes the image to fit within its bounds - useful for OS 10.4, which doesn’t support image scaling in NSImageView.

  • image

    KNEmbossedTextField

    An NSTextField subclass and gives the text a subtle white “emboss” effect, useful for status labels and the like.

  • image

    KNImageAndTextButtonCell

    An NSButtonCell subclass that allows you to create an NSOutlineView containing a checkbox, an image and a label and have the content follow the indentation correctly, which isn’t possible using plain AppKit classes. This class is used in the “Notes” section of Music Rescue.

    Far Left: A two-column NSOutlineView using NSButtonCell and a custom cell that contains an image and text.

    Left: A single-column NSOutlineView using KNImageAndTextButtonCell.