a lot of iOS Project Tips and many fun thing.
一些项目的tips和一些有趣的
-
setStatusBarStyle(自定义状态栏)
AppDelegate
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
SYBaseNavigationController
[self.navigationBar setBarTintColor:[UIColor colorWithRed:20/255.0 green:155/255.0 blue:213/255.0 alpha:1.0]];
self.navigationBar.tintColor = [UIColor whiteColor];
[self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]}];
[self.navigationBar setTranslucent:NO];
plist添加:
1.View controller-based status bar appearance 设置为NO;
2.Status bar is initially hidden 设置成YES
详情:请参考SYTipsDemo
-
set PanGestureRecognizer back(设置全屏手势右滑返回)
- (void)setPan{ id target = self.interactivePopGestureRecognizer.delegate; UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)]; pan.delegate = self; [self.view addGestureRecognizer:pan]; self.interactivePopGestureRecognizer.enabled = NO; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{ if (self.childViewControllers.count == 1) { return NO; } return YES; }
详情:设置全屏手势右滑返回
-
package MBProgrssHUD(封装MBProgressHUD,更易用)
+ (SYHUDView *)showToView:(UIView *)view;
+ (SYHUDView *)showToView:(UIView *)view text:(NSString *)text hide:(NSTimeInterval)time;
+ (SYHUDView *)showToBottomView:(UIView *)view text:(NSString *)text hide:(NSTimeInterval)time;
+ (SYHUDView *)showToView:(UIView *)view success:(BOOL)isSuccess text:(NSString *)text hide:(NSTimeInterval)time;
+ (SYHUDView *)showToView:(UIView *)view customImage:(UIImage *)image text:(NSString *)text hide:(NSTimeInterval)time;
Example, easy use:
[SYHUDView showToView:self.view text:@"Success" hide:2.0];
[SYHUDView showToView:self.view success:YES text:@"Success" hide:2.0];
SYHUDView *hud = [SYHUDView showToView:self.view];
[hud hide:YES afterDelay:2.0];
- And has many not finished…Welcome to star, fork, pull request or issues.
a skill and and more and more you can get(such as a project style...)
Reference
参考:全屏手势返回
参考:view抖动效果