JKNotifier,当有消息推送过来并且app为UIApplicationStateActive的时候,JKNotifier将会在状态栏中显示,就如后台推送一样。
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产生振动效果,可以用于输入密码错误时的动画效果。可以自定义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以上