美文网首页
iOS 13 适配(收集中...)

iOS 13 适配(收集中...)

作者: 大哥家的狗 | 来源:发表于2019-09-27 09:18 被阅读0次

    1.新增蓝牙权限描述

    Xcode报错:-> 0x1af14395c <+8>: b.lo 0x1af143978 ; <+36>

    解决方案:info.plist 文件中增加Privacy - Bluetooth Always Usage Description字段描述

    2.TableViewCell 侧滑按钮

    iOS 13改变了侧滑按钮的图层结构,新增一层_UITableViewCellSwipeContainerView

    7B9AB1F3-C287-484A-A081-FFDE975B821A.png 6384E612-9BA3-4405-871D-1943C7107DA5.png
    获取方法:
    - (void)configSwipeBottonWithIndexPath:(NSIndexPath *)indexPath{
        UIView *targetView;
        for (UIView *t_subView in self.tableView.subviews) {
            if (@available(iOS 13.0, *)) {
                if ([NSStringFromClass([t_subView class]) isEqualToString:@"_UITableViewCellSwipeContainerView"]) {
                    for (UIView *t2_subView in t_subView.subviews) {
                        if ([NSStringFromClass([t2_subView class]) isEqualToString:@"UISwipeActionPullView"]){
                            targetView = t2_subView;
                        }
                    }
                }
            } else {
                if ([NSStringFromClass([t_subView class]) isEqualToString:@"UISwipeActionPullView"]){
                    targetView = t_subView;
                }
            }
            UIButton *deleteBtn = targetView.subviews[1];
            UIButton *settingBtn = targetView.subviews[0];
            [self configDeleteBottonWithBotton:deleteBtn];
            [self configSettingBottonWithBotton:settingBtn withIndexPath:indexPath];
        }
    }
    

    相关文章

      网友评论

          本文标题:iOS 13 适配(收集中...)

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