iOS--喜闻乐见③
-
git BUG
git clone: error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
解决方法git config --http.postBuffer 1048576000
还解决不了就在你的git clone + 你的 http链接 + --depth 1
就差不多了 -
关于block的两个宏weak&&strong
#ifndef weakify
#if __has_feature(objc_arc)
#define weakify( x )
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored "-Wshadow"")
autoreleasepool{} _weak typeof(x) weak##x## = x;
_Pragma("clang diagnostic pop")
#else
#define weakify( x )
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored "-Wshadow"")
autoreleasepool{} _block typeof(x) block##x## = x;
_Pragma("clang diagnostic pop")
#endif
#endif
#ifndef strongify
#if __has_feature(objc_arc)
#define strongify( x )
_Pragma("clang diagnostic push")
Pragma("clang diagnostic ignored "-Wshadow"")
try{} @finally{} typeof(x) x = weak##x##;
_Pragma("clang diagnostic pop")
#else
#define strongify( x )
_Pragma("clang diagnostic push")
Pragma("clang diagnostic ignored "-Wshadow"")
try{} @finally{} typeof(x) x = block##x##;
_Pragma("clang diagnostic pop")
#endif
#endif -
同义
#ifndef ALIAS
#define ALIAS( __a, __b ) typeof(__a) __b = __a;
#endif -
消除navBar下和tabbar上的黑线
//隐藏navBar下方的黑线
self.navigationController.navigationBar.translucent = NO;
self.navigationController.navigationBar.alpha = 1;
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forBarMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setShadowImage:[UIImage imageWithColor:[UIColor clearColor]]];
//隐藏TabBar上方的黑线
[self.tabBar setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]]];
[self.tabBar setShadowImage:[UIImage imageWithColor:[UIColor clearColor]]];
PS:imageWithColor是颜色转换成image的一个方法+ (UIImage *)imageWithColor:(UIColor *)color { return [self imageWithColor:color size:CGSizeMake(1.0f, 1.0f)]; } + (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size { CGRect rect = CGRectMake( 0.0f, 0.0f, size.width, size.height ); UIGraphicsBeginImageContext( rect.size ); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [color CGColor]); CGContextFillRect(context, rect); UIImage * result = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return result; }
-
ToolBar背景颜色透明问题以及往toolbar上面添加button之后自定义间隙
-
关于审核事项
有些东西在苹果审核的时候是不通过的,如果不是私密性的东西的话(私密东西自己混淆),可以配合服务器来操作
BooL isCheck = [联网从服务器获取数据];
if (isCheck) {
[做些隐藏事件];
}else {
[做些已经上架的事];
} -
滑动tableView,键盘收起
tableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
其中keyboardDismissMode是UIScrollView的属性,
它的值除了UIScrollViewKeyboardDismissModeNone,
还有一种是UIScrollViewKeyboardDismissModeInteractive,表示键盘可以随着手指下滑而移出屏幕