iOS 备忘

添加视图控制器
// 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), ^{
    //汇总
 });
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容