Преглед изворни кода

Fix imageNamed: for use_frameworks! in CocoaPods

Fix imageNamed: for use_frameworks! in CocoaPods
MJLee пре 10 година
родитељ
комит
5d3f15a431

+ 1 - 1
MJRefresh.podspec

@@ -1,6 +1,6 @@
 Pod::Spec.new do |s|
   s.name         = "MJRefresh"
-  s.version      = "2.3.0"
+  s.version      = "2.3.2"
   s.summary      = "The easiest way to use pull-to-refresh"
   s.homepage     = "https://github.com/CoderMJLee/MJRefresh"
   s.license      = "MIT"

+ 5 - 1
MJRefresh/Custom/Header/MJRefreshNormalHeader.m

@@ -20,7 +20,11 @@ @implementation MJRefreshNormalHeader
 - (UIImageView *)arrowView
 {
     if (!_arrowView) {
-        UIImageView *arrowView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:MJRefreshSrcName(@"arrow.png")]];
+        UIImage *image = [UIImage imageNamed:MJRefreshSrcName(@"arrow.png")];
+        if (!image) {
+            image = [UIImage imageNamed:MJRefreshFrameworkSrcName(@"arrow.png")];
+        }
+        UIImageView *arrowView = [[UIImageView alloc] initWithImage:image];
         [self addSubview:_arrowView = arrowView];
     }
     return _arrowView;

+ 1 - 0
MJRefresh/MJRefreshConst.h

@@ -28,6 +28,7 @@
 
 // 图片路径
 #define MJRefreshSrcName(file) [@"MJRefresh.bundle" stringByAppendingPathComponent:file]
+#define MJRefreshFrameworkSrcName(file) [@"Frameworks/MJRefresh.framework/MJRefresh.bundle" stringByAppendingPathComponent:file]
 
 // 常量
 UIKIT_EXTERN const CGFloat MJRefreshHeaderHeight;

BIN
MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate