話題の記事

[iOS] iOS 7対応アプリで使いたいライブラリ4選 +α | アドカレ2013 : SP #17

2013.12.17

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

はじめに

前回の「iPhoneアプリの初回起動時に表示したい「おもてなし」ライブラリ4選」に引き続きiOSアプリ用のライブラリをご紹介します。今回はiOS 7のUIに合いそうなライブラリを集めてみました。

カレンダー

RDVCalendarView

ios-introduce-library-for-ios7_01

Author Robert Dimitrov
GitHub https://github.com/robbdimitrov/RDVCalendarView
License MIT license
CocoaPods pod 'RDVCalendarView', '~> 1.0.1'
Reference RDVCalendarView Reference
Requirements ARC
iOS 5.0 or later

RDVCalendarViewを使えばアプリにカレンダーUIを組み込むことができます。iOS 7標準のカレンダーアプリの月表示画面に似たデザインになっており、iOS 7のUIによく合うと思います。主な特徴は以下の通りです。

  • iPad・iPhone両対応
  • ランドスケープ・ポートレイト表示両対応
  • 高いカスタマイズ性
  • NSLocaleを使用して完全にローカライズ可能

GitHubからダウンロードできるプロジェクトにはデモが含まれており、これを見れば基本的な使い方はわかるかと思います。

RDVCalendarViewのカレンダーUIは3つのクラスから成り立っており、これらのクラスを継承したクラスを作成してカスタマイズすることが可能です。例えば、日にちのセルに付加するマーカーはデフォルトでは四角で日付文字の右上に付いていますが、iOS 7標準のカレンダーアプリの月表示画面のように日にち丸いマーカーを日付文字の下に配置するようにカスタマイズすることも可能です。

RDVCalendarViewController quite simple class, holds RDVCalendarView instance as its view. Subclass or use as it is. Conforms to RDVCalendarViewDelegate protocol.
RDVCalendarView build on the principles of UICollectionView and UITableView. If you need custom layout - subclass it and override layoutSubviews. Make sure you call [super layoutSubviews] inside your implementation.
RDVCalendarDayCell used for the day cells inside RDVCalendarView. It's similar to UITableViewCell. By default contains only textLabel. Add additional subviews to the contentView. Make sure you call [super layoutSubviews] inside subclass' layoutSubviews implementation.

その他のカレンダーライブラリ

プログレス画面

MRProgress

ios-introduce-library-for-ios7_02

Author Marius Rackwitz
GitHub https://github.com/mrackwitz/MRProgress
License MIT license
CocoaPods pod 'MRProgress', '~> 0.2.2'
Reference MRProgress Reference
Requirements Xcode 5
iOS 7
ARC
Frameworks : QuartzCore、CoreGraphics、Accelerate

MRProgressを使えば進捗表示UIを簡単に表示することができます。

  • tintColorを設定可能
  • ブラーの実装は別のものに置き換え可能
  • コードは再利用可能な小さい部品に分割されている
  • AppleDocでドキュメントが生成されるよう設定済(要AppleDoc)

MRProgressには使用可能なコンポーネントが数種類ありますが、主要なものを紹介します。

MRProgressOverlayView

ios-introduce-library-for-ios7_02 ios-introduce-library-for-ios7_03
ios-introduce-library-for-ios7_04 ios-introduce-library-for-ios7_05
ios-introduce-library-for-ios7_06

ブラーのかかったプログレスビューがオーバーレイ表示されます。8種類のモードが用意されています。

MRCircularProgressView

ios-introduce-library-for-ios7_07 ios-introduce-library-for-ios7_08

AppStoreのインストール画面のような円形のプログレスビューを表示します。停止ボタンを表示することも可能です。

MRNavigationBarProgressView

ios-introduce-library-for-ios7_09

MRNavigationBarProgressViewはUINavigationControllerまたはUIToolbarにプログレスバーを表示することができます。iOS 7のSafariの読み込み中表示も同様のUIですね。

その他のプログレス画面ライブラリ

アラートビュー

MLAlertView

ios-introduce-library-for-ios7_10

Author Max
GitHub https://github.com/MaxHasADHD/MLAlertView
License MIT license
CocoaPods -
Reference -
Requirements iOS 7

MLAlertViewを使えばTweetbot 3のようなアラートビューを表示させることができます。以下の様なイニシャライザが用意されており、UIAlertViewのような感じで初期化し表示することができます。ボタンが押された際の処理はdelegate経由だけではなくblockも選択できます。

- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /**/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSArray *)otherButtonTitles usingBlockWhenTapButton:(MLAlertTapButtonBlock)tapButtonBlock
- (void)show
- (void)dismiss

その他のアラートビューライブラリ

モーダルビュー

NAModalSheet

ios-introduce-library-for-ios7_11

Author Ken Worley
GitHub https://github.com/thedarkbark/NAModalSheet
License MIT license
CocoaPods -
Reference -
Requirements iOS 7

背景にブラー処理をかけたモーダルビューを簡単に表示できます。

まとめ

今回はiOS 7のUIに合いそうなライブラリを集めてみました。iOS 7向けのUIライブラリを作成する際の参考にもなりそうです。
iOS 7対応のアプリを作る際に活用したいですね。