iOS

iOS 13及Xcode 11工作总结

Posted by lingjye on October 8, 2019
  1. XCode 11 提示 IPA processing failed
1
2
3
4
5
6
7
8
进入framework目录下
cd FrameworkPath/OrionServiceSDK.framework
查看支持的架构:i386 x86_64 armv7 arm64 
lipo -info OrionServiceSDK
剔除i386
lipo -remove i386 OrionServiceSDK -o OrionServiceSDK
剔除x86_64
lipo -remove x86_64 OrionServiceSDK -o OrionServiceSDK
  1. iOS 13 移除Tabbar黑线
1
2
3
4
5
6
7
8
if (@available(iOS 13.0, *)) {
    UITabBarAppearance *appearance = [UITabBarAppearance new];
    appearance.backgroundColor = [UIColor whiteColor];
    appearance.backgroundImage = [UIImage new];
    appearance.shadowColor = [UIColor clearColor];
    appearance.shadowImage = [UIImage new];
    self.standardAppearance = appearance;
}
  1. 暗色模式需要适配

  2. KVC方式访问属性崩溃

1
修改UITextfield的placeholder颜色可以通过设置attributedPlaceholder实现。可以设置
  1. UISegmentedControl样式更改

  2. LaunchImage更换LaunchScreen

  3. Xcode 11下获取App名称CFBundleDisplayName返回nil,

1
在info.plist里面添加 Bundle display name 并设置值
  1. 暗色模式下的状态栏始终显示黑色
1
2
3
4
5
6
- (UIStatusBarStyle)preferredStatusBarStyle {
    if (@available(iOS 13.0, *)) {
        return UIStatusBarStyleDarkContent;
    }
    return UIStatusBarStyleDefault;
}
  1. LaunchImage设置,建议使用LaunchScreen
1
前往Build Setting搜索launch image编辑对应值
  1. 在- (void)layoutSubviews中不要设置自身frame,(在早期iOS系统中一样,iOS 10之前),会导致卡死。