KTUIKit

KTUIKit is a Cocoa framework project that is currently in development.

The goal of the project is to provide solutions to three important issues in any Mac UI project:

  • Layout
  • Styling
  • The MVC design pattern (specifically the V & C parts)
  • At the moment, there are two parts of the framework in place, at various stages of development (sorry, no documentation yet!):

    The Views

  • KTView, et al.
  • KTLayoutManager
  • KTStyleManager
  • The Controllers

  • KTWindowController
  • KTViewController
  • There is also an Interface Builder plugin that provides a GUI for configuring the view’s layouts and styles. The GUI itself still needs A LOT of work and I will be focusing on that for the next update - along with providing some real documentation.

    Getting KTUIKit

    You can check out KTUIKit Xcode project from its Google Code Repository

    # Non-members may check out a read-only working copy anonymously over HTTP.
    svn checkout http://ktuikit.googlecode.com/svn/trunk/ ktuikit-read-only

    Or download the current build and an example application:
    KTUIKit 0.9.1

    Disclaimer:
    The example project is a good place to see the current build of the framework in action. I don’t suggest trying to use KTUIKit in your own project until a 1.0 is released. If you are just curious and want to test it out, you can follow these steps to get it up and running in your own project -

    Steps to use KTUIKit in an Xcode project

    The framework is designed to be embedded in the applications that use it. The following instructions explain how to use an embeddable framework in an Xcode project.

    Before you get started, give the KTUIKit Xcode project a good home. I keep it in a directory that is above the directories of all of the projects I use it in. After you have a good spot for it, build it and then:

    1. Add KTUIKit Project as a dependency of the project

    AddProject.png
  • Drag KTUIKit project file into the Application project’s ‘Groups & Files’ list in Xcode.
  • 2. Add target dependencies

    TargetDependency.png
  • Open the “Targets” group in the “Groups and Files” list.
  • Select the application target and hit the “Info” button in the toolbar.
  • In the “General” tab of the target’s Info window, there is a list of “Direct Dependencies”. Hit the Add (+) button.
  • A sheet will come down where you can select both the framework and plug-in from the KTUIKit project.
  • Add both.
  • 3. Add KTUIKit to the project

    AddFramework.png
  • Go to the “Action” menu in the toolbar and select “Add/Existing Frameworks…”
  • Add the KTUIKit.framework, which is located in the KTUIK project’s build directory in the “Uninstalled Products” directory.
  • 4. Create a New ‘Copy Files’ build phase

    CopyFilesBuildPhase.png
  • Open the “Targets” group in the “Groups and Files” list.
  • Open the application target to reveal the build phases
  • Go to the “Action” menu in the toolbar and select “Add/New Build Phase/New Copy Files Build Phase”
  • The Info window for the build phase will pop up. Change the selection in the “Destination” pop-up menu to “Frameworks”
  • Drag KTUIKit from the “Linked Frameworks” group into the new build phase
  • 5. Add a “Runpath Search Path” to the target’s build settings

  • Select the application target in the “Groups and Files” list and hit the “Info” button on the toolbar.
  • In the “Linking” section, find the setting for “Runpath Search Paths”.
  • Double-click in the “Value” column and add the following text: @loader_path/../Frameworks
  • Steps to use KTUIKit in Interface Builder

    The easiest way to install the plugin is by double-clicking the plugin (KTUIKitIBPlugin.ibplugin) in the Finder.

    You can also install it from within Interface Builder:

    AddToIB.png
  • Launch Interface Builder
  • Go to the Preferences window and select the “Plug-ins” tab
  • Hit the add (+) button and navigate IB to KTUIKitIBPlugin.ibplugin
  • The KATI plug-in should now show up in in your Library.