marinofaggiana 5 years ago
parent
commit
f09d7c9bbe
4 changed files with 8 additions and 52 deletions
  1. 2 2
      Share/CCCellShareExt.xib
  2. 5 8
      Share/CCloadItemData.swift
  3. 1 2
      Share/NCSelectDestination.h
  4. 0 40
      Share/NCSelectDestination.m

+ 2 - 2
Share/CCCellShareExt.xib

@@ -24,7 +24,7 @@
                         </constraints>
                     </imageView>
                     <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="VsB-d4-Sow">
-                        <rect key="frame" x="90" y="30" width="497" height="20"/>
+                        <rect key="frame" x="90" y="20" width="497" height="20"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="20" id="Dk0-na-bfK"/>
                         </constraints>
@@ -48,8 +48,8 @@
                     <constraint firstAttribute="bottom" secondItem="0Ow-Hb-LiN" secondAttribute="bottom" constant="5" id="ObO-OF-tvn"/>
                     <constraint firstItem="0Ow-Hb-LiN" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="PFo-Au-ORj"/>
                     <constraint firstAttribute="trailing" secondItem="VsB-d4-Sow" secondAttribute="trailing" constant="10" id="Q94-2Q-wue"/>
-                    <constraint firstItem="VsB-d4-Sow" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="Vrf-0g-BdO"/>
                     <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" constant="10" id="fuA-E4-YoA"/>
+                    <constraint firstItem="VsB-d4-Sow" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="20" id="pdW-jk-v6V"/>
                 </constraints>
             </tableViewCellContentView>
             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>

+ 5 - 8
Share/CCloadItemData.swift

@@ -30,7 +30,6 @@ class CCloadItemData: NSObject {
         
         var filesName: [String] = []
         var conuter = 0
-        let hud = CCHud(view: vc.view)!
         
         CCUtility.clearTmpDirectory()
                 
@@ -51,11 +50,13 @@ class CCloadItemData: NSObject {
                     
                     for (index, current) in (attachments.enumerated()) {
                         
-                        if current.hasItemConformingToTypeIdentifier(kUTTypeItem as String) {
+                        if current.hasItemConformingToTypeIdentifier(kUTTypeItem as String) || current.hasItemConformingToTypeIdentifier("public.url") {
                             
-                            hud.visibleIndeterminateHud()
+                            var typeIdentifier = ""
+                            if current.hasItemConformingToTypeIdentifier(kUTTypeItem as String) { typeIdentifier = kUTTypeItem as String }
+                            if current.hasItemConformingToTypeIdentifier("public.url") { typeIdentifier = "public.url" }
                             
-                            current.loadItem(forTypeIdentifier: kUTTypeItem as String, options: nil, completionHandler: {(item, error) -> Void in
+                            current.loadItem(forTypeIdentifier: typeIdentifier, options: nil, completionHandler: {(item, error) -> Void in
                                 
                                 var fileNameOriginal: String?
                                 var fileName: String = ""
@@ -181,12 +182,8 @@ class CCloadItemData: NSObject {
                                     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)
                                     }
                                     
-                                } else {
-                                    
-                                    hud.performSelector(onMainThread: #selector(CCHud.hideHud), with: nil, waitUntilDone: false)
                                 }
                             })
                             

+ 1 - 2
Share/NCSelectDestination.h

@@ -22,7 +22,6 @@
 //
 
 #import <UIKit/UIKit.h>
-#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
 
 #import "CCBKPasscode.h"
 #import "CCUtility.h"
@@ -32,7 +31,7 @@
 
 @protocol NCSelectDestinationDelegate;
 
-@interface NCSelectDestination : UITableViewController <UIAlertViewDelegate, UITableViewDelegate, BKPasscodeViewControllerDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
+@interface NCSelectDestination : UITableViewController <UIAlertViewDelegate, UITableViewDelegate, BKPasscodeViewControllerDelegate>
 
 @property (nonatomic, weak) id <NCSelectDestinationDelegate> delegate;
 

+ 0 - 40
Share/NCSelectDestination.m

@@ -89,14 +89,11 @@
     // TableView : at the end of rows nothing
     self.tableView.tableFooterView = [UIView new];
     self.tableView.separatorColor =  NCBrandColor.sharedInstance.separator;
-    self.tableView.emptyDataSetDelegate = self;
-    self.tableView.emptyDataSetSource = self;
 
     // get auto upload folder
     _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
     _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:activeUrl];
     
-    // read file->folder
     [self readFolder];
 }
 
@@ -125,43 +122,6 @@
     self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView;
 }
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
-{
-    if (_loadingFolder)
-        return YES;
-    else
-        return NO;
-}
-
-- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
-{
-    return NO;
-}
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return NCBrandColor.sharedInstance.backgroundView;
-}
-
-- (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
-{
-    if (_loadingFolder) {
-        
-        UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
-        activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
-        activityView.color = NCBrandColor.sharedInstance.brandElement;
-        [activityView startAnimating];
-        
-        return activityView;
-    }
-    
-    return nil;
-}
-
 // MARK: - IBAction
 
 - (IBAction)cancel:(UIBarButtonItem *)sender