iOS 14 适配ING...

【Beta】 6月22日

1. ** Pasted from *** 提示

苹果强化了对系统剪切板内容访问的提示,适度减少访问频次吧。
不过在大家都玩口令的年代,这很难控制住...

2. 系统输入法(中文输入法),某些情况下输出字符点击字符不对应。

最初升级完成时偶现,暂不能复现。

3. 子类覆盖父类的属性

以前的版本只会提示警告⚠️ ,iOS 14上开始直接报错了,编译会无法通过。

*.h
@property (nonatomic, assign, readonly, getter=isEditing) BOOL editing;
*.m
Auto property synthesis will not synthesize property 'editing'; it will be implemented by its superclass, use @dynamic to acknowledge intention
  • 原因 自动属性合成机制在覆盖父类属性时罢工,手动修复即可。
@synthesize editing = _editing;

4. UIPageControl 子视图层级变更 及 新增 API

自定义页码标签形态的需求,如: 长条形状 或 其它

iOS 14 UIPageControl 子视图层级.png
  • 曾经的方案是遍历UIPageControl子视图,添加UIImageView 来达到定制目的。
        if ([self.subviews count] == 0) {
            UIImageView * imageItem = [[UIImageView alloc] init];
            [self addSubview:imageItem];
        }
  • 新增API 看来苹果终于是注意到产品汪们的定制需求了,然并卵

看似新增的API表面上满足了定制需求,但是经过尝试仅有一条是有用的。
preferredIndicatorImage,并且需要搭配pageIndicatorTintColorcurrentPageIndicatorTintColor才能完成有限的简单定制。
如果产品汪们需要通过间距或者其它自定义图片来提现设计感,那么就实现不了了。

typedef NS_ENUM(NSInteger, UIPageControlInteractionState) {
    /// The default interaction state, where no interaction has occured.
    UIPageControlInteractionStateNone        = 0,
    /// The interaction state for which the page was changed via a single, discrete interaction.
    UIPageControlInteractionStateDiscrete    = 1,
    /// The interaction state for which the page was changed via a continuous interaction.
    UIPageControlInteractionStateContinuous  = 2,
} API_AVAILABLE(ios(14.0));

typedef NS_ENUM(NSInteger, UIPageControlBackgroundStyle) {
    /// The default background style that adapts based on the current interaction state.
    UIPageControlBackgroundStyleAutomatic  = 0,
    /// The background style that shows a full background regardless of the interaction
    UIPageControlBackgroundStyleProminent  = 1,
    /// The background style that shows a minimal background regardless of the interaction
    UIPageControlBackgroundStyleMinimal    = 2,
} API_AVAILABLE(ios(14.0));

/// The preferred background style. Default is UIPageControlBackgroundStyleAutomatic on iOS, and UIPageControlBackgroundStyleProminent on tvOS.
@property (nonatomic, assign) UIPageControlBackgroundStyle backgroundStyle API_AVAILABLE(ios(14.0));

/// Returns YES if the continuous interaction is enabled, NO otherwise. Default is YES.
@property (nonatomic, assign) BOOL allowsContinuousInteraction API_AVAILABLE(ios(14.0));

/// The preferred image for indicators. Symbol images are recommended. Default is nil.
@property (nonatomic, strong, nullable) UIImage *preferredIndicatorImage API_AVAILABLE(ios(14.0));

/*!
 * @abstract Returns the override indicator image for the specific page, nil if no override image was set.
 * @param page Must be in the range of 0..numberOfPages
 */
- (nullable UIImage *)indicatorImageForPage:(NSInteger)page API_AVAILABLE(ios(14.0));

/*!
 * @abstract Override the indicator image for a specific page. Symbol images are recommended.
 * @param image    The image for the indicator. Resets to the default if image is nil.
 * @param page      Must be in the range of 0..numberOfPages
 */
- (void)setIndicatorImage:(nullable UIImage *)image forPage:(NSInteger)page API_AVAILABLE(ios(14.0));

  • 老调重弹 为了满足别出心裁的设计,仍然需要通过遍历的方法。
  //遍历到如下层级 并添加 UIImageView 来完成定制
  UIPageControlindicatorContentView

