iOS开发的一些奇技淫巧

 •  Filed under iOS, XCode

来自cocoachina

1.令TableView不显示没内容的Cell

self.tableView.tableFooterView = [[UIView alloc] init];

2.自定义leftBarbuttonItem 同时保留左滑返回手势

self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;

3.解决ScrollView不能在viewController划到顶

self.automaticallyAdjustsScrollViewInsets = NO;

4.点击self.view就让键盘收起

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.view endEditing:YES];
}

5.像safari一样滑动的时候隐藏navigationbar

navigationController.hidesBarsOnSwipe = Yes

6.tableview里cell的小对勾的颜色改成别的颜色

_mTableView.tintColor = [UIColor redColor];