Skip to content

Commit

Permalink
暂时修复 Xcode 14.0 iOS12 Release Mode Crash 疑似苹果编译器漏洞
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiang1994 committed Oct 9, 2022
1 parent 7e86246 commit c7e668d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AttributedString.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

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

s.homepage = "https://github.com/lixiang1994/AttributedString"
Expand Down
7 changes: 6 additions & 1 deletion Sources/Extension/ObjectExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ extension AssociatedWrapper where Base: NSObject {

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

/// 设置关联值 OBJC_ASSOCIATION_ASSIGN
Expand Down

0 comments on commit c7e668d

Please sign in to comment.