5. Xcode 12 beta 真机调试崩溃 TXIJKSDLGLView 相关

模拟器 及 真机非调试运行,无崩溃。

#0  0x00000001aedcea20 in  ()
#1  0x00000001aedce990 in abort ()
#2  0x00000001aedcdd30 in __assert_rtn ()
#3  0x00000001c50068e0 in  ()
#4  0x00000001c4fefb18 in MTLReportFailure ()
#5  0x00000001c4fe9464 in _MTLMessageContextEnd ()
#6  0x00000001e3a072f4 in  ()
#7  0x00000001cc699218 in  ()
#8  0x00000001cc6994f0 in  ()
#9  0x00000001cc697c90 in  ()
#10 0x00000001cc694e84 in  ()
#11 0x00000001cc695204 in gldLoadFramebuffer ()
#12 0x00000001cc63106c in  ()
#13 0x00000001cc5dd3ac in  ()
#14 0x0000000105957160 in clear(__GLIContextRec*, unsigned int) ()
#15 0x00000001028146fc in qcloud_IJK_GLES2_Renderer_renderOverlay ()
#16 0x000000010281270c in -[TXIJKSDLGLView displayInternal:] ()
#17 0x00000001028124cc in -[TXIJKSDLGLView display:] ()
#18 0x00000001028120ec in -[TXIJKSDLGLView layoutSubviews] ()
#19 0x00000001b3c9d76c in  ()
#20 0x00000001b6b04c74 in  ()
#21 0x00000001b6b0b128 in  ()
#22 0x00000001b6b163e8 in  ()
#23 0x00000001b6a642a0 in  ()
#24 0x00000001b6a8e450 in  ()
#25 0x00000001b6a8f700 in  ()
#26 0x00000001af0f68fc in  ()
#27 0x00000001af0f135c in  ()
#28 0x00000001af0f1808 in  ()
#29 0x00000001af0f1030 in CFRunLoopRunSpecific ()
#30 0x00000001bab42598 in GSEventRunModal ()
#31 0x00000001b37a9570 in  ()
#32 0x00000001b37af330 in UIApplicationMain ()
#33 0x0000000100d257c4 in main at /Users/***/main.m:14
#34 0x00000001aef859d0 in  ()

6. UITableViewCell 层级调整 强制要求

自定义子视图,曾经可以添加在selfcontentView 上均可。
以后需要注意了,必须按照苹果的规范。

// Custom subviews should be added to the content view.
@property (nonatomic, readonly, strong) UIView *contentView;
  • 影响: 不添加在 contentView 上的子视图,存在点击事件无法响应以及视图被系统默认高亮效果覆盖的问题。

7. YYTextView 拼音输入法 联想词功能失效

模拟器看起来正常
真机上目前是必现的
这里要说声抱歉咯,如果曾经有人参照我的方法来解决不释放的问题。那么记得改回来哦
改回来,你就会发现正常了

YYTextView.m 
line: 3268
#pragma mark - @protocol UIKeyInput

`复原此方法 !!!`
- (BOOL)hasText {
    //return NO;
    return _innerText.length > 0;
}

8. 腾讯短视频 SDK 需要等待适配

TXVideoEditer
视频文件裁剪功能异常,视频音频数据会被破坏从而造成收音机噪声的效果。

9. Xcode12 beta 旧项目创建 Widget 扩展项目报错

注意两点:

  1. Build System: Legacy Build System (Depercate) --> New Build System (Default)
  2. Per-User Workspace Settings: Build System: Use Shared Setting
Xcode12.png

10. 系统原生导航栏按钮长按触发 _UIContextMenuContainerView

iOS 14 UIMenu新增能力,苹果不地道的没有留属性控制。

相关内容查阅:
https://developer.apple.com/documentation/uikit/uicontextmenuinteraction?language=objc
https://www.andyibanez.com/posts/uimenu-improvements-ios14/
https://developer.apple.com/forums/thread/653913

解决方案:自定义BBI(上面的内容中会有提交)

你可能感兴趣的:(iOS 14 适配ING...)