Marino 8 anni fa
parent
commit
c7761a5725

+ 3 - 23
Share Ext/CCloadItemData.swift

@@ -24,26 +24,6 @@
 import UIKit
 import MobileCoreServices
 
-fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
-  switch (lhs, rhs) {
-  case let (l?, r?):
-    return l < r
-  case (nil, _?):
-    return true
-  default:
-    return false
-  }
-}
-
-fileprivate func > <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
-  switch (lhs, rhs) {
-  case let (l?, r?):
-    return l > r
-  default:
-    return rhs < lhs
-  }
-}
-
 class CCloadItemData: NSObject {
     
     func loadFiles(_ directoryUser: String, extensionContext: NSExtensionContext, vc: ShareViewController)
@@ -85,9 +65,9 @@ class CCloadItemData: NSObject {
                                         
                                         print("item as UIImage")
                                         
-                                        let pngImageData = UIImagePNGRepresentation(image)
+                                        let pngImageData : Data? = UIImagePNGRepresentation(image)
                                         
-                                        if pngImageData?.count > 0 {
+                                        if pngImageData != nil {
                                         
                                             let fileName = "\(dateFormatter.string(from: Date()))\(conuter).png"
                                             let filenamePath = directoryUser + "/" + fileName
@@ -168,7 +148,7 @@ class CCloadItemData: NSObject {
                                         }
                                     }
                                     
-                                    if index+1 == attachments.count {
+                                    if index + 1 == attachments.count {
                                         
                                         vc.performSelector(onMainThread: #selector(vc.reloadData), with:filesName, waitUntilDone: false)
                                         hud?.performSelector(onMainThread: #selector(CCHud.hideHud), with: nil, waitUntilDone: false)

+ 7 - 0
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -98,6 +98,13 @@
     [self.navigationController cancelCCProgress];
 }
 
+- (void)didReceiveMemoryWarning
+{
+    [super didReceiveMemoryWarning];
+    
+    // Dispose of any resources that can be recreated.
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ====== Photos ======
 #pragma --------------------------------------------------------------------------------------------