Răsfoiți Sursa

bugfix:#10
bumping the version to 0.9.3

ibireme 9 ani în urmă
părinte
comite
9ec114a834
4 a modificat fișierele cu 17 adăugiri și 34 ștergeri
  1. 1 1
      Framework/Info.plist
  2. 1 1
      YYText.podspec
  3. 0 10
      YYText/String/YYTextAttribute.m
  4. 15 22
      YYText/YYTextView.m

+ 1 - 1
Framework/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.9.2</string>
+	<string>0.9.3</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>

+ 1 - 1
YYText.podspec

@@ -1,7 +1,7 @@
 Pod::Spec.new do |s|
   s.name         = 'YYText'
   s.summary      = 'Powerful text framework for iOS to display and edit rich text.'
-  s.version      = '0.9.2'
+  s.version      = '0.9.3'
   s.license      = { :type => 'MIT', :file => 'LICENSE' }
   s.authors      = { 'ibireme' => 'ibireme@gmail.com' }
   s.social_media_url = 'http://blog.ibireme.com'

+ 0 - 10
YYText/String/YYTextAttribute.m

@@ -16,16 +16,6 @@
 #import "YYTextArchiver.h"
 
 
-#if __has_include("YYImage.h")
-#import "YYImage.h"
-#define YYTextAnimatedImageAvailable 1
-#elif __has_include(<YYImage/YYImage.h>)
-#import <YYImage/YYImage.h>
-#define YYTextAnimatedImageAvailable 1
-#else
-#define YYTextAnimatedImageAvailable 0
-#endif
-
 static float _YYDeviceSystemVersion() {
     static float version;
     static dispatch_once_t onceToken;

+ 15 - 22
YYText/YYTextView.m

@@ -24,18 +24,6 @@
 #import "UIView+YYText.h"
 
 
-#if __has_include("YYImage.h")
-#import "YYImage.h"
-#define YYTextAnimatedImageAvailable 1
-#elif __has_include(<YYImage/YYImage.h>)
-#import <YYImage/YYImage.h>
-#define YYTextAnimatedImageAvailable 1
-#else
-#define YYTextAnimatedImageAvailable 0
-#endif
-
-
-
 static float _YYDeviceSystemVersion() {
     static float version;
     static dispatch_once_t onceToken;
@@ -2858,17 +2846,22 @@ typedef NS_ENUM(NSUInteger, YYTextMoveDirection) {
     if (!atr && _allowsPasteImage) {
         UIImage *img = nil;
         
-        #if YYTextAnimatedImageAvailable
-        if (p.yy_GIFData) {
-            img = [YYImage imageWithData:p.yy_GIFData scale:YYTextScreenScale()];
-        }
-        if (!img && p.yy_PNGData) {
-            img = [YYImage imageWithData:p.yy_PNGData scale:YYTextScreenScale()];
-        }
-        if (!img && p.yy_WEBPData) {
-            img = [YYImage imageWithData:p.yy_WEBPData scale:YYTextScreenScale()];
+        Class cls = NSClassFromString(@"YYImage");
+        if (cls) {
+            NSNumber *scale = @(YYTextScreenScale());
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundeclared-selector"
+            if (p.yy_GIFData) {
+                img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_PNGData withObject:scale];
+            }
+            if (!img && p.yy_PNGData) {
+                img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_PNGData withObject:scale];
+            }
+            if (!img && p.yy_WEBPData) {
+                img = [(id)cls performSelector:@selector(imageWithData:scale:) withObject:p.yy_WEBPData withObject:scale];
+            }
+#pragma clang diagnostic pop
         }
-        #endif
         
         if (!img) {
             img = p.image;