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 <redacted> ()
#1  0x00000001aedce990 in abort ()
#2  0x00000001aedcdd30 in __assert_rtn ()
#3  0x00000001c50068e0 in <redacted> ()
#4  0x00000001c4fefb18 in MTLReportFailure ()
#5  0x00000001c4fe9464 in _MTLMessageContextEnd ()
#6  0x00000001e3a072f4 in <redacted> ()
#7  0x00000001cc699218 in <redacted> ()
#8  0x00000001cc6994f0 in <redacted> ()
#9  0x00000001cc697c90 in <redacted> ()
#10 0x00000001cc694e84 in <redacted> ()
#11 0x00000001cc695204 in gldLoadFramebuffer ()
#12 0x00000001cc63106c in <redacted> ()
#13 0x00000001cc5dd3ac in <redacted> ()
#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 <redacted> ()
#20 0x00000001b6b04c74 in <redacted> ()
#21 0x00000001b6b0b128 in <redacted> ()
#22 0x00000001b6b163e8 in <redacted> ()
#23 0x00000001b6a642a0 in <redacted> ()
#24 0x00000001b6a8e450 in <redacted> ()
#25 0x00000001b6a8f700 in <redacted> ()
#26 0x00000001af0f68fc in <redacted> ()
#27 0x00000001af0f135c in <redacted> ()
#28 0x00000001af0f1808 in <redacted> ()
#29 0x00000001af0f1030 in CFRunLoopRunSpecific ()
#30 0x00000001bab42598 in GSEventRunModal ()
#31 0x00000001b37a9570 in <redacted> ()
#32 0x00000001b37af330 in UIApplicationMain ()
#33 0x0000000100d257c4 in main at /Users/***/main.m:14
#34 0x00000001aef859d0 in <redacted> ()

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(上面的内容中会有提交)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,242评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,769评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,484评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,133评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,007评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,080评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,496评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,190评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,464评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,549评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,330评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,205评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,567评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,889评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,160评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,475评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,650评论 2 335