美文网首页
iOS开发集锦之 2017.05.15(UI之一劳永逸系列)

iOS开发集锦之 2017.05.15(UI之一劳永逸系列)

作者: Ashen_ | 来源:发表于2017-05-15 21:07 被阅读26次
    程序开发调试日常 ​​​​ ​​​​ ​​​​ ​​​​ ​​​​ by:@程序员GIF
    **文章**
    

    1. 一劳永逸,iOS自定义ActionSheet封装流程

    作者:卖报的小画家Sure
    描述:

    • 1.maskView(透明度, 点击取消), tableView(header-> title, cell ->selectType, footer -> cancel);
    • 2.最后一项设置圆角(左下, 右下),借助UIBezierPath与CAShapeLayer进行实现;
    • 4.提供外部api, 标题, 数据源,选中回调, 取消回调

    demo: 一劳永逸,iOS自定义ActionSheet封装流程demo


    关键代码:
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect: cell.contentView.bounds byRoundingCorners: UIRectCornerBottomLeft|UIRectCornerBottomRight cornerRadii: CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc]init];
    maskLayer.frame = cell.contentView.bounds;
    maskLayer.path = maskPath.CGPath;
    cell.layer.mask = maskLayer;

    2. 在 iOS 上用 Core Image 实现人脸检测

    作者: Gregg Mojica
    描述:

    • 1.用Core Image实现人脸检测
    • 2.计算出 imageView 中识别到的人脸的实际位置和尺寸
    • 3.实现 Core Image 坐标到 UIView 坐标的转换
    • 4.可以检测嘴、微笑、眼睛位置,判断左眼(或右眼)是否睁开



      关键代码:
      let accuracy = [CIDetectorAccuracy: CIDetectorAccuracyHigh]
      let faceDetector = CIDetector(ofType: CIDetectorTypeFace, context: nil, options: accuracy)
      let faces = faceDetector?.features(in: personciImage)

    
    **开源项目**
    

    3. 一个丝滑的图片浏览器:PhotoBrowser

    作者: JiongXing
    相关文章: 如何写出一个丝滑的图片浏览器
    描述: Elegant photo browser in Swift. 图片浏览器,交互方式、表现形式与微信一致


    查看订阅消息,请关注微信订阅号: iOS_dev_awesome


    iOS_dev_awesome

    相关文章

      网友评论

          本文标题:iOS开发集锦之 2017.05.15(UI之一劳永逸系列)

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