theginbin / OPUIKit

A collection of custom UIKit components.

Home Page:https://github.com/mbrandonw/OPUIKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#OPUIKit - a collection of custom UIKit components

OPUIKit was built to accomodate the many interface patterns we saw repeatedly while designing apps. This collection of components aims to supplement the UIKit framework and to stay true to UIKit's patterns and idioms. We have no interest in creating or maintaining a monolithic framework, especially when considering how fast Apple innovates with iOS.

##Highlights

  • OPSideBarNavigationController : A subclass of UINavigationController giving a Facebook-esque navigation interface.
  • OPView, OPControl, OPButton : Subclasses of UIView, UIControl and UIButton respectively giving a block based interface for low level drawing.
  • OPTabBarController : A tab bar controller written from scratch, supporting most of the features of UITabBarController, but highly customizable. The tab bar and tab bar items are instances of OPView and OPControl, respectively, hence subject to the awesomeness that is the block based drawing mentioned above.
  • OPStyle : a unified interface for skinning UI components. More below.

##Other cool stuff

  • OPNavigationBar : A UINavigationBar subclass that allows block based custom drawing, and the ability to add a drop shadow underneath.
  • OPNavigationController : A sensible navigation controller subclass to use in your navigation based apps. It's primary purpose is to use a NIB to replace its navigation bar with an instance of OPNavigationBar so that we do fancy things like custom drawing and adding a drop shadow in the navigation bar.
  • OPGradientView : AUIView subclass that simply replaces the default backing layer with a CAGradientLayer so that we can easily create gradient views.

##Global styling

There is a category on NSObject that adds an instance method -styling and class method +styling to every subclass. It returns an instance of OPStyle (well, technically OPStyleProxy, but more on that later) that allows you to set global stylings associated with your class. For example,

[[OPNavigationBar styling] setBackgroundColor:[UIColor lightGrayColor]];
[[OPNavigationBar styling] setShadowHeight:4.0f];

Now all new instances of OPNavigationBar will be styled accordingly. For a list of styles that can be applied, see OPStyleProtocol.h.

##A note about UIColor objects and iOS 4.x

There seems to be a change in the way iOS handles UIColor objects of varying color spaces from 4.x to 5.x. If you need to support 4.x devices we suggest always using the RGB color space, which means you shouldn't use helpers like [UIColor grayColor], and instead use [UIColor colorWithRed:0.5f green:0.5f blue:0.5f alpha:1.0f].

##Installation

We love CocoaPods, so we recommend you use it.

##Dependencies

We make extensive use of OPQuartzKit and OPExtensionKit. They have some pretty kick ass things though, so you may want to check them out anyway :)

##Demo

Checkout OPKitDemo for a demo application using OPUIKit, among other things.

##Author

Brandon Williams
brandon@opetopic.com
www.opetopic.com

About

A collection of custom UIKit components.

https://github.com/mbrandonw/OPUIKit


Languages

Language:Objective-C 99.8%Language:Ruby 0.2%Language:Makefile 0.0%