添加视图控制器
// add child viewController
UIViewController* controller =[[UIViewController alloc]init];
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 44, WIDHT, HEIGHT - 44);
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
删除视图控制器
// remove child viewController
UIViewController *vc = [self.childViewControllers lastObject];
[vc.view removeFromSuperview];
[vc removeFromParentViewController];
常用手势
UIPanGestureRecognizer(拖动)
UIPinchGestureRecognizer(捏合)
UIRotationGestureRecognizer(旋转)
UITapGestureRecognizer(点按)
UILongPressGestureRecognizer(长按)
UISwipeGestureRecognizer(轻扫)
消除最后一根分割线
cell.separatorInset = UIEdgeInsetsMake(0, 0, 0, cell.bounds.size.width);
dispatch_group_t group = dispatch_group_create();
dispatch_group_async(group, dispatch_get_global_queue(0,0), ^{
//线程一
});
dispatch_group_async(group, dispatch_get_global_queue(0,0), ^{
// 线程二
});
dispatch_group_notify(group, dispatch_get_global_queue(0,0), ^{
//汇总
});
网友评论