JKNotifier通知欄提示框,仿系統消息推送狀態欄提示框(作者:hldsjk)
JKNotifier,當有消息推送過來並且app為UIApplicationStateActive的時候,JKNotifier將會在狀態欄中顯示,就如後台推送一樣。
Useage
Manual show
- (IBAction)showAutoHiddenTouched:(id)sender { [JKNotifier showNotifer:@"親,您收到了一條自動隱藏的消息哦!"]; [JKNotifier handleClickAction:^(NSString *name,NSString *detail, JKNotifier *notifier) { [notifier dismiss]; NSLog(@"AutoHidden JKNotifierBar clicked"); }]; }
UILocalNotification or UIRemoteNotification
- (IBAction)localNotificationTouched:(id)sender { UILocalNotification *notification=[[UILocalNotification alloc] init]; if (notification!=nil) { NSDate *now=[NSDate date]; notification.fireDate=[now dateByAddingTimeInterval:2]; notification.timeZone=[NSTimeZone defaultTimeZone]; notification.alertBody=@"收到定時本地推送通知!(recived a UILocalNotification)"; notification.soundName = @"default"; [notification setApplicationIconBadgeNumber:1]; [[UIApplication sharedApplication] scheduleLocalNotification:notification]; } NSLog(@"本地通知2秒後觸發"); } //appdelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { UIUserNotificationType myTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:myTypes categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; }else { UIRemoteNotificationType myTypes = UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:myTypes]; } return YES; } - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { [[UIApplication sharedApplication] cancelAllLocalNotifications]; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; if (application.applicationState == UIApplicationStateActive) { [JKNotifier showNotifer:notification.alertBody]; } }
測試環境:Xcode 6.2,iOS 6.0以上
UITextField 類添加了一個震動的動畫:UITextField-Shake
讓UITextField產生振動效果,可以用於輸入密碼錯誤時的動畫效果。可以自定義TextField振動的速度、方向(左右抑或上下振動)、次數以及振動距離。
UITextField-Shake 是 UITextField 類添加了一個震動的動畫,就像 OSX 登錄界面的密碼字段。
測試環境:Xcode 6.2,iOS 6.0以上
加入購物車動畫(作者:一叽咕)
將商品動畫形式加入購物車,當商品進入購物車時,購物車有上下抖動效果,商品數量漸變。
測試環境:Xcode 6.2,iOS 6.0以上
仿新浪微博自定義的ActionSheet, 代碼炒雞簡單,使用。兩行代碼即可集成,采用Block(作者:liaoyp)
仿新浪微博自定義的ActionSheet, 代碼炒雞簡單易用. 兩行代碼即可集成,采用Block進行回調
- (void)show; - (void)hide; /** * 數據源 */ @property (nonatomic, strong) NSArray *dataSource; /** * actionSheet 點擊回調 */ @property (nonatomic, copy)BTActionSheetDidSelectViewBlock selectRowBlock;
測試環境:Xcode 6.2,iOS 6.0以上
類似於CityMaps的拖拉懸停覆蓋scrollview(Swift)(作者:lilidan1991)
類似於CityMaps的拖拉懸停scrollview(Swift)
scrollview可以根據覆蓋屏幕的比例切換顯示/隱藏/部分顯示
可以用一個手勢(上下拖動)非常流暢地 同時控制scrollView的滾動和顯示/隱藏 兩種行為。
測試環境:Xcode 6.2,iOS 7.0以上