Skip to content

Commit 21adc9b

Browse files
committed
fix 转成静态库crash
修复在CocoaPods 1.9+版本中链接方式改为静态崩溃. Podfile文件 use_frameworks! :linkage => :static
1 parent 042a250 commit 21adc9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/Animator/ESRefreshHeaderAnimator.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ open class ESRefreshHeaderAnimator: UIView, ESRefreshProtocol, ESRefreshAnimator
4747

4848
fileprivate let imageView: UIImageView = {
4949
let imageView = UIImageView.init()
50-
if /* Carthage */ let bundle = Bundle.init(identifier: "com.eggswift.ESPullToRefresh") {
50+
let frameworkBundle = Bundle(for: ESRefreshAnimator.self)
51+
if /* CocoaPods static */ let path = frameworkBundle.path(forResource: "ESPullToRefresh", ofType: "bundle"),let bundle = Bundle(path: path) {
52+
imageView.image = UIImage(named: "icon_pull_to_refresh_arrow", in: bundle, compatibleWith: nil)
53+
}else if /* Carthage */ let bundle = Bundle.init(identifier: "com.eggswift.ESPullToRefresh") {
5154
imageView.image = UIImage(named: "icon_pull_to_refresh_arrow", in: bundle, compatibleWith: nil)
5255
} else if /* CocoaPods */ let bundle = Bundle.init(identifier: "org.cocoapods.ESPullToRefresh") {
5356
imageView.image = UIImage(named: "ESPullToRefresh.bundle/icon_pull_to_refresh_arrow", in: bundle, compatibleWith: nil)

0 commit comments

Comments
 (0)