iOS13 适配 (9月27日)

1、UITextField

禁止使用私有方法 setValue:forKeyPath:

对于使用 _placeholderLabel.textColor 、_placeholderLabel.font 等私有方法的地方,可在基类做如下处理,或者单独替换。

-(void)setValue:(id)value forKeyPath:(NSString *)keyPath
{
    if ([keyPath isEqualToString:@"_placeholderLabel.textColor"]) {
        self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.placeholder attributes:@{NSForegroundColorAttributeName: value}];
    }
    if ([keyPath isEqualToString:@"_placeholderLabel.font"]) {
        self.attributedPlaceholder = [[NSAttributedString alloc] initWithString:self.text attributes:@{NSFontAttributeName: value}];
    }

    
}

2、searchBar

      对于使用   UITextField *searchField = [_searchBar valueForKey:@"_searchField"]; 方法的可做如下处理

#ifdef __IPHONE_13_0
        UITextField *searchField = _searchBar.searchTextField;
#else
        searchField = [_searchBar valueForKey:@"_searchField"];

#endif

需要注意的是 _searchBar.searchTextField 在xcode11之前可能会报错,所以最好分开处理。

3、模态跳转

对跳转的目标控制器需要添加如下代码,来保证可以全屏展示。

    self.modalPresentationStyle = UIModalPresentationFullScreen;

4、未使用主线程报错

[UIView layer] must be used from main thread only

这时需要将报错的地方添加到主线程即可:

dispatch_async(dispatch_get_main_queue(), ^{
        
        
    });

5、三方登录失效

模拟器三方登录失效

解决方法:更新SDK,如果同时使用SMS,建议同时更新

6、友盟崩溃

[_LSDefaults sharedInstance]: unrecognized selector sent to class 0x1d2a0eaa0

升级友盟

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值