その後のその後

iOSエンジニア 堤 修一のブログ github.com/shu223

オープンソースのカスタムUIシリーズその5 : CWUIKit

UIKitになく、かつUIKitベースなオープンソースのUIライブラリを紹介していきます。


いきなりその5から始まるのは、過去に書いた、

に続いて、という意図です。

CWUKitのサンプル

ソースはこちらからダウンロードできます。
https://github.com/jayway/CWUIKit


サンプルをビルド&実行してみると、こんな感じのUIでした。


CWColumnTableView

各セルに複数のカラムをもつUITableView風UI。
サンプルでは右上の+ボタンを押す度にカラムが追加されていきます。


CWCalloutView

MapKitのコールアウト風UI。
サンプルではタップした位置にMapKitのコールアウトのようなフキダシがでてきます。


他にもREADMEによると

  • CWAuxiliaryActions - Use blocks as callbacks for UIAlertView & UIActionSheet.
  • CWTableViewBackgroundCell - Configurabe background and highlight for cells.
  • CWLinearLayout - Rule based linear layout, when springs&struts comes short.
  • CWNibLocalization - Prefix text with @ in IB gets localized from strings.
  • UIAlertView - Conviniece additions to construct from NSError instances.
  • UIColor - Additions for extracting components, and accessing standard colors.
  • UIDevice - Conviniece additions for quering for availible capabilities.
  • UIImage - Additions for resizing and normalizing images.
  • UIView - Additions for animating a visual move cue.

といった機能があるようです。

ビルド方法

Components/CWFoundationフォルダが空なので、下記URLから拾ってきてクラスを一通りコピペしてきてプロジェクトに追加します。
https://github.com/jayway/CWFoundation


gitコマンドでもいけるようです。

git submodule update --init --recursive

自分のプロジェクトへの追加方法

READMEより

You add this project as a sub project in Xcode like this:
1. Add this project as a sub project to your project.
2. Make sure this project product (libCWUIKit.a) is a target member.
3. Make sure the subprojects product (libCWFoundation.a) is a target member.
4. Add the CWUIKit target as direct dependency.
5. Add /** to user header search paths.
6. Add -all_load to other linker flags.
7. Add CWUIKitResources to Copy Bundle Resource build phase.

ライセンス

READMEによるとNew BSDライセンスとのことです。