libinstabannerをリリースしました。iOS5から実装されたUIAlertViewによる通知にかわる方法として上部にバナーがでるおなじみのアレですが、tweakから任意に呼び出すには結構な手間がかかる(特にSpringBoardの外からは)のでライブラリを作りました。
使い方は1通りしかないので難しい事は何もなく、ヘッダーのUsageがもうほんとすべてです。bundleIdentifierの引数はnilチェックしてるのでそこは最低限なにか入れる必要があります。titleはnilにすると自動でDisplayNameが入ります。com.apple.Preferencesを指定して日本語なら「設定」てな感じです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface InstaBanner : NSObject
// Must necessary argument: bundleidentifier
// If title is nil, automatically set to displayName of bundleidentifier.
+ (void)showBannerWithBundleIdentifier:(NSString *)bundleidentifier title:(NSString *)title message:(NSString *)message;
@end
// Usage
// [InstaBanner showBannerWithBundleIdentifier:[NSBundle mainBundle].bundleIdentifier title:nil message:@"test"];
bundleIdentifierを自由に指定できるのでこんな感じにすると・・
[InstaBanner showBannerWithBundleIdentifier:@"eu.heinelt.ifile" title:nil message:@"libinstabanner test"];
こうなります。タップするとそのアプリを起動できます。
面倒なコードが1行ですむね!やったね!