美文网首页
iOS 备忘

iOS 备忘

作者: Super_Yuan | 来源:发表于2017-02-15 12:02 被阅读10次
添加视图控制器
// 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), ^{
    //汇总
 });

相关文章

网友评论

      本文标题:iOS 备忘

      本文链接:https://www.haomeiwen.com/subject/mshqwttx.html