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

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 适配(收集中...))