Skip to content

Commit c7e668d

Browse files
committed
暂时修复 Xcode 14.0 iOS12 Release Mode Crash 疑似苹果编译器漏洞
1 parent 7e86246 commit c7e668d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

AttributedString.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "AttributedString"
4-
s.version = "3.3.3"
4+
s.version = "3.3.4"
55
s.summary = "基于Swift字符串插值快速构建你想要的富文本, 支持点击按住等事件获取, 支持多种类型过滤"
66

77
s.homepage = "https://github.com/lixiang1994/AttributedString"

Sources/Extension/ObjectExtension.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ extension AssociatedWrapper where Base: NSObject {
4343

4444
/// 获取关联值
4545
func get<T>(_ key: UnsafeRawPointer) -> T? {
46-
objc_getAssociatedObject(base, key) as? T
46+
guard let value = objc_getAssociatedObject(base, key) else {
47+
return nil
48+
}
49+
return (value as! T)
50+
// 💣 Xcode 14.0 iOS12 Release Mode Crash 疑似苹果编译器漏洞
51+
//objc_getAssociatedObject(base, key) as? T
4752
}
4853

4954
/// 设置关联值 OBJC_ASSOCIATION_ASSIGN

0 commit comments

Comments
 (0)