Browse Source

Merge branch 'DocumentPicker'

Marino Faggiana 8 years ago
parent
commit
62189e6e28
100 changed files with 2755 additions and 318 deletions
  1. 16 5
      Libraries external/AHKActionSheet/AHKActionSheet.h
  2. 30 21
      Libraries external/AHKActionSheet/AHKActionSheet.m
  3. 0 1
      Libraries external/AHKActionSheet/AHKActionSheetViewController.m
  4. 1 1
      Libraries external/BKPasscodeView/BKPasscodeInputView.m
  5. 1 1
      Libraries external/BKPasscodeView/BKPasscodeLockScreenManager.m
  6. 2 2
      Libraries external/BKPasscodeView/BKPasscodeViewController.m
  7. 496 13
      Nextcloud.xcodeproj/project.pbxproj
  8. 119 0
      Picker/Base.lproj/MainInterface.storyboard
  9. 852 0
      Picker/DocumentPickerViewController.swift
  10. 56 0
      Picker/Info.plist
  11. 13 0
      Picker/Picker-Bridging-Header.h
  12. 14 0
      Picker/Picker.entitlements
  13. 101 0
      PickerFileProvider/FileProvider.swift
  14. 33 0
      PickerFileProvider/Info.plist
  15. 14 0
      PickerFileProvider/PickerFileProvider.entitlements
  16. 1 1
      Share Ext/InfoNextcloud.plist
  17. 3 3
      Share Ext/ShareViewController.m
  18. 3 1
      iOSClient/AppDelegate.h
  19. 113 10
      iOSClient/AppDelegate.m
  20. 18 15
      iOSClient/CCGlobal.h
  21. 8 10
      iOSClient/CCImages.h
  22. 264 0
      iOSClient/Create/CCCreateCloud.swift
  23. 18 5
      iOSClient/Favorite/CCFavorite.m
  24. 21 0
      iOSClient/Images.xcassets/Plus.imageset/Contents.json
  25. BIN
      iOSClient/Images.xcassets/Plus.imageset/Plus@2x.png
  26. BIN
      iOSClient/Images.xcassets/accountweb.imageset/accountweb.png
  27. BIN
      iOSClient/Images.xcassets/accountweb.imageset/accountweb@2x.png
  28. BIN
      iOSClient/Images.xcassets/accountweb.imageset/accountweb@3x.png
  29. BIN
      iOSClient/Images.xcassets/bancomat.imageset/bancomat.png
  30. BIN
      iOSClient/Images.xcassets/bancomat.imageset/bancomat@2x.png
  31. BIN
      iOSClient/Images.xcassets/bancomat.imageset/bancomat@3x.png
  32. BIN
      iOSClient/Images.xcassets/baseurl.imageset/baseurl.png
  33. BIN
      iOSClient/Images.xcassets/baseurl.imageset/baseurl@2x.png
  34. BIN
      iOSClient/Images.xcassets/baseurl.imageset/baseurl@3x.png
  35. BIN
      iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito.png
  36. BIN
      iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito@2x.png
  37. BIN
      iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito@3x.png
  38. BIN
      iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita.png
  39. BIN
      iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita@2x.png
  40. BIN
      iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita@3x.png
  41. BIN
      iOSClient/Images.xcassets/contocorrente.imageset/contocorrente.png
  42. BIN
      iOSClient/Images.xcassets/contocorrente.imageset/contocorrente@2x.png
  43. BIN
      iOSClient/Images.xcassets/contocorrente.imageset/contocorrente@3x.png
  44. 23 0
      iOSClient/Images.xcassets/importCloud.imageset/Contents.json
  45. BIN
      iOSClient/Images.xcassets/importCloud.imageset/importCloud.png
  46. BIN
      iOSClient/Images.xcassets/importCloud.imageset/importCloud@2x.png
  47. BIN
      iOSClient/Images.xcassets/importCloud.imageset/importCloud@3x.png
  48. 23 0
      iOSClient/Images.xcassets/importCloudCrypto.imageset/Contents.json
  49. BIN
      iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto.png
  50. BIN
      iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto@2x.png
  51. BIN
      iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto@3x.png
  52. BIN
      iOSClient/Images.xcassets/note.imageset/note.png
  53. BIN
      iOSClient/Images.xcassets/note.imageset/note@2x.png
  54. BIN
      iOSClient/Images.xcassets/note.imageset/note@3x.png
  55. 6 6
      iOSClient/Images.xcassets/passaporto.imageset/Contents.json
  56. BIN
      iOSClient/Images.xcassets/passaporto.imageset/passaporto.png
  57. BIN
      iOSClient/Images.xcassets/passaporto.imageset/passaporto@2x.png
  58. BIN
      iOSClient/Images.xcassets/passaporto.imageset/passaporto@3x.png
  59. BIN
      iOSClient/Images.xcassets/patenteguida.imageset/patenteguida.png
  60. BIN
      iOSClient/Images.xcassets/patenteguida.imageset/patenteguida@2x.png
  61. BIN
      iOSClient/Images.xcassets/patenteguida.imageset/patenteguida@3x.png
  62. BIN
      iOSClient/Images.xcassets/photo.imageset/photo.png
  63. BIN
      iOSClient/Images.xcassets/photo.imageset/photo@2x.png
  64. BIN
      iOSClient/Images.xcassets/photo.imageset/photo@3x.png
  65. BIN
      iOSClient/Images.xcassets/photocrypto.imageset/photocrypto.png
  66. BIN
      iOSClient/Images.xcassets/photocrypto.imageset/photocrypto@2x.png
  67. BIN
      iOSClient/Images.xcassets/photocrypto.imageset/photocrypto@3x.png
  68. 23 0
      iOSClient/Images.xcassets/template.imageset/Contents.json
  69. BIN
      iOSClient/Images.xcassets/template.imageset/template@1x.png
  70. BIN
      iOSClient/Images.xcassets/template.imageset/template@2x.png
  71. BIN
      iOSClient/Images.xcassets/template.imageset/template@3x.png
  72. 1 1
      iOSClient/InfoPlist/InfoNextcloud.plist
  73. 1 1
      iOSClient/Login/CCLoginNCOC.m
  74. 3 0
      iOSClient/Main/CCDetail.m
  75. 4 3
      iOSClient/Main/CCMain.h
  76. 238 128
      iOSClient/Main/CCMain.m
  77. 1 0
      iOSClient/Main/CCSplit.m
  78. 83 43
      iOSClient/Main/Main.storyboard
  79. 4 4
      iOSClient/Move/CCMove.m
  80. 21 16
      iOSClient/Networking/CCNetworking.m
  81. 1 1
      iOSClient/Networking/OCNetworking.h
  82. 13 26
      iOSClient/Networking/OCNetworking.m
  83. 7 0
      iOSClient/Nextcloud-Bridging-Header.h
  84. 14 0
      iOSClient/Nextcloud.entitlements
  85. 23 0
      iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/Contents.json
  86. BIN
      iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@1x.png
  87. BIN
      iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@2x.png
  88. BIN
      iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@3x.png
  89. 23 0
      iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/Contents.json
  90. BIN
      iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@1x.png
  91. BIN
      iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@2x.png
  92. BIN
      iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@3x.png
  93. 23 0
      iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/Contents.json
  94. BIN
      iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@1x.png
  95. BIN
      iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@2x.png
  96. BIN
      iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@3x.png
  97. 23 0
      iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/Contents.json
  98. BIN
      iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@1x.png
  99. BIN
      iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@2x.png
  100. BIN
      iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@3x.png

+ 16 - 5
Libraries external/AHKActionSheet/AHKActionSheet.h

@@ -12,7 +12,7 @@ typedef NS_ENUM(NSInteger, AHKActionSheetButtonType) {
     AHKActionSheetButtonTypeDefault = 0,
 	AHKActionSheetButtonTypeDisabled,
     AHKActionSheetButtonTypeDestructive,
-    AHKActionSheetButtonTypeCrypto
+    AHKActionSheetButtonTypeEncrypted
 };
 
 @class AHKActionSheet;
@@ -35,6 +35,8 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 @property (nonatomic) CGFloat buttonHeight UI_APPEARANCE_SELECTOR;
 /// Height of the cancel button.
 @property (nonatomic) CGFloat cancelButtonHeight UI_APPEARANCE_SELECTOR;
+/// Height separator from cancelButtonHeight and table
+@property (nonatomic) CGFloat separatorHeight UI_APPEARANCE_SELECTOR;
 /**
  *  If set, a small shadow (a gradient layer) will be drawn above the cancel button to separate it visually from the other buttons.
  *  It's best to use a color similar (but maybe with a lower alpha value) to blurTintColor.
@@ -54,7 +56,7 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 @property (copy, nonatomic) NSDictionary *buttonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *disabledButtonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *destructiveButtonTextAttributes UI_APPEARANCE_SELECTOR;
-@property (copy, nonatomic) NSDictionary *cryptoButtonTextAttributes UI_APPEARANCE_SELECTOR;
+@property (copy, nonatomic) NSDictionary *encryptedButtonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *cancelButtonTextAttributes UI_APPEARANCE_SELECTOR;
 /// Duration of the show/dismiss animations. Defaults to 0.5.
 @property (nonatomic) NSTimeInterval animationDuration UI_APPEARANCE_SELECTOR;
@@ -75,8 +77,7 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 @property (strong, nonatomic) UIView *headerView;
 /// Window visible before the actionSheet was presented.
 @property (weak, nonatomic, readonly) UIWindow *previousKeyWindow;
-
-///TWS
+/// View actionSheet was presented.
 @property (nonatomic, weak) UIView *view;
 
 /**
@@ -90,6 +91,16 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
  */
 - (instancetype)initWithTitle:(NSString *)title;
 
+/**
+ *  Initializes the action sheet with a specified view and title. `headerView` can be used if a string is insufficient for the title; set `title` as `nil` in this case.
+ *
+ *  It's the designated initializer.
+ *
+ *  @param view
+ *  @param title A string to display in the title area, above the buttons.
+ *
+ *  @return A newly initialized action sheet.
+ */
 - (instancetype)initWithView:(UIView *)view title:(NSString *)title;
 
 /**
@@ -105,7 +116,7 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
  *  @param image   The image to display on the left of the title.
  *  @param handler A completion handler block to execute when a dismissal animation (after the user tapped on the button) has finished.
  */
-- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler;
+- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler;
 
 /// Displays the action sheet.
 - (void)show;

+ 30 - 21
Libraries external/AHKActionSheet/AHKActionSheet.m

@@ -23,7 +23,7 @@ static const CGFloat kAutoDismissOffset = 80.0f;
 static const CGFloat kFlickDownHandlingOffset = 20.0f;
 static const CGFloat kFlickDownMinVelocity = 2000.0f;
 // How much free space to leave at the top (above the tableView's contents) when there's a lot of elements. It makes this control look similar to the UIActionSheet.
-static const CGFloat kTopSpaceMarginFraction = 0.0; //TWS 0.333f;
+static const CGFloat kTopSpaceMarginFraction = 0.0f;
 // cancelButton's shadow height as the ratio to the cancelButton's height
 static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 
@@ -34,6 +34,8 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 @property (strong, nonatomic) UIImage *image;
 @property (nonatomic) AHKActionSheetButtonType type;
 @property (strong, nonatomic) AHKActionSheetHandler handler;
+@property (nonatomic, strong) UIColor *backgroundColor;
+@property (nonatomic) CGFloat height;
 @end
 
 @implementation AHKActionSheetItem
@@ -66,6 +68,7 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
     [appearance setBlurTintColor:[UIColor colorWithWhite:1.0f alpha:0.5f]];
     [appearance setBlurSaturationDeltaFactor:1.8f];
     [appearance setButtonHeight:60.0f];
+    [appearance setSeparatorHeight:0.0f];
     [appearance setCancelButtonHeight:44.0f];
     [appearance setAutomaticallyTintButtonImages:@YES];
     [appearance setSelectedBackgroundColor:[UIColor colorWithWhite:0.1f alpha:0.2f]];
@@ -135,9 +138,8 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 {
     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellIdentifier forIndexPath:indexPath];
     
-    //TWS
     cell.separatorInset = UIEdgeInsetsMake(0.f, 55.f, 0.f, 0.f);
-
+    
     AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
 
     NSDictionary *attributes = nil;
@@ -153,8 +155,8 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
         case AHKActionSheetButtonTypeDestructive:
             attributes = self.destructiveButtonTextAttributes;
             break;
-        case AHKActionSheetButtonTypeCrypto:
-            attributes = self.cryptoButtonTextAttributes;
+        case AHKActionSheetButtonTypeEncrypted:
+            attributes = self.encryptedButtonTextAttributes;
             break;
     }
 
@@ -170,8 +172,7 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
         cell.imageView.tintColor = attributes[NSForegroundColorAttributeName] ? attributes[NSForegroundColorAttributeName] : [UIColor blackColor];
     }
 
-    //TWS
-    cell.backgroundColor = [UIColor whiteColor];
+    cell.backgroundColor = item.backgroundColor;
 
     if (self.selectedBackgroundColor && ![cell.selectedBackgroundView.backgroundColor isEqual:self.selectedBackgroundColor]) {
         cell.selectedBackgroundView = [[UIView alloc] init];
@@ -194,10 +195,10 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
 {
-    return self.buttonHeight;
+    AHKActionSheetItem *item = self.items[(NSUInteger)indexPath.row];
+    return item.height;
 }
 
-//TWS
 /*
 -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
 {
@@ -218,6 +219,8 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 }
 */
 
+
+
 #pragma mark - UIScrollViewDelegate
 
 - (void)scrollViewDidScroll:(UIScrollView *)scrollView
@@ -270,14 +273,16 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
 
 - (void)addButtonWithTitle:(NSString *)title type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler
 {
-    [self addButtonWithTitle:title image:nil type:type handler:handler];
+    [self addButtonWithTitle:title image:nil backgroundColor:[UIColor whiteColor] height:self.buttonHeight type:type handler:handler];
 }
 
-- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler
+- (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler
 {
     AHKActionSheetItem *item = [[AHKActionSheetItem alloc] init];
     item.title = title;
     item.image = image;
+    item.backgroundColor = backgroundColor;
+    item.height = height;
     item.type = type;
     item.handler = handler;
     [self.items addObject:item];
@@ -299,7 +304,7 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
     [self setUpCancelButton];
     [self setUpTableView];
     
-    if (self.cancelOnPanGestureEnabled.boolValue) {
+    if (self.cancelOnTapEmptyAreaEnabled.boolValue) {
         [self setUpCancelTapGestureForView:self.tableView];
     }
     
@@ -313,18 +318,22 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
     void(^delayedAnimations)(void) = ^(void) {
         self.cancelButton.frame = CGRectMake(0,
                                              CGRectGetMaxY(self.bounds) - self.cancelButtonHeight,
-                                             CGRectGetWidth(_view.bounds),
+                                             CGRectGetWidth(self.bounds),
                                              self.cancelButtonHeight);
-        
-        //TWS
+    
+        // Add White color background
         self.cancelButton.backgroundColor = [UIColor whiteColor];
         
         self.tableView.transform = CGAffineTransformMakeTranslation(0, 0);
 
 
         // manual calculation of table's contentSize.height
-        CGFloat tableContentHeight = [self.items count] * self.buttonHeight + CGRectGetHeight(self.tableView.tableHeaderView.frame);
-
+        CGFloat tableContentHeight = 0; //[self.items count] * self.buttonHeight + CGRectGetHeight(self.tableView.tableHeaderView.frame);
+        for (AHKActionSheetItem *item in self.items) {
+            tableContentHeight = tableContentHeight + item.height;
+        }
+        tableContentHeight = tableContentHeight + self.separatorHeight + CGRectGetHeight(self.tableView.tableHeaderView.frame);
+        
         CGFloat topInset;
         BOOL buttonsFitInWithoutScrolling = tableContentHeight < CGRectGetHeight(self.tableView.frame) * (1.0 - kTopSpaceMarginFraction);
         if (buttonsFitInWithoutScrolling) {
@@ -494,7 +503,7 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
     CGFloat statusBarHeight = CGRectGetHeight(statusBarViewRect);
     CGRect frame = CGRectMake(0,
                               statusBarHeight,
-                              CGRectGetWidth(_view.bounds),
+                              CGRectGetWidth(self.bounds),
                               CGRectGetHeight(self.bounds) - statusBarHeight - self.cancelButtonHeight);
 
     UITableView *tableView = [[UITableView alloc] initWithFrame:frame];
@@ -542,7 +551,7 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
         [headerView addSubview:label];
         
         self.tableView.tableHeaderView = headerView;
-        
+
     } else if (self.headerView) {
         self.tableView.tableHeaderView = self.headerView;
     }
@@ -558,10 +567,10 @@ static const CGFloat kCancelButtonShadowHeightRatio = 0.333f;
         UIView *separator = [[UIView alloc] initWithFrame:separatorFrame];
         separator.backgroundColor = self.tableView.separatorColor;
         
-        //TWS
+        // Add line
         UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.tableView.tableHeaderView.frame), 1 / UIScreen.mainScreen.scale)];
         line.backgroundColor = self.tableView.separatorColor;
-
+        
         [self.tableView.tableHeaderView addSubview:separator];
         [self.tableView.tableHeaderView addSubview:line];
     }

+ 0 - 1
Libraries external/AHKActionSheet/AHKActionSheetViewController.m

@@ -46,7 +46,6 @@
     return !self.viewAlreadyAppear;
 }
 
-//TWS
 #if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
 - (NSUInteger)supportedInterfaceOrientations
 #else

+ 1 - 1
Libraries external/BKPasscodeView/BKPasscodeInputView.m

@@ -276,7 +276,7 @@
 
 - (CGFloat)labelPasscodeSpace
 {
-#ifdef SHARE_IN
+#ifdef EXTENSION
     return (self.frame.size.width < self.frame.size.height) ? kLabelPasscodeSpacePortrait : kLabelPasscodeSpaceLandscape;
 #else
     return UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) ? kLabelPasscodeSpacePortrait : kLabelPasscodeSpaceLandscape;

+ 1 - 1
Libraries external/BKPasscodeView/BKPasscodeLockScreenManager.m

@@ -45,7 +45,7 @@ static BKPasscodeLockScreenManager *_sharedManager;
     }
     
     // get the main window
-#ifndef SHARE_IN
+#ifndef EXTENSION
     self.mainWindow = [[UIApplication sharedApplication] keyWindow];
 
     // dismiss keyboard before showing lock screen

+ 2 - 2
Libraries external/BKPasscodeView/BKPasscodeViewController.m

@@ -383,7 +383,7 @@ typedef enum : NSUInteger {
         return NO;
     }
     
-#ifndef SHARE_IN
+#ifndef EXTENSION
     if ([UIApplication sharedApplication].applicationState == UIApplicationStateInactive) {
         return NO;
     }
@@ -563,7 +563,7 @@ typedef enum : NSUInteger {
     CGRect keyboardRect = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
 
 /*
-#ifdef SHARE_IN
+#ifdef EXTENSION
     self.keyboardHeight = CGRectGetHeight(keyboardRect);
 #else
     UIInterfaceOrientation statusBarOrientation = [[UIApplication sharedApplication] statusBarOrientation];

+ 496 - 13
Nextcloud.xcodeproj/project.pbxproj

@@ -81,6 +81,7 @@
 		F71E68001DC1F792003BA52B /* libownCloudiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F71E67FC1DC1F76F003BA52B /* libownCloudiOS.a */; };
 		F71E68021DC1F79D003BA52B /* libownCloudiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F71E67FC1DC1F76F003BA52B /* libownCloudiOS.a */; };
 		F7229B3B1DF7187F00E8C4E7 /* InfoNextcloud.plist in Resources */ = {isa = PBXBuildFile; fileRef = F7229B371DF7187F00E8C4E7 /* InfoNextcloud.plist */; };
+		F725437C1E12A44A009BF4C2 /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
 		F72764651DB8FE2A002334CD /* CCSynchronization.m in Sources */ = {isa = PBXBuildFile; fileRef = F72764631DB8FE2A002334CD /* CCSynchronization.m */; };
 		F72C63891DC14B0400FA5ED5 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
@@ -125,6 +126,67 @@
 		F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
 		F73CCE321DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
+		F74344171E1264EE001CC831 /* DocumentPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */; };
+		F743441A1E1264EE001CC831 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F74344181E1264EE001CC831 /* MainInterface.storyboard */; };
+		F74344251E1264EE001CC831 /* FileProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344241E1264EE001CC831 /* FileProvider.swift */; };
+		F743444A1E126B4D001CC831 /* CCMove.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D02A471C5F9E4400D6F972 /* CCMove.m */; };
+		F743444B1E126B69001CC831 /* CCMove.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7D02A481C5F9E4400D6F972 /* CCMove.storyboard */; };
+		F74344541E1277D8001CC831 /* libownCloudiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F71E67FC1DC1F76F003BA52B /* libownCloudiOS.a */; };
+		F74344551E1277E2001CC831 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
+		F74344561E12784A001CC831 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
+		F74344591E12786C001CC831 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
+		F743445B1E127D3B001CC831 /* BKPasscodeDummyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C01C889183008DAB36 /* BKPasscodeDummyViewController.m */; };
+		F743445C1E127D3D001CC831 /* BKPasscodeField.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C21C889183008DAB36 /* BKPasscodeField.m */; };
+		F743445D1E127D40001CC831 /* BKPasscodeInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C41C889183008DAB36 /* BKPasscodeInputView.m */; };
+		F743445E1E127D44001CC831 /* BKPasscodeLockScreenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C61C889183008DAB36 /* BKPasscodeLockScreenManager.m */; };
+		F743445F1E127D4B001CC831 /* BKPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C91C889183008DAB36 /* BKPasscodeViewController.m */; };
+		F74344601E127D4D001CC831 /* BKShiftingView.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02CB1C889183008DAB36 /* BKShiftingView.m */; };
+		F74344611E127D51001CC831 /* BKTouchIDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02CD1C889183008DAB36 /* BKTouchIDManager.m */; };
+		F74344621E127D54001CC831 /* BKTouchIDSwitchView.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02CF1C889183008DAB36 /* BKTouchIDSwitchView.m */; };
+		F74344631E127D79001CC831 /* CCBKPasscode.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125D1BAC03FB0041924B /* CCBKPasscode.m */; };
+		F74344641E127DE6001CC831 /* OCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F74D3DBE1BAC1941000BAE4B /* OCNetworking.m */; };
+		F74344651E127DE9001CC831 /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
+		F74344661E127E35001CC831 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B81D801C64E77F006D02DF /* CCCoreData.m */; };
+		F74344671E127E38001CC831 /* CCMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = F7C8C1731B482A920048180E /* CCMetadata.m */; };
+		F74344681E127E3F001CC831 /* TableAutomaticUpload+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F771CD5B1E07F6620066F76D /* TableAutomaticUpload+CoreDataClass.m */; };
+		F74344691E127E42001CC831 /* TableAutomaticUpload+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F771CD5D1E07F6620066F76D /* TableAutomaticUpload+CoreDataProperties.m */; };
+		F743446A1E127E45001CC831 /* TableCertificates+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7994B741D5B854C008525D9 /* TableCertificates+CoreDataProperties.m */; };
+		F743446B1E127E49001CC831 /* TableCertificates.m in Sources */ = {isa = PBXBuildFile; fileRef = F7994B761D5B854C008525D9 /* TableCertificates.m */; };
+		F743446C1E127E4B001CC831 /* TableLocalFile+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446451C4D29E300DBCC11 /* TableLocalFile+CoreDataProperties.m */; };
+		F743446D1E127E4E001CC831 /* TableLocalFile.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446471C4D29E300DBCC11 /* TableLocalFile.m */; };
+		F743446E1E127E51001CC831 /* TableGPS+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446491C4D29E300DBCC11 /* TableGPS+CoreDataProperties.m */; };
+		F743446F1E127E53001CC831 /* TableGPS.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B4464B1C4D29E300DBCC11 /* TableGPS.m */; };
+		F74344701E127E56001CC831 /* TableDirectory+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B4464D1C4D29E300DBCC11 /* TableDirectory+CoreDataProperties.m */; };
+		F74344711E127E59001CC831 /* TableMetadata+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446511C4D29E300DBCC11 /* TableMetadata+CoreDataProperties.m */; };
+		F74344721E127E5B001CC831 /* TableMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446531C4D29E300DBCC11 /* TableMetadata.m */; };
+		F74344731E127E5E001CC831 /* TableAccount+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446551C4D29E300DBCC11 /* TableAccount+CoreDataProperties.m */; };
+		F74344741E127E60001CC831 /* TableAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B446571C4D29E300DBCC11 /* TableAccount.m */; };
+		F74344751E127E64001CC831 /* TableShare+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EC9CCC1C4FA803008122B5 /* TableShare+CoreDataProperties.m */; };
+		F74344761E127E67001CC831 /* TableShare.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EC9CCE1C4FA803008122B5 /* TableShare.m */; };
+		F74344771E127E88001CC831 /* TableDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B4464F1C4D29E300DBCC11 /* TableDirectory.m */; };
+		F74344781E127E9E001CC831 /* CCExifGeo.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A54C351C6267B500E2C8BF /* CCExifGeo.m */; };
+		F74344791E127EA1001CC831 /* CCError.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B881C638A4C00DC4301 /* CCError.m */; };
+		F743447A1E127EA6001CC831 /* CCGraphics.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B841C6388BC00DC4301 /* CCGraphics.m */; };
+		F743447B1E127EAC001CC831 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; };
+		F743447C1E127EB2001CC831 /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
+		F743447D1E127ECB001CC831 /* AESCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AB1C889183008DAB36 /* AESCrypt.m */; };
+		F743447E1E127ECE001CC831 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AD1C889183008DAB36 /* NSData+Base64.m */; };
+		F743447F1E127ED1001CC831 /* NSData+CommonCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AF1C889183008DAB36 /* NSData+CommonCrypto.m */; };
+		F74344801E127ED3001CC831 /* NSString+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02B11C889183008DAB36 /* NSString+Base64.m */; };
+		F74344811E127F49001CC831 /* AFViewShaker.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02B41C889183008DAB36 /* AFViewShaker.m */; };
+		F74344821E127F68001CC831 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F04841C889183008DAB36 /* MBProgressHUD.m */; };
+		F74344831E127F80001CC831 /* RNCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05351C889184008DAB36 /* RNCryptor.m */; };
+		F74344841E127F84001CC831 /* RNCryptorEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05371C889184008DAB36 /* RNCryptorEngine.m */; };
+		F74344851E127F86001CC831 /* RNDecryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05391C889184008DAB36 /* RNDecryptor.m */; };
+		F74344861E127F89001CC831 /* RNEncryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F053B1C889184008DAB36 /* RNEncryptor.m */; };
+		F74344871E127F95001CC831 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
+		F74344881E127F9C001CC831 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05581C889184008DAB36 /* UIImage+animatedGIF.m */; };
+		F74344891E127FC3001CC831 /* CCGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = F7C8C1911B482CEA0048180E /* CCGlobal.m */; };
+		F743448A1E127FF2001CC831 /* CCHud.m in Sources */ = {isa = PBXBuildFile; fileRef = F7514EDB1C7B1336008F3338 /* CCHud.m */; };
+		F743448B1E12800D001CC831 /* CCCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F801011D98205A007537BC /* CCCertificate.m */; };
+		F743448C1E128010001CC831 /* CCCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125F1BAC03FB0041924B /* CCCrypto.m */; };
+		F74344921E128EB0001CC831 /* Picker.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F74344901E128E8F001CC831 /* Picker.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+		F74344931E128EB4001CC831 /* PickerFileProvider.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F74344911E128E96001CC831 /* PickerFileProvider.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 		F749E4E91DC1FB38009BA2FD /* Share Ext Nextcloud.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = F7CE8AFB1DC1F8D8009CAE48 /* Share Ext Nextcloud.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 		F750374D1DBFA91A008FB480 /* ALView+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037441DBFA91A008FB480 /* ALView+PureLayout.m */; };
 		F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F75037461DBFA91A008FB480 /* NSArray+PureLayout.m */; };
@@ -220,7 +282,6 @@
 		F77B0E441D118A16002130FE /* CCIntro.m in Sources */ = {isa = PBXBuildFile; fileRef = F744BE931BEBB2EE004FFF66 /* CCIntro.m */; };
 		F77B0E451D118A16002130FE /* ReaderThumbRender.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F0ECE1C889317008DAB36 /* ReaderThumbRender.m */; };
 		F77B0E461D118A16002130FE /* BKPasscodeLockScreenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02C61C889183008DAB36 /* BKPasscodeLockScreenManager.m */; };
-		F77B0E471D118A16002130FE /* CCAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = F72137201BAFF0920012B613 /* CCAdd.m */; };
 		F77B0E481D118A16002130FE /* CCCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125F1BAC03FB0041924B /* CCCrypto.m */; };
 		F77B0E491D118A16002130FE /* UIImage+Saving.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F04CE1C889184008DAB36 /* UIImage+Saving.m */; };
 		F77B0E4C1D118A16002130FE /* CCDetail.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D0E65F1BC5042E008D989A /* CCDetail.m */; };
@@ -375,7 +436,6 @@
 		F77B0F231D118A16002130FE /* ZSSh3.png in Resources */ = {isa = PBXBuildFile; fileRef = F70F0D9D1C889300008DAB36 /* ZSSh3.png */; };
 		F77B0F241D118A16002130FE /* Reader-Button-H.png in Resources */ = {isa = PBXBuildFile; fileRef = F70F0EA41C889317008DAB36 /* Reader-Button-H.png */; };
 		F77B0F251D118A16002130FE /* ZSSh1.png in Resources */ = {isa = PBXBuildFile; fileRef = F70F0D991C889300008DAB36 /* ZSSh1.png */; };
-		F77B0F261D118A16002130FE /* Add.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F721371C1BAFF0920012B613 /* Add.storyboard */; };
 		F77B0F271D118A16002130FE /* ImageSelectedSmallOn.png in Resources */ = {isa = PBXBuildFile; fileRef = F70F0C721C8892DF008DAB36 /* ImageSelectedSmallOn.png */; };
 		F77B0F281D118A16002130FE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F787E5581BC503ED00AFBFE1 /* Main.storyboard */; };
 		F77B0F291D118A16002130FE /* ZSSleftjustify.png in Resources */ = {isa = PBXBuildFile; fileRef = F70F0DB11C889300008DAB36 /* ZSSleftjustify.png */; };
@@ -490,11 +550,14 @@
 		F7BF1B431D51E893000854F6 /* CCLoginNCOC.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BF1B401D51E893000854F6 /* CCLoginNCOC.m */; };
 		F7CE28851D1ACFA70025783C /* CCProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7CE28801D1ACFA70025783C /* CCProgressView.m */; };
 		F7CE28881D1ACFA70025783C /* UINavigationController+CCProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = F7CE28821D1ACFA70025783C /* UINavigationController+CCProgress.m */; };
+		F7D2677C1E157053005ACB7E /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; };
+		F7D267871E157057005ACB7E /* Nextcloud.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7596C771D128FC80092A6B8 /* Nextcloud.xcassets */; };
 		F7D6A0911D82DBFA0045AD1A /* CCControlCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D6A08A1D82DBFA0045AD1A /* CCControlCenter.m */; };
 		F7D6A0931D82DBFA0045AD1A /* CCControlCenterCell.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D6A08C1D82DBFA0045AD1A /* CCControlCenterCell.m */; };
 		F7D6A0951D82DBFA0045AD1A /* CCControlCenterCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7D6A08D1D82DBFA0045AD1A /* CCControlCenterCell.xib */; };
 		F7D6A0971D82DBFA0045AD1A /* CCMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D6A08F1D82DBFA0045AD1A /* CCMenu.m */; };
 		F7DCA1C81D32BD4100E48D39 /* Share Ext Nextcloud.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = F7DCA1B81D32BD4100E48D39 /* Share Ext Nextcloud.entitlements */; };
+		F7ECBA6D1E239DCD003E6328 /* CCCreateCloud.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */; };
 		F7EF0CAF1D9E95F400A9D15E /* CCSharedDBSession.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EF0CAD1D9E95F400A9D15E /* CCSharedDBSession.m */; };
 		F7F06E8D1DBFACC600099AE9 /* NSBundle+CTAssetsPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F06E2E1DBFACC600099AE9 /* NSBundle+CTAssetsPickerController.m */; };
 		F7F06E8F1DBFACC600099AE9 /* NSDateFormatter+CTAssetsPickerController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F06E301DBFACC600099AE9 /* NSDateFormatter+CTAssetsPickerController.m */; };
@@ -534,6 +597,10 @@
 		F7F801031D98205A007537BC /* CCCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F801011D98205A007537BC /* CCCertificate.m */; };
 		F7F801051D98205A007537BC /* CCCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F801011D98205A007537BC /* CCCertificate.m */; };
 		F7FC7D561DC1F93800BB2C6A /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F7FC7D551DC1F93800BB2C6A /* libz.tbd */; };
+		F7FC88FA1E140558006D0506 /* cryptocloud.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F78088E51DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld */; };
+		F7FC88FB1E141A34006D0506 /* BKPasscodeView.strings in Resources */ = {isa = PBXBuildFile; fileRef = F72B60911A24F00B004EF66F /* BKPasscodeView.strings */; };
+		F7FC88FC1E141A39006D0506 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; };
+		F7FC88FD1E141A3F006D0506 /* Error.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7B381BF1C074E3E004693F8 /* Error.strings */; };
 		F7FCFFD81D70798C000E6E29 /* CCPeekPop.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7FCFFD61D70798C000E6E29 /* CCPeekPop.storyboard */; };
 		F7FCFFE01D707B83000E6E29 /* CCPeekPop.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FCFFDE1D707B83000E6E29 /* CCPeekPop.m */; };
 /* End PBXBuildFile section */
@@ -560,6 +627,20 @@
 			remoteGlobalIDString = EA7CC8A7183E11E600B6A4B4;
 			remoteInfo = "ownCloud iOS libraryTests";
 		};
+		F74344271E1264EE001CC831 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = F7F67BA01A24D27800EE80DA /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = F743441F1E1264EE001CC831;
+			remoteInfo = PickerFileProvider;
+		};
+		F743442A1E1264EE001CC831 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = F7F67BA01A24D27800EE80DA /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = F74344111E1264ED001CC831;
+			remoteInfo = Picker;
+		};
 		F7B61E921DC13C20009E938F /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = F7B61E861DC13C20009E938F /* MagicalRecord.xcodeproj */;
@@ -625,6 +706,8 @@
 			dstPath = "";
 			dstSubfolderSpec = 13;
 			files = (
+				F74344921E128EB0001CC831 /* Picker.appex in Embed App Extensions */,
+				F74344931E128EB4001CC831 /* PickerFileProvider.appex in Embed App Extensions */,
 				F749E4E91DC1FB38009BA2FD /* Share Ext Nextcloud.appex in Embed App Extensions */,
 			);
 			name = "Embed App Extensions";
@@ -988,11 +1071,8 @@
 		F71E67F61DC1F76F003BA52B /* ownCloud iOS library.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "ownCloud iOS library.xcodeproj"; path = "Libraries external/OCCommunicationLib/ownCloud iOS library.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		F71EDBFC1C4B93ED00265D0C /* JBroken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JBroken.h; sourceTree = "<group>"; };
 		F71EDBFD1C4B93ED00265D0C /* JBroken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JBroken.m; sourceTree = "<group>"; };
-		F721371C1BAFF0920012B613 /* Add.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Add.storyboard; sourceTree = "<group>"; };
 		F721371D1BAFF0920012B613 /* CCAccountWeb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAccountWeb.h; sourceTree = "<group>"; };
 		F721371E1BAFF0920012B613 /* CCAccountWeb.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAccountWeb.m; sourceTree = "<group>"; };
-		F721371F1BAFF0920012B613 /* CCAdd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAdd.h; sourceTree = "<group>"; };
-		F72137201BAFF0920012B613 /* CCAdd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCAdd.m; sourceTree = "<group>"; };
 		F72137211BAFF0920012B613 /* CCBancomat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCBancomat.h; sourceTree = "<group>"; };
 		F72137221BAFF0920012B613 /* CCBancomat.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCBancomat.m; sourceTree = "<group>"; };
 		F72137231BAFF0920012B613 /* CCCartaDiCredito.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCartaDiCredito.h; sourceTree = "<group>"; };
@@ -1119,6 +1199,16 @@
 		F73CCE281DC13798007E38D8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		F73CCE291DC13798007E38D8 /* UICKeyChainStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICKeyChainStore.h; sourceTree = "<group>"; };
 		F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICKeyChainStore.m; sourceTree = "<group>"; };
+		F74344151E1264EE001CC831 /* Picker.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Picker.entitlements; sourceTree = "<group>"; };
+		F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentPickerViewController.swift; sourceTree = "<group>"; };
+		F74344191E1264EE001CC831 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
+		F743441B1E1264EE001CC831 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		F74344231E1264EE001CC831 /* PickerFileProvider.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = PickerFileProvider.entitlements; sourceTree = "<group>"; };
+		F74344241E1264EE001CC831 /* FileProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProvider.swift; sourceTree = "<group>"; };
+		F74344261E1264EE001CC831 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		F74344521E126D06001CC831 /* Picker-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Picker-Bridging-Header.h"; sourceTree = "<group>"; };
+		F74344901E128E8F001CC831 /* Picker.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Picker.appex; sourceTree = BUILT_PRODUCTS_DIR; };
+		F74344911E128E96001CC831 /* PickerFileProvider.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = PickerFileProvider.appex; sourceTree = BUILT_PRODUCTS_DIR; };
 		F743B2C31C95BBE8006F5B4A /* CCShareInfoCMOC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCShareInfoCMOC.h; sourceTree = "<group>"; };
 		F743B2C41C95BBE8006F5B4A /* CCShareInfoCMOC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCShareInfoCMOC.m; sourceTree = "<group>"; };
 		F744BE921BEBB2EE004FFF66 /* CCIntro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIntro.h; sourceTree = "<group>"; };
@@ -1386,6 +1476,7 @@
 		F7D02A481C5F9E4400D6F972 /* CCMove.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = CCMove.storyboard; sourceTree = "<group>"; };
 		F7D0E65E1BC5042E008D989A /* CCDetail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCDetail.h; sourceTree = "<group>"; };
 		F7D0E65F1BC5042E008D989A /* CCDetail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCDetail.m; sourceTree = "<group>"; };
+		F7D154271E2392A300202FD9 /* Nextcloud-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Nextcloud-Bridging-Header.h"; sourceTree = "<group>"; };
 		F7D6A0891D82DBFA0045AD1A /* CCControlCenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlCenter.h; sourceTree = "<group>"; };
 		F7D6A08A1D82DBFA0045AD1A /* CCControlCenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCControlCenter.m; sourceTree = "<group>"; };
 		F7D6A08B1D82DBFA0045AD1A /* CCControlCenterCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCControlCenterCell.h; sourceTree = "<group>"; };
@@ -1406,6 +1497,7 @@
 		F7EC9CCC1C4FA803008122B5 /* TableShare+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableShare+CoreDataProperties.m"; sourceTree = "<group>"; };
 		F7EC9CCD1C4FA803008122B5 /* TableShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableShare.h; sourceTree = "<group>"; };
 		F7EC9CCE1C4FA803008122B5 /* TableShare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableShare.m; sourceTree = "<group>"; };
+		F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCCreateCloud.swift; sourceTree = "<group>"; };
 		F7EF0CAC1D9E95EC00A9D15E /* CCSharedDBSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CCSharedDBSession.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		F7EF0CAD1D9E95F400A9D15E /* CCSharedDBSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCSharedDBSession.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F7F0617A1BAACDD300846525 /* CryptoCloud.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCloud.pch; sourceTree = "<group>"; };
@@ -1512,6 +1604,24 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		F743440F1E1264ED001CC831 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				F74344541E1277D8001CC831 /* libownCloudiOS.a in Frameworks */,
+				F74344551E1277E2001CC831 /* libMagicalRecord.a in Frameworks */,
+				F74344591E12786C001CC831 /* libssl.a in Frameworks */,
+				F74344561E12784A001CC831 /* libcrypto.a in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		F743441D1E1264EE001CC831 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		F77B0EDC1D118A16002130FE /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
@@ -2221,9 +2331,6 @@
 			children = (
 				F721371D1BAFF0920012B613 /* CCAccountWeb.h */,
 				F721371E1BAFF0920012B613 /* CCAccountWeb.m */,
-				F721371F1BAFF0920012B613 /* CCAdd.h */,
-				F72137201BAFF0920012B613 /* CCAdd.m */,
-				F721371C1BAFF0920012B613 /* Add.storyboard */,
 				F72137211BAFF0920012B613 /* CCBancomat.h */,
 				F72137221BAFF0920012B613 /* CCBancomat.m */,
 				F72137231BAFF0920012B613 /* CCCartaDiCredito.h */,
@@ -2488,6 +2595,44 @@
 			path = UICKeyChainStore;
 			sourceTree = "<group>";
 		};
+		F74344131E1264EE001CC831 /* Picker */ = {
+			isa = PBXGroup;
+			children = (
+				F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */,
+				F74344521E126D06001CC831 /* Picker-Bridging-Header.h */,
+				F74344181E1264EE001CC831 /* MainInterface.storyboard */,
+				F743441B1E1264EE001CC831 /* Info.plist */,
+				F74344141E1264EE001CC831 /* Supporting Files */,
+			);
+			path = Picker;
+			sourceTree = "<group>";
+		};
+		F74344141E1264EE001CC831 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				F74344151E1264EE001CC831 /* Picker.entitlements */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+		F74344211E1264EE001CC831 /* PickerFileProvider */ = {
+			isa = PBXGroup;
+			children = (
+				F74344241E1264EE001CC831 /* FileProvider.swift */,
+				F74344261E1264EE001CC831 /* Info.plist */,
+				F74344221E1264EE001CC831 /* Supporting Files */,
+			);
+			path = PickerFileProvider;
+			sourceTree = "<group>";
+		};
+		F74344221E1264EE001CC831 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				F74344231E1264EE001CC831 /* PickerFileProvider.entitlements */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
 		F744BE911BEBB2EE004FFF66 /* Intro */ = {
 			isa = PBXGroup;
 			children = (
@@ -2898,6 +3043,14 @@
 			path = FileSystem;
 			sourceTree = "<group>";
 		};
+		F7ECBA6B1E239DCD003E6328 /* Create */ = {
+			isa = PBXGroup;
+			children = (
+				F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */,
+			);
+			path = Create;
+			sourceTree = "<group>";
+		};
 		F7F06E291DBFACC600099AE9 /* CTAssetsPickerController */ = {
 			isa = PBXGroup;
 			children = (
@@ -2998,6 +3151,8 @@
 				F7F67BAA1A24D27800EE80DA /* iOSClient */,
 				F7F67BAB1A24D27800EE80DA /* Supporting Files */,
 				F7C0F46D1C8880540059EC54 /* Share Ext */,
+				F74344131E1264EE001CC831 /* Picker */,
+				F74344211E1264EE001CC831 /* PickerFileProvider */,
 				F7FC7D651DC1F98700BB2C6A /* Products */,
 				F7FC7D541DC1F93700BB2C6A /* Frameworks */,
 			);
@@ -3018,6 +3173,7 @@
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
 				F7596C771D128FC80092A6B8 /* Nextcloud.xcassets */,
 				F70211F31BAC56E9003FC03E /* Main */,
+				F7ECBA6B1E239DCD003E6328 /* Create */,
 				F7AB19C41BAF01A60027D7BA /* Favorite */,
 				F7E95CEC1AC40BA40060D08E /* FileSystem */,
 				F744BE911BEBB2EE004FFF66 /* Intro */,
@@ -3044,6 +3200,7 @@
 		F7F67BAB1A24D27800EE80DA /* Supporting Files */ = {
 			isa = PBXGroup;
 			children = (
+				F7D154271E2392A300202FD9 /* Nextcloud-Bridging-Header.h */,
 				F75CDBF51DF063AD00116AD0 /* .gitignore */,
 				F7229B461DF71BA800E8C4E7 /* ChangeLog */,
 				F7229B491DF71BB300E8C4E7 /* AUTHORS */,
@@ -3085,6 +3242,8 @@
 			children = (
 				F7CE8AFA1DC1F8D8009CAE48 /* Nextcloud.app */,
 				F7CE8AFB1DC1F8D8009CAE48 /* Share Ext Nextcloud.appex */,
+				F74344901E128E8F001CC831 /* Picker.appex */,
+				F74344911E128E96001CC831 /* PickerFileProvider.appex */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -3132,6 +3291,40 @@
 			productReference = F7CE8AFB1DC1F8D8009CAE48 /* Share Ext Nextcloud.appex */;
 			productType = "com.apple.product-type.app-extension";
 		};
+		F74344111E1264ED001CC831 /* Picker */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = F743443C1E1264EE001CC831 /* Build configuration list for PBXNativeTarget "Picker" */;
+			buildPhases = (
+				F743440E1E1264ED001CC831 /* Sources */,
+				F743440F1E1264ED001CC831 /* Frameworks */,
+				F74344101E1264ED001CC831 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = Picker;
+			productName = Picker;
+			productReference = F74344901E128E8F001CC831 /* Picker.appex */;
+			productType = "com.apple.product-type.app-extension";
+		};
+		F743441F1E1264EE001CC831 /* PickerFileProvider */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = F743443B1E1264EE001CC831 /* Build configuration list for PBXNativeTarget "PickerFileProvider" */;
+			buildPhases = (
+				F743441C1E1264EE001CC831 /* Sources */,
+				F743441D1E1264EE001CC831 /* Frameworks */,
+				F743441E1E1264EE001CC831 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = PickerFileProvider;
+			productName = PickerFileProvider;
+			productReference = F74344911E128E96001CC831 /* PickerFileProvider.appex */;
+			productType = "com.apple.product-type.app-extension";
+		};
 		F77B0DEB1D118A16002130FE /* Nextcloud */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = F77B0F9A1D118A16002130FE /* Build configuration list for PBXNativeTarget "Nextcloud" */;
@@ -3146,6 +3339,8 @@
 			);
 			dependencies = (
 				F7145A321D12E65F00CAFEEC /* PBXTargetDependency */,
+				F74344281E1264EE001CC831 /* PBXTargetDependency */,
+				F743442B1E1264EE001CC831 /* PBXTargetDependency */,
 			);
 			name = Nextcloud;
 			productName = "Crypto Cloud";
@@ -3158,15 +3353,49 @@
 		F7F67BA01A24D27800EE80DA /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastSwiftUpdateCheck = 0720;
+				LastSwiftUpdateCheck = 0820;
 				LastUpgradeCheck = 0800;
 				ORGANIZATIONNAME = TWS;
 				TargetAttributes = {
 					F71459B41D12E3B700CAFEEC = {
 						DevelopmentTeam = 6JLRKY9ZV7;
+						SystemCapabilities = {
+							com.apple.iCloud = {
+								enabled = 0;
+							};
+						};
+					};
+					F74344111E1264ED001CC831 = {
+						CreatedOnToolsVersion = 8.2.1;
+						DevelopmentTeam = 6JLRKY9ZV7;
+						ProvisioningStyle = Automatic;
+						SystemCapabilities = {
+							com.apple.ApplicationGroups.iOS = {
+								enabled = 1;
+							};
+							com.apple.Keychain = {
+								enabled = 1;
+							};
+						};
+					};
+					F743441F1E1264EE001CC831 = {
+						CreatedOnToolsVersion = 8.2.1;
+						DevelopmentTeam = 6JLRKY9ZV7;
+						ProvisioningStyle = Automatic;
+						SystemCapabilities = {
+							com.apple.Keychain = {
+								enabled = 1;
+							};
+						};
 					};
 					F77B0DEB1D118A16002130FE = {
 						DevelopmentTeam = 6JLRKY9ZV7;
+						LastSwiftMigration = 0820;
+						SystemCapabilities = {
+							com.apple.iCloud = {
+								enabled = 1;
+							};
+						};
 					};
 				};
 			};
@@ -3198,6 +3427,8 @@
 			targets = (
 				F77B0DEB1D118A16002130FE /* Nextcloud */,
 				F71459B41D12E3B700CAFEEC /* Share Ext Nextcloud */,
+				F74344111E1264ED001CC831 /* Picker */,
+				F743441F1E1264EE001CC831 /* PickerFileProvider */,
 			);
 		};
 /* End PBXProject section */
@@ -3293,6 +3524,27 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		F74344101E1264ED001CC831 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				F7D267871E157057005ACB7E /* Nextcloud.xcassets in Resources */,
+				F7FC88FD1E141A3F006D0506 /* Error.strings in Resources */,
+				F7FC88FB1E141A34006D0506 /* BKPasscodeView.strings in Resources */,
+				F7FC88FC1E141A39006D0506 /* Localizable.strings in Resources */,
+				F7D2677C1E157053005ACB7E /* Images.xcassets in Resources */,
+				F743441A1E1264EE001CC831 /* MainInterface.storyboard in Resources */,
+				F743444B1E126B69001CC831 /* CCMove.storyboard in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		F743441E1E1264EE001CC831 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		F77B0EE91D118A16002130FE /* Resources */ = {
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -3359,7 +3611,6 @@
 				F77B0F231D118A16002130FE /* ZSSh3.png in Resources */,
 				F77B0F241D118A16002130FE /* Reader-Button-H.png in Resources */,
 				F77B0F251D118A16002130FE /* ZSSh1.png in Resources */,
-				F77B0F261D118A16002130FE /* Add.storyboard in Resources */,
 				F77B0F271D118A16002130FE /* ImageSelectedSmallOn.png in Resources */,
 				F7676A7D1D5CB2A400DF734C /* icon-info.png in Resources */,
 				F77B0F281D118A16002130FE /* Main.storyboard in Resources */,
@@ -3565,6 +3816,75 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		F743440E1E1264ED001CC831 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				F743446C1E127E4B001CC831 /* TableLocalFile+CoreDataProperties.m in Sources */,
+				F743445F1E127D4B001CC831 /* BKPasscodeViewController.m in Sources */,
+				F74344611E127D51001CC831 /* BKTouchIDManager.m in Sources */,
+				F743446A1E127E45001CC831 /* TableCertificates+CoreDataProperties.m in Sources */,
+				F74344801E127ED3001CC831 /* NSString+Base64.m in Sources */,
+				F74344621E127D54001CC831 /* BKTouchIDSwitchView.m in Sources */,
+				F743446D1E127E4E001CC831 /* TableLocalFile.m in Sources */,
+				F743447A1E127EA6001CC831 /* CCGraphics.m in Sources */,
+				F743448C1E128010001CC831 /* CCCrypto.m in Sources */,
+				F725437C1E12A44A009BF4C2 /* CCSection.m in Sources */,
+				F74344651E127DE9001CC831 /* CCNetworking.m in Sources */,
+				F74344641E127DE6001CC831 /* OCNetworking.m in Sources */,
+				F743445B1E127D3B001CC831 /* BKPasscodeDummyViewController.m in Sources */,
+				F743446B1E127E49001CC831 /* TableCertificates.m in Sources */,
+				F743445D1E127D40001CC831 /* BKPasscodeInputView.m in Sources */,
+				F74344821E127F68001CC831 /* MBProgressHUD.m in Sources */,
+				F74344721E127E5B001CC831 /* TableMetadata.m in Sources */,
+				F74344681E127E3F001CC831 /* TableAutomaticUpload+CoreDataClass.m in Sources */,
+				F743444A1E126B4D001CC831 /* CCMove.m in Sources */,
+				F74344741E127E60001CC831 /* TableAccount.m in Sources */,
+				F74344771E127E88001CC831 /* TableDirectory.m in Sources */,
+				F74344711E127E59001CC831 /* TableMetadata+CoreDataProperties.m in Sources */,
+				F743448B1E12800D001CC831 /* CCCertificate.m in Sources */,
+				F743447D1E127ECB001CC831 /* AESCrypt.m in Sources */,
+				F743447E1E127ECE001CC831 /* NSData+Base64.m in Sources */,
+				F74344671E127E38001CC831 /* CCMetadata.m in Sources */,
+				F74344701E127E56001CC831 /* TableDirectory+CoreDataProperties.m in Sources */,
+				F74344781E127E9E001CC831 /* CCExifGeo.m in Sources */,
+				F74344171E1264EE001CC831 /* DocumentPickerViewController.swift in Sources */,
+				F74344811E127F49001CC831 /* AFViewShaker.m in Sources */,
+				F74344791E127EA1001CC831 /* CCError.m in Sources */,
+				F743446E1E127E51001CC831 /* TableGPS+CoreDataProperties.m in Sources */,
+				F743447B1E127EAC001CC831 /* CCUtility.m in Sources */,
+				F74344761E127E67001CC831 /* TableShare.m in Sources */,
+				F74344871E127F95001CC831 /* UICKeyChainStore.m in Sources */,
+				F74344751E127E64001CC831 /* TableShare+CoreDataProperties.m in Sources */,
+				F743447F1E127ED1001CC831 /* NSData+CommonCrypto.m in Sources */,
+				F74344891E127FC3001CC831 /* CCGlobal.m in Sources */,
+				F74344841E127F84001CC831 /* RNCryptorEngine.m in Sources */,
+				F74344851E127F86001CC831 /* RNDecryptor.m in Sources */,
+				F74344691E127E42001CC831 /* TableAutomaticUpload+CoreDataProperties.m in Sources */,
+				F74344881E127F9C001CC831 /* UIImage+animatedGIF.m in Sources */,
+				F743448A1E127FF2001CC831 /* CCHud.m in Sources */,
+				F74344861E127F89001CC831 /* RNEncryptor.m in Sources */,
+				F743445C1E127D3D001CC831 /* BKPasscodeField.m in Sources */,
+				F743446F1E127E53001CC831 /* TableGPS.m in Sources */,
+				F7FC88FA1E140558006D0506 /* cryptocloud.xcdatamodeld in Sources */,
+				F743445E1E127D44001CC831 /* BKPasscodeLockScreenManager.m in Sources */,
+				F74344631E127D79001CC831 /* CCBKPasscode.m in Sources */,
+				F74344661E127E35001CC831 /* CCCoreData.m in Sources */,
+				F743447C1E127EB2001CC831 /* NSString+TruncateToWidth.m in Sources */,
+				F74344731E127E5E001CC831 /* TableAccount+CoreDataProperties.m in Sources */,
+				F74344601E127D4D001CC831 /* BKShiftingView.m in Sources */,
+				F74344831E127F80001CC831 /* RNCryptor.m in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		F743441C1E1264EE001CC831 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				F74344251E1264EE001CC831 /* FileProvider.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		F77B0DEF1D118A16002130FE /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -3665,7 +3985,6 @@
 				F77B0E441D118A16002130FE /* CCIntro.m in Sources */,
 				F77B0E451D118A16002130FE /* ReaderThumbRender.m in Sources */,
 				F77B0E461D118A16002130FE /* BKPasscodeLockScreenManager.m in Sources */,
-				F77B0E471D118A16002130FE /* CCAdd.m in Sources */,
 				F77B0E481D118A16002130FE /* CCCrypto.m in Sources */,
 				F7D6A0911D82DBFA0045AD1A /* CCControlCenter.m in Sources */,
 				F7659A6A1DC0B760004860C4 /* PSTGridLayoutInfo.m in Sources */,
@@ -3823,6 +4142,7 @@
 				F77B0EC61D118A16002130FE /* CCCellMain.m in Sources */,
 				F77B0EC71D118A16002130FE /* AESCrypt.m in Sources */,
 				F73CCE091DC13776007E38D8 /* NSObject+XLFormAdditions.m in Sources */,
+				F7ECBA6D1E239DCD003E6328 /* CCCreateCloud.swift in Sources */,
 				F77B0ECB1D118A16002130FE /* HRBrightnessCursor.m in Sources */,
 				F77B0ECC1D118A16002130FE /* UIImage+Masking.m in Sources */,
 				F77B0ECE1D118A16002130FE /* NSData+CommonCrypto.m in Sources */,
@@ -3850,6 +4170,16 @@
 			target = F71459B41D12E3B700CAFEEC /* Share Ext Nextcloud */;
 			targetProxy = F7145A311D12E65F00CAFEEC /* PBXContainerItemProxy */;
 		};
+		F74344281E1264EE001CC831 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = F743441F1E1264EE001CC831 /* PickerFileProvider */;
+			targetProxy = F74344271E1264EE001CC831 /* PBXContainerItemProxy */;
+		};
+		F743442B1E1264EE001CC831 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = F74344111E1264ED001CC831 /* Picker */;
+			targetProxy = F743442A1E1264EE001CC831 /* PBXContainerItemProxy */;
+		};
 /* End PBXTargetDependency section */
 
 /* Begin PBXVariantGroup section */
@@ -3865,6 +4195,14 @@
 			name = BKPasscodeView.strings;
 			sourceTree = "<group>";
 		};
+		F74344181E1264EE001CC831 /* MainInterface.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				F74344191E1264EE001CC831 /* Base */,
+			);
+			name = MainInterface.storyboard;
+			sourceTree = "<group>";
+		};
 		F744BE9F1BEBB69F004FFF66 /* Intro.strings */ = {
 			isa = PBXVariantGroup;
 			children = (
@@ -3957,7 +4295,7 @@
 				GCC_PREFIX_HEADER = "$(SRCROOT)/iOSClient/CryptoCloud.pch";
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
-					"SHARE_IN=1",
+					"EXTENSION=1",
 					"NC=1",
 				);
 				HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
@@ -3997,7 +4335,7 @@
 				GCC_PREFIX_HEADER = "$(SRCROOT)/iOSClient/CryptoCloud.pch";
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					"$(inherited)",
-					"SHARE_IN=1",
+					"EXTENSION=1",
 					"NC=1",
 				);
 				HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
@@ -4019,12 +4357,135 @@
 			};
 			name = Release;
 		};
+		F743442D1E1264EE001CC831 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
+				CODE_SIGN_ENTITLEMENTS = Picker/Picker.entitlements;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				GCC_PREFIX_HEADER = "$(SRCROOT)/iOSClient/CryptoCloud.pch";
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"EXTENSION=1",
+					"DEBUG=1",
+					"NC=1",
+				);
+				HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
+				INFOPLIST_FILE = Picker/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+				LIBRARY_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
+				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.Picker;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG NC";
+				SWIFT_OBJC_BRIDGING_HEADER = "Picker/Picker-Bridging-Header.h";
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 3.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		F743442E1E1264EE001CC831 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
+				CODE_SIGN_ENTITLEMENTS = Picker/Picker.entitlements;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				GCC_PREFIX_HEADER = "$(SRCROOT)/iOSClient/CryptoCloud.pch";
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"EXTENSION=1",
+					"NC=1",
+				);
+				HEADER_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
+				INFOPLIST_FILE = Picker/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+				LIBRARY_SEARCH_PATHS = "\"$(PROJECT_DIR)/Libraries external\"/**";
+				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.Picker;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = NC;
+				SWIFT_OBJC_BRIDGING_HEADER = "Picker/Picker-Bridging-Header.h";
+				SWIFT_VERSION = 3.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Release;
+		};
+		F743442F1E1264EE001CC831 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CODE_SIGN_ENTITLEMENTS = PickerFileProvider/PickerFileProvider.entitlements;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"EXTENSION=1",
+					"NC=1",
+				);
+				INFOPLIST_FILE = PickerFileProvider/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
+				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG NC";
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 3.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		F74344301E1264EE001CC831 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CODE_SIGN_ENTITLEMENTS = PickerFileProvider/PickerFileProvider.entitlements;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"NC=1",
+					"EXTENSION=1",
+				);
+				INFOPLIST_FILE = PickerFileProvider/Info.plist;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
+				LIBRARY_SEARCH_PATHS = "$(inherited)";
+				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SKIP_INSTALL = YES;
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = NC;
+				SWIFT_VERSION = 3.0;
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Release;
+		};
 		F77B0F9B1D118A16002130FE /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconNextcloud;
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
+				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Nextcloud.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -4050,6 +4511,8 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				SWIFT_OBJC_BRIDGING_HEADER = "iOSClient/Nextcloud-Bridging-Header.h";
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 3.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
@@ -4063,6 +4526,7 @@
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconNextcloud;
 				CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
+				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Nextcloud.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -4089,6 +4553,7 @@
 				PRODUCT_BUNDLE_IDENTIFIER = "it.twsweb.$(PRODUCT_NAME:rfc1034identifier)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
+				SWIFT_OBJC_BRIDGING_HEADER = "iOSClient/Nextcloud-Bridging-Header.h";
 				SWIFT_VERSION = 3.0;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
@@ -4206,6 +4671,24 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
+		F743443B1E1264EE001CC831 /* Build configuration list for PBXNativeTarget "PickerFileProvider" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				F743442F1E1264EE001CC831 /* Debug */,
+				F74344301E1264EE001CC831 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		F743443C1E1264EE001CC831 /* Build configuration list for PBXNativeTarget "Picker" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				F743442D1E1264EE001CC831 /* Debug */,
+				F743442E1E1264EE001CC831 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 		F77B0F9A1D118A16002130FE /* Build configuration list for PBXNativeTarget "Nextcloud" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

+ 119 - 0
Picker/Base.lproj/MainInterface.storyboard

@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="J6p-g8-CHO">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Document Picker View Controller-->
+        <scene sceneID="Q8I-MS-tKG">
+            <objects>
+                <viewController storyboardIdentifier="DocumentPickerViewController" id="J6p-g8-CHO" customClass="DocumentPickerViewController" customModule="Picker" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="hST-wJ-eYy"/>
+                        <viewControllerLayoutGuide type="bottom" id="UQD-kz-Mfv"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="Vdh-Gp-eV6">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vA7-yc-aM1">
+                                <rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <prototypes>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="50" id="0H6-U8-fd4" userLabel="Cell" customClass="recordMetadataCell" customModule="Picker" customModuleProvider="target">
+                                        <rect key="frame" x="0.0" y="28" width="375" height="50"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="0H6-U8-fd4" id="44X-Sr-gc0">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Wk9-rb-4yv">
+                                                    <rect key="frame" x="10" y="5" width="40" height="40"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="40" id="OjC-WK-8oe"/>
+                                                        <constraint firstAttribute="height" constant="40" id="mef-gN-2ly"/>
+                                                    </constraints>
+                                                </imageView>
+                                                <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="FileName" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xDF-xa-qvc">
+                                                    <rect key="frame" x="66" y="16" width="301" height="16"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
+                                                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="t6N-LC-3jL" userLabel="Status Image View">
+                                                    <rect key="frame" x="37" y="32" width="15" height="15"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="15" id="J4K-CX-e72"/>
+                                                        <constraint firstAttribute="width" constant="15" id="Vzz-zd-Yzw"/>
+                                                    </constraints>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="t6N-LC-3jL" firstAttribute="top" secondItem="44X-Sr-gc0" secondAttribute="topMargin" constant="24" id="4Nk-TB-5YW"/>
+                                                <constraint firstItem="Wk9-rb-4yv" firstAttribute="leading" secondItem="44X-Sr-gc0" secondAttribute="leadingMargin" constant="2" id="JC3-NE-SK8"/>
+                                                <constraint firstItem="t6N-LC-3jL" firstAttribute="leading" secondItem="44X-Sr-gc0" secondAttribute="leadingMargin" constant="29" id="RMx-hy-3YJ"/>
+                                                <constraint firstItem="Wk9-rb-4yv" firstAttribute="centerY" secondItem="44X-Sr-gc0" secondAttribute="centerY" id="cFG-TN-r8I"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="StatusImageView" destination="t6N-LC-3jL" id="PG8-b8-lRJ"/>
+                                            <outlet property="fileImageView" destination="Wk9-rb-4yv" id="K2a-JK-zkR"/>
+                                            <outlet property="fileName" destination="xDF-xa-qvc" id="i9u-Bj-qoo"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="J6p-g8-CHO" id="IPP-6O-Pgj"/>
+                                    <outlet property="delegate" destination="J6p-g8-CHO" id="wBq-lQ-Kon"/>
+                                </connections>
+                            </tableView>
+                            <toolbar clearsContextBeforeDrawing="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kOP-Rg-Mvb">
+                                <rect key="frame" x="0.0" y="623" width="375" height="44"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
+                                <items>
+                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="Wcn-Rh-qba"/>
+                                    <barButtonItem image="image_shareExtEncrypt" id="5yO-2s-n3Y" userLabel="Encrypt">
+                                        <connections>
+                                            <action selector="encryptedButtonTapped:" destination="J6p-g8-CHO" id="OE7-j9-AIp"/>
+                                        </connections>
+                                    </barButtonItem>
+                                    <barButtonItem title="title" id="LlY-NF-IiS" userLabel="Save">
+                                        <connections>
+                                            <action selector="saveButtonTapped:" destination="J6p-g8-CHO" id="oZp-Hv-neh"/>
+                                        </connections>
+                                    </barButtonItem>
+                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="xmG-u1-O7D"/>
+                                </items>
+                            </toolbar>
+                        </subviews>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstAttribute="trailing" secondItem="vA7-yc-aM1" secondAttribute="trailing" id="36a-TC-Qul"/>
+                            <constraint firstItem="vA7-yc-aM1" firstAttribute="top" secondItem="Vdh-Gp-eV6" secondAttribute="top" id="B3X-Ni-wvz"/>
+                            <constraint firstItem="vA7-yc-aM1" firstAttribute="leading" secondItem="Vdh-Gp-eV6" secondAttribute="leading" id="S3f-mR-ElS"/>
+                            <constraint firstItem="vA7-yc-aM1" firstAttribute="bottom" secondItem="UQD-kz-Mfv" secondAttribute="top" constant="-44" id="wSm-cl-ClV"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="encryptedButton" destination="5yO-2s-n3Y" id="IQ2-oG-ATo"/>
+                        <outlet property="saveButton" destination="LlY-NF-IiS" id="Vh2-iV-omb"/>
+                        <outlet property="tableView" destination="vA7-yc-aM1" id="nuO-LH-LFc"/>
+                        <outlet property="toolBar" destination="kOP-Rg-Mvb" id="lu3-pV-yxw"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="UoZ-ya-W3e" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="120.8" y="141.67916041979012"/>
+        </scene>
+    </scenes>
+    <resources>
+        <image name="image_shareExtEncrypt" width="16" height="16"/>
+    </resources>
+</document>

+ 852 - 0
Picker/DocumentPickerViewController.swift

@@ -0,0 +1,852 @@
+//
+//  DocumentPickerViewController.swift
+//  Picker
+//
+//  Created by Marino Faggiana on 27/12/16.
+//  Copyright © 2016 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+
+import UIKit
+
+class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCNetworkingDelegate, OCNetworkingDelegate, BKPasscodeViewControllerDelegate {
+    
+    // MARK: - Properties
+    
+    var providerDB : providerSessionDB?
+    
+    lazy var fileCoordinator: NSFileCoordinator = {
+    
+        let fileCoordinator = NSFileCoordinator()
+        fileCoordinator.purposeIdentifier = self.parameterProviderIdentifier
+        return fileCoordinator
+        
+    }()
+    
+    var parameterMode: UIDocumentPickerMode?
+    var parameterOriginalURL: URL?
+    var parameterProviderIdentifier: String!
+    var parameterPasscodeCorrect: Bool? = false
+    var parameterEncrypted: Bool? = false
+
+    var metadata: CCMetadata?
+    var recordsTableMetadata: [TableMetadata]?
+    var titleFolder: String?
+    
+    var activeAccount: String?
+    var activeUrl: String?
+    var activeUser: String?
+    var activePassword: String?
+    var activeUID: String?
+    var activeAccessToken: String?
+    var directoryUser: String?
+    var typeCloud: String?
+    var serverUrl: String?
+    
+    var localServerUrl: String?
+    var thumbnailInLoading = [String: IndexPath]()
+    var destinationURL: URL?
+    
+    var passcodeFailedAttempts: UInt = 0
+    var passcodeLockUntilDate: Date? = nil
+    var passcodeIsPush: Bool? = false
+    var serverUrlPush: String?
+    
+    lazy var networkingOperationQueue: OperationQueue = {
+        
+        var queue = OperationQueue()
+        queue.name = netQueueName
+        queue.maxConcurrentOperationCount = 10
+        
+        return queue
+    }()
+    
+    let colorEncrypted = UIColor(colorLiteralRed: 241.0/255.0, green: 90.0/255.0, blue: 34.0/255.0, alpha: 1)
+    
+    var hud : CCHud!
+    
+    // MARK: - IBOutlets
+    
+    @IBOutlet weak var tableView: UITableView!
+    @IBOutlet weak var toolBar: UIToolbar!
+    @IBOutlet weak var saveButton: UIBarButtonItem!
+    @IBOutlet weak var encryptedButton: UIBarButtonItem!
+
+    // MARK: - View Life Cycle
+    
+    override func viewDidLoad() {
+        
+        providerDB = providerSessionDB.sharedInstance
+        
+        if let record = CCCoreData.getActiveAccount() {
+            
+            activeAccount = record.account!
+            activePassword = record.password!
+            activeUrl = record.url!
+            activeUser = record.user!
+            typeCloud = record.typeCloud!
+            directoryUser = CCUtility.getDirectoryActiveUser(activeUser, activeUrl: activeUrl)
+            
+            if (localServerUrl == nil) {
+            
+                localServerUrl = CCUtility.getHomeServerUrlActiveUrl(activeUrl, typeCloud: typeCloud)
+                
+            } else {
+                
+                self.navigationItem.title = titleFolder
+            }
+            
+        } else {
+            
+            // Close error no account return nil
+            
+            let deadlineTime = DispatchTime.now() + 0.1
+            DispatchQueue.main.asyncAfter(deadline: deadlineTime) {
+                
+                let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_no_active_account_", comment: ""), preferredStyle: .alert)
+                alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
+                    self.dismissGrantingAccess(to: nil)
+                })
+                
+                self.present(alert, animated: true, completion: nil)
+            }
+
+            return
+        }
+        
+        //  MARK: - init Object
+        CCNetworking.shared().settingDelegate(self)
+        hud = CCHud.init(view: self.navigationController?.view)
+        
+        // COLOR_SEPARATOR_TABLE
+        self.tableView.separatorColor = UIColor(colorLiteralRed: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 0.2)
+        
+        // Encrypted mode
+        encryptedButton.image = UIImage(named:image_shareExtEncrypt)?.withRenderingMode(.automatic)
+
+        // Color Button
+        if parameterEncrypted == true {
+            encryptedButton.tintColor = colorEncrypted
+        } else {
+            encryptedButton.tintColor = self.view.tintColor
+            
+        }
+        saveButton.tintColor = encryptedButton.tintColor
+        
+        readFolder()
+    }
+    
+    override func viewWillAppear(_ animated: Bool) {
+        
+        super.viewWillAppear(animated)
+    
+        // (save) mode of presentation -> pass variable for pushViewController
+        prepareForPresentation(in: parameterMode!)
+        
+        // String is nil or empty
+        guard let passcode = CCUtility.getBlockCode(), !passcode.isEmpty else {
+            return
+        }
+        
+        if CCUtility.getOnlyLockDir() == false && parameterPasscodeCorrect == false {
+            openBKPasscode("Nextcloud")
+        }
+    }
+    
+    override func viewWillDisappear(_ animated: Bool) {
+        
+        // remove all networking operation
+        networkingOperationQueue.cancelAllOperations()
+        
+        super.viewWillDisappear(animated)
+    }
+    
+    // MARK: - Overridden Instance Methods
+    
+    override func prepareForPresentation(in mode: UIDocumentPickerMode) {
+        
+        // ------------------> Settings parameter ----------------
+        if parameterMode == nil {
+            parameterMode = mode
+        }
+        
+        // Variable for exportToService or moveToService
+        if parameterOriginalURL == nil && originalURL != nil {
+            parameterOriginalURL = originalURL
+        }
+        
+        if parameterProviderIdentifier == nil {
+            parameterProviderIdentifier = providerIdentifier
+        }
+        // -------------------------------------------------------
+        
+        switch mode {
+            
+        case .exportToService:
+            
+            print("Document Picker Mode : exportToService")
+            saveButton.title = NSLocalizedString("_save_document_picker_", comment: "") // Save in this position
+            
+        case .moveToService:
+            
+            //Show confirmation button
+            print("Document Picker Mode : moveToService")
+            saveButton.title = NSLocalizedString("_save_document_picker_", comment: "") // Save in this position
+            
+        case .open:
+            
+            print("Document Picker Mode : open")
+            saveButton.tintColor = UIColor.clear
+            encryptedButton.tintColor = UIColor.clear
+            
+        case .import:
+            
+            print("Document Picker Mode : import")
+            saveButton.tintColor = UIColor.clear
+            encryptedButton.tintColor = UIColor.clear
+        }
+    }
+
+    //  MARK: - Read folder
+    
+    func readFolder() {
+        
+        let metadataNet = CCMetadataNet.init(account: activeAccount)!
+
+        metadataNet.action = actionReadFolder
+        metadataNet.serverUrl = localServerUrl
+        metadataNet.selector = selectorReadFolder
+        
+        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, withTypeCloud: typeCloud, activityIndicator: false)
+        networkingOperationQueue.addOperation(ocNetworking)
+        
+        hud.visibleIndeterminateHud()
+    }
+    
+    func readFolderFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
+        
+        hud.hideHud()
+        
+        let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: message, preferredStyle: .alert)
+        alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
+            self.dismissGrantingAccess(to: nil)
+        })
+        
+        self.present(alert, animated: true, completion: nil)
+    }
+    
+    func readFolderSuccess(_ metadataNet: CCMetadataNet!, permissions: String!, rev: String!, metadatas: [Any]!) {
+        
+        // remove all record
+        let predicate = NSPredicate(format: "(account == '\(activeAccount!)') AND (directoryID == '\(metadataNet.directoryID!)') AND ((session == NULL) OR (session == ''))")
+        CCCoreData.deleteMetadata(with: predicate)
+        
+        for metadata in metadatas as! [CCMetadata] {
+            
+            // do not insert crypto file
+            if CCUtility.isCryptoString(metadata.fileName) {
+                
+                continue
+            }
+            
+            // Only Directory ?
+            if (parameterMode == .moveToService || parameterMode == .exportToService) && metadata.directory == false {
+                
+                continue
+            }
+            
+            // plist + crypto = completed ?
+            if CCUtility.isCryptoPlistString(metadata.fileName) && metadata.directory == false {
+                
+                var isCryptoComplete = false
+                
+                for completeMetadata in metadatas as! [CCMetadata] {
+                    
+                    if completeMetadata.fileName == CCUtility.trasformedFileNamePlist(inCrypto: metadata.fileName) {
+                        
+                        isCryptoComplete = true
+                    }
+                }
+
+                if isCryptoComplete == false {
+                    
+                    continue
+                }
+            }
+            
+            // Add record
+            CCCoreData.add(metadata, activeAccount: activeAccount, activeUrl: activeUrl, typeCloud: typeCloud, context: nil)
+            
+            // if plist do not exists, download it
+            if CCUtility.isCryptoPlistString(metadata.fileName) && FileManager.default.fileExists(atPath: "\(directoryUser!)/\(metadata.fileName!)") == false {
+                
+                let metadataNet = CCMetadataNet.init(account: activeAccount)!
+                
+                metadataNet.action = actionDownloadFile
+                metadataNet.metadata = metadata
+                metadataNet.downloadData = false
+                metadataNet.downloadPlist = true
+                metadataNet.selector = selectorLoadPlist
+                metadataNet.serverUrl = localServerUrl
+                metadataNet.session = download_session_foreground
+                metadataNet.taskStatus = Int(taskStatusResume)
+                
+                let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, withTypeCloud: typeCloud, activityIndicator: false)
+                networkingOperationQueue.addOperation(ocNetworking)
+            }
+        }
+        
+        // Get Datasource
+        recordsTableMetadata = CCCoreData.getTableMetadata(with: NSPredicate(format: "(account == '\(activeAccount!)') AND (directoryID == '\(metadataNet.directoryID!)')"), fieldOrder: "fileName", ascending: true) as? [TableMetadata]
+        
+        tableView.reloadData()
+        
+        hud.hideHud()
+    }
+    
+    //  MARK: - Download Thumbnail
+    
+    func downloadThumbnailFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
+        
+        NSLog("[LOG] Thumbnail Error \(metadataNet.fileName) \(message) (error \(errorCode))");
+    }
+    
+    func downloadThumbnailSuccess(_ metadataNet: CCMetadataNet!) {
+        
+        if let indexPath = thumbnailInLoading[metadataNet.fileID] {
+            
+            let path = "\(directoryUser!)/\(metadataNet.fileID!).ico"
+            
+            if FileManager.default.fileExists(atPath: path) {
+                
+                if let cell = tableView.cellForRow(at: indexPath) as? recordMetadataCell {
+                    
+                    cell.fileImageView.image = UIImage(contentsOfFile: path)
+                }
+            }
+        }
+    }
+    
+    func downloadThumbnail(_ metadata : CCMetadata) {
+        
+        let metadataNet = CCMetadataNet.init(account: activeAccount)!
+        
+        metadataNet.action = actionDownloadThumbnail
+        metadataNet.fileID = metadata.fileID
+        metadataNet.fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: localServerUrl, activeUrl: activeUrl, typeCloud: typeCloud)
+        metadataNet.fileNameLocal = metadata.fileID;
+        metadataNet.fileNamePrint = metadata.fileNamePrint;
+        metadataNet.options = "m";
+        metadataNet.selector = selectorDownloadThumbnail;
+        metadataNet.serverUrl = localServerUrl
+        
+        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, withTypeCloud: typeCloud, activityIndicator: false)
+        networkingOperationQueue.addOperation(ocNetworking)
+    }
+
+    //  MARK: - Download / Upload
+    
+    func progressTask(_ fileID: String!, serverUrl: String!, cryptated: Bool, progress: Float) {
+        
+        hud.progress(progress)
+    }
+    
+    func cancelTransfer() {
+        
+        networkingOperationQueue.cancelAllOperations()
+    }
+
+    //  MARK: - Download
+
+    func downloadFileFailure(_ fileID: String!, serverUrl: String!, selector: String!, message: String!, errorCode: Int) {
+        
+        hud.hideHud()
+        
+        if selector == selectorLoadFileView && errorCode != -999 {
+            
+            let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: message, preferredStyle: .alert)
+            alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
+                NSLog("[LOG] Download Error \(fileID) \(message) (error \(errorCode))");
+            })
+            
+            self.present(alert, animated: true, completion: nil)
+        }
+    }
+
+    func downloadFileSuccess(_ fileID: String!, serverUrl: String!, selector: String!, selectorPost: String!) {
+        
+        hud.hideHud()
+        
+        let metadata = CCCoreData.getMetadataWithPreficate(NSPredicate(format: "(account == '\(activeAccount!)') AND (fileID == '\(fileID!)')"), context: nil)
+        
+        switch selector {
+            
+        case selectorLoadFileView :
+                
+            do {
+                
+                try FileManager.default.moveItem(atPath: "\(directoryUser!)/\(fileID!)", toPath: "\(directoryUser!)/\(metadata!.fileNamePrint!)")
+                    
+            } catch let error as NSError {
+        
+                print(error)
+            }
+                
+            let url = URL(string: "file://\(directoryUser!)/\(metadata!.fileNamePrint!)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)
+            self.dismissGrantingAccess(to: url)
+            
+        case selectorLoadPlist :
+            
+            CCCoreData.downloadFilePlist(metadata, activeAccount: activeAccount, activeUrl: activeUrl, typeCloud: typeCloud, directoryUser: directoryUser)
+            tableView.reloadData()
+            
+        default :
+            
+            print("selector : \(selector!)")
+            tableView.reloadData()
+            
+        }
+    }
+ 
+    //  MARK: - Upload
+    
+    func uploadFileFailure(_ fileID: String!, serverUrl: String!, selector: String!, message: String!, errorCode: Int) {
+        
+        hud.hideHud()
+        
+        // remove file
+        CCCoreData.deleteMetadata(with: NSPredicate(format: "(account == '\(activeAccount!)') AND (fileID == '\(fileID!)')"))
+        
+        if errorCode != -999 {
+            
+            let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: message, preferredStyle: .alert)
+            alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
+                //self.dismissGrantingAccess(to: nil)
+                NSLog("[LOG] Download Error \(fileID) \(message) (error \(errorCode))");
+            })
+            
+            self.present(alert, animated: true, completion: nil)
+        }
+    }
+    
+    func uploadFileSuccess(_ fileID: String!, serverUrl: String!, selector: String!, selectorPost: String!) {
+        
+        hud.hideHud()
+        
+        dismissGrantingAccess(to: self.destinationURL)
+    }
+}
+
+// MARK: - IBActions
+
+extension DocumentPickerViewController {
+    
+    @IBAction func encryptedButtonTapped(_ sender: AnyObject) {
+
+        parameterEncrypted = !parameterEncrypted!
+        
+        if parameterEncrypted == true {
+            encryptedButton.tintColor = colorEncrypted
+        } else {
+            encryptedButton.tintColor = self.view.tintColor
+        }
+        
+        saveButton.tintColor = encryptedButton.tintColor
+    }
+    
+    @IBAction func saveButtonTapped(_ sender: AnyObject) {
+        
+        guard let sourceURL = parameterOriginalURL else {
+            return
+        }
+        
+        switch parameterMode! {
+            
+        case .moveToService, .exportToService:
+            
+            let fileName = sourceURL.lastPathComponent
+            
+            guard let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!) else {
+                
+                return
+            }
+            
+            self.destinationURL = appGroupContainerURL()?.appendingPathComponent(fileName)
+            
+            // copy sourceURL on directoryUser
+            do {
+                try FileManager.default.removeItem(at: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+            }
+            
+            do {
+                try FileManager.default.copyItem(at: sourceURL, to: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+                return
+            }
+
+            fileCoordinator.coordinate(readingItemAt: sourceURL, options: .withoutChanges, error: nil, byAccessor: { [weak self] newURL in
+                
+                do {
+                    try FileManager.default.removeItem(at: (self?.destinationURL)!)
+                } catch _ {
+                    print("file do not exists")
+                }
+                
+                do {
+                    try FileManager.default.copyItem(at: sourceURL, to: (self?.destinationURL)!)
+                    
+                    // Upload fileName to Cloud
+                    
+                    let metadataNet = CCMetadataNet.init(account: self!.activeAccount)!
+                    
+                    metadataNet.action = actionUploadFile
+                    metadataNet.cryptated = self!.parameterEncrypted!
+                    metadataNet.fileName = fileName
+                    metadataNet.fileNamePrint = fileName
+                    metadataNet.serverUrl = self!.localServerUrl
+                    metadataNet.session = upload_session_foreground
+                    metadataNet.taskStatus = Int(taskStatusResume)
+                    
+                    let ocNetworking : OCnetworking = OCnetworking.init(delegate: self!, metadataNet: metadataNet, withUser: self!.activeUser, withPassword: self!.activePassword, withUrl: self!.activeUrl, withTypeCloud: self!.typeCloud, activityIndicator: false)
+                    self!.networkingOperationQueue.addOperation(ocNetworking)
+                    
+                    self!.hud.visibleHudTitle(NSLocalizedString("_uploading_", comment: ""), mode: MBProgressHUDMode.determinateHorizontalBar, color: self!.navigationController?.view.tintColor)
+                    self!.hud.addButtonCancel(withTarget: self, selector: "cancelTransfer")
+                    
+                } catch _ {
+                    
+                    print("error copying file")
+                }
+            })
+        
+        default:
+            dismiss(animated: true, completion: nil)
+        }
+    }
+    
+    func appGroupContainerURL() -> URL? {
+        
+        guard let groupURL = FileManager.default
+            .containerURL(forSecurityApplicationGroupIdentifier: capabilitiesGroups) else {
+                return nil
+        }
+        
+        let storagePathUrl = groupURL.appendingPathComponent("File Provider Storage")
+        let storagePath = storagePathUrl.path
+        
+        if !FileManager.default.fileExists(atPath: storagePath) {
+            do {
+                try FileManager.default.createDirectory(atPath: storagePath, withIntermediateDirectories: false, attributes: nil)
+            } catch let error {
+                print("error creating filepath: \(error)")
+                return nil
+            }
+        }
+        
+        return storagePathUrl
+    }
+    
+    // MARK: - Passcode
+    
+    func openBKPasscode(_ title : String?) {
+        
+        let viewController = CCBKPasscode.init()
+        
+        viewController.delegate = self
+        viewController.type = BKPasscodeViewControllerCheckPasscodeType
+        viewController.inputViewTitlePassword = true
+        
+        if CCUtility.getSimplyBlockCode() {
+            
+            viewController.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle
+            viewController.passcodeInputView.maximumLength = 6
+            
+        } else {
+            
+            viewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle
+            viewController.passcodeInputView.maximumLength = 64
+        }
+        
+        let touchIDManager = BKTouchIDManager.init(keychainServiceName: BKPasscodeKeychainServiceName)
+        touchIDManager?.promptText = NSLocalizedString("_scan_fingerprint_", comment: "")
+        viewController.touchIDManager = touchIDManager
+        viewController.title = title
+        viewController.navigationItem.leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(passcodeViewCloseButtonPressed(sender:)))
+        viewController.navigationItem.leftBarButtonItem?.tintColor = colorEncrypted
+        
+        let navController = UINavigationController.init(rootViewController: viewController)
+        self.present(navController, animated: true, completion: nil)
+    }
+
+    func passcodeViewControllerNumber(ofFailedAttempts aViewController: BKPasscodeViewController!) -> UInt {
+        
+        return passcodeFailedAttempts
+    }
+    
+    func passcodeViewControllerLock(untilDate aViewController: BKPasscodeViewController!) -> Date! {
+        
+        return passcodeLockUntilDate
+    }
+    
+    func passcodeViewControllerDidFailAttempt(_ aViewController: BKPasscodeViewController!) {
+        
+        passcodeFailedAttempts += 1
+        
+        if passcodeFailedAttempts > 5 {
+            
+            var timeInterval: TimeInterval = 60
+            
+            if passcodeFailedAttempts > 6 {
+                
+                let multiplier = passcodeFailedAttempts - 6
+                
+                timeInterval = TimeInterval(5 * 60 * multiplier)
+                
+                if timeInterval > 3600 * 24 {
+                    timeInterval = 3600 * 24
+                }
+            }
+            
+            passcodeLockUntilDate = Date.init(timeIntervalSinceNow: timeInterval)
+        }
+    }
+    
+    func passcodeViewController(_ aViewController: BKPasscodeViewController!, authenticatePasscode aPasscode: String!, resultHandler aResultHandler: ((Bool) -> Void)!) {
+        
+        if aPasscode == CCUtility.getBlockCode() {
+            passcodeLockUntilDate = nil
+            passcodeFailedAttempts = 0
+            aResultHandler(true)
+        } else {
+            aResultHandler(false)
+        }
+    }
+    
+    public func passcodeViewController(_ aViewController: BKPasscodeViewController!, didFinishWithPasscode aPasscode: String!) {
+        
+        parameterPasscodeCorrect = true
+        aViewController.dismiss(animated: true, completion: nil)
+        
+        if self.passcodeIsPush == true {
+            performSegue()
+        }
+    }
+    
+    func passcodeViewCloseButtonPressed(sender :Any) {
+        
+        dismiss(animated: true, completion: {
+            if self.passcodeIsPush == false {
+                self.dismissGrantingAccess(to: nil)
+            }
+        })
+    }
+}
+
+// MARK: - UITableViewDelegate
+
+extension DocumentPickerViewController: UITableViewDelegate {
+
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        
+         return 50
+    }
+}
+
+// MARK: - UITableViewDataSource
+
+extension DocumentPickerViewController: UITableViewDataSource {
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        
+        if (recordsTableMetadata == nil) {
+            
+            return 0
+            
+        } else {
+            
+            return recordsTableMetadata!.count
+        }
+    }
+        
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        
+        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! recordMetadataCell
+        
+        cell.separatorInset = UIEdgeInsetsMake(0, 60, 0, 0)
+        
+        let recordTableMetadata = recordsTableMetadata?[(indexPath as NSIndexPath).row]
+        let metadata = CCCoreData.insertEntity(in: recordTableMetadata)!
+        
+        // File Image View
+        let filePath = "\(directoryUser!)/\(metadata.fileID!).ico"
+        
+        if FileManager.default.fileExists(atPath: filePath) {
+            
+            cell.fileImageView.image = UIImage(contentsOfFile: filePath)
+            
+        } else {
+            
+            cell.fileImageView.image = UIImage(named: metadata.iconName!)
+            
+            if metadata.thumbnailExists && metadata.directory == false {
+                
+                downloadThumbnail(metadata)
+                thumbnailInLoading[metadata.fileID] = indexPath
+            }
+        }
+        
+        // File Name
+        cell.fileName.text = metadata.fileNamePrint
+        
+        // Status Image View
+        let lockServerUrl = CCUtility.stringAppendServerUrl(localServerUrl!, addServerUrl: metadata.fileNameData)
+        
+        var passcode: String? = CCUtility.getBlockCode()
+        if passcode == nil {
+            passcode = ""
+        }
+        
+        if metadata.directory && CCCoreData.isDirectoryLock(lockServerUrl, activeAccount: activeAccount) && (passcode?.characters.count)! > 0 {
+            cell.StatusImageView.image = UIImage(named: image_passcode)
+        }
+        
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        
+        let recordTableMetadata = recordsTableMetadata?[(indexPath as NSIndexPath).row]
+
+        tableView.deselectRow(at: indexPath, animated: true)
+        
+        // Error passcode ?
+        if (recordTableMetadata?.errorPasscode == 1) {
+            return
+        }
+        
+        self.metadata = CCCoreData.insertEntity(in: recordTableMetadata)!
+
+        if recordTableMetadata!.directory == 0 {
+            
+            if FileManager.default.fileExists(atPath: "\(directoryUser!)/\(self.metadata?.fileID!)") {
+                
+                downloadFileSuccess(self.metadata?.fileID!, serverUrl: localServerUrl!, selector: selectorLoadFileView, selectorPost: nil)
+                
+            } else {
+            
+                // Download file
+                let metadataNet = CCMetadataNet.init(account: activeAccount)!
+            
+                metadataNet.action = actionDownloadFile
+                metadataNet.downloadData = true
+                metadataNet.downloadPlist = false
+                metadataNet.metadata = metadata
+                metadataNet.selector = selectorLoadFileView
+                metadataNet.serverUrl = localServerUrl
+                metadataNet.session = download_session_foreground
+                metadataNet.taskStatus = Int(taskStatusResume)
+            
+                let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, withTypeCloud: typeCloud, activityIndicator: false)
+                networkingOperationQueue.addOperation(ocNetworking)
+                
+                hud.visibleHudTitle(NSLocalizedString("_loading_", comment: ""), mode: MBProgressHUDMode.determinateHorizontalBar, color: self.navigationController?.view.tintColor)
+                hud.addButtonCancel(withTarget: self, selector: "cancelTransfer")
+            }
+            
+        } else {
+            
+            var dir : String! = self.metadata?.fileName!
+            
+            if (self.metadata?.cryptated)! {
+                
+                dir = CCUtility.trasformedFileNamePlist(inCrypto: self.metadata?.fileName)
+            }
+            
+            serverUrlPush = CCUtility.stringAppendServerUrl(localServerUrl!, addServerUrl: dir)
+
+            var passcode: String? = CCUtility.getBlockCode()
+            if passcode == nil {
+                passcode = ""
+            }
+            
+            if CCCoreData.isDirectoryLock(serverUrlPush, activeAccount: activeAccount) && (passcode?.characters.count)! > 0 {
+                
+                self.passcodeIsPush = true
+                openBKPasscode(self.metadata?.fileNamePrint)
+                
+            } else {
+            
+                performSegue()
+            }
+        }
+    }
+    
+    func performSegue() {
+        
+        let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "DocumentPickerViewController") as! DocumentPickerViewController
+        
+        nextViewController.parameterMode = parameterMode
+        nextViewController.parameterOriginalURL = parameterOriginalURL
+        nextViewController.parameterProviderIdentifier = parameterProviderIdentifier
+        nextViewController.parameterPasscodeCorrect = parameterPasscodeCorrect
+        nextViewController.parameterEncrypted = parameterEncrypted
+        nextViewController.localServerUrl = serverUrlPush
+        nextViewController.titleFolder = self.metadata?.fileNamePrint
+        
+        self.navigationController?.pushViewController(nextViewController, animated: true)
+    }
+
+}
+
+
+
+// MARK: - Class UITableViewCell
+
+class recordMetadataCell: UITableViewCell {
+    
+    @IBOutlet weak var fileImageView: UIImageView!
+    @IBOutlet weak var StatusImageView: UIImageView!
+    @IBOutlet weak var fileName : UILabel!
+}
+
+// MARK: - Class providerSession
+
+class providerSessionDB {
+    
+    class var sharedInstance : providerSessionDB {
+        
+        struct Static {
+            
+            static let instance = providerSessionDB()
+        }
+        
+        return Static.instance
+    }
+    
+    private init() {
+    
+        let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: capabilitiesGroups)
+        let pathDB = dirGroup?.appendingPathComponent(appDatabase).appendingPathComponent("cryptocloud")
+        
+        MagicalRecord.setupCoreDataStackWithAutoMigratingSqliteStore(at: pathDB!)
+        MagicalRecord.setLoggingLevel(MagicalRecordLoggingLevel.off)
+    }
+}

+ 56 - 0
Picker/Info.plist

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleDisplayName</key>
+	<string>Nextcloud</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>XPC!</string>
+	<key>CFBundleShortVersionString</key>
+	<string>2.17</string>
+	<key>CFBundleVersion</key>
+	<string>00001</string>
+	<key>NSExtension</key>
+	<dict>
+		<key>NSExtensionAttributes</key>
+		<dict>
+			<key>UIDocumentPickerModes</key>
+			<array>
+				<string>UIDocumentPickerModeImport</string>
+				<string>UIDocumentPickerModeOpen</string>
+				<string>UIDocumentPickerModeExportToService</string>
+				<string>UIDocumentPickerModeMoveToService</string>
+			</array>
+			<key>UIDocumentPickerSupportedFileTypes</key>
+			<array>
+				<string>public.content</string>
+				<string>public.text</string>
+				<string>public.plain-text</string>
+				<string>public.html</string>
+				<string>public.presentation</string>
+				<string>public.video</string>
+				<string>public.mpeg</string>
+				<string>public.audio</string>
+				<string>public.image</string>
+				<string>public.jpeg</string>
+				<string>public.tiff</string>
+				<string>public.data</string>
+			</array>
+		</dict>
+		<key>NSExtensionMainStoryboard</key>
+		<string>MainInterface</string>
+		<key>NSExtensionPointIdentifier</key>
+		<string>com.apple.fileprovider-ui</string>
+	</dict>
+</dict>
+</plist>

+ 13 - 0
Picker/Picker-Bridging-Header.h

@@ -0,0 +1,13 @@
+//
+//  Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import <MagicalRecord/MagicalRecord.h>
+#import "TableAccount.h"
+#import "CCNetworking.h"
+#import "OCNetworking.h"
+#import "CCCoreData.h"
+#import "CCGlobal.h"
+#import "CCHud.h"
+#import "BKPasscodeViewController.h"
+#import "CCBKPasscode.h"

+ 14 - 0
Picker/Picker.entitlements

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.security.application-groups</key>
+	<array>
+		<string>group.it.twsweb.Crypto-Cloud</string>
+	</array>
+	<key>keychain-access-groups</key>
+	<array>
+		<string>$(AppIdentifierPrefix)it.twsweb.Crypto-Cloud</string>
+	</array>
+</dict>
+</plist>

+ 101 - 0
PickerFileProvider/FileProvider.swift

@@ -0,0 +1,101 @@
+//
+//  FileProvider.swift
+//  PickerFileProvider
+//
+//  Created by Marino Faggiana on 27/12/16.
+//  Copyright © 2016 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import UIKit
+
+class FileProvider: NSFileProviderExtension {
+
+    var fileCoordinator: NSFileCoordinator {
+        let fileCoordinator = NSFileCoordinator()
+        fileCoordinator.purposeIdentifier = self.providerIdentifier
+        return fileCoordinator
+    }
+    
+    override init() {
+        super.init()
+        
+        self.fileCoordinator.coordinate(writingItemAt: self.documentStorageURL, options: [], error: nil, byAccessor: { newURL in
+            // ensure the documentStorageURL actually exists
+            do {
+                try FileManager.default.createDirectory(at: newURL, withIntermediateDirectories: true, attributes: nil)
+            } catch {
+                // Handle error
+            }
+        })
+    }
+    
+    override func providePlaceholder(at url: URL, completionHandler: ((_ error: Error?) -> Void)?) {
+        // Should call writePlaceholderAtURL(_:withMetadata:error:) with the placeholder URL, then call the completion handler with the error if applicable.
+        let fileName = url.lastPathComponent
+        
+        let placeholderURL = NSFileProviderExtension.placeholderURL(for: self.documentStorageURL.appendingPathComponent(fileName))
+        
+        // TODO: get file size for file at <url> from model
+        let fileSize = 0
+        let metadata = [AnyHashable(URLResourceKey.fileSizeKey): fileSize]
+        do {
+            try NSFileProviderExtension.writePlaceholder(at: placeholderURL, withMetadata: metadata)
+        } catch {
+            // Handle error
+        }
+        
+        completionHandler?(nil)
+    }
+    
+    override func startProvidingItem(at url: URL, completionHandler: ((_ error: Error?) -> Void)?) {
+        // Should ensure that the actual file is in the position returned by URLForItemWithIdentifier, then call the completion handler
+        
+        // TODO: get the contents of file at <url> from model
+        let fileData = NSData()
+        
+        do {
+            _ = try fileData.write(to: url, options: [])
+        } catch {
+            // Handle error
+        }
+        
+        completionHandler?(nil);
+    }
+    
+    override func itemChanged(at url: URL) {
+        // Called at some point after the file has changed; the provider may then trigger an upload
+        
+        // TODO: mark file at <url> as needing an update in the model; kick off update process
+        NSLog("Item changed at URL %@", url as NSURL)
+    }
+    
+    override func stopProvidingItem(at url: URL) {
+        // Called after the last claim to the file has been released. At this point, it is safe for the file provider to remove the content file.
+        // Care should be taken that the corresponding placeholder file stays behind after the content file has been deleted.
+        
+        do {
+            _ = try FileManager.default.removeItem(at: url)
+        } catch {
+            // Handle error
+        }
+        self.providePlaceholder(at: url, completionHandler: { error in
+            // TODO: handle any error, do any necessary cleanup
+        })
+    }
+
+}

+ 33 - 0
PickerFileProvider/Info.plist

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleDisplayName</key>
+	<string>PickerFileProvider</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>XPC!</string>
+	<key>CFBundleShortVersionString</key>
+	<string>2.17</string>
+	<key>CFBundleVersion</key>
+	<string>00001</string>
+	<key>NSExtension</key>
+	<dict>
+		<key>NSExtensionFileProviderDocumentGroup</key>
+		<string>group.it.twsweb.Crypto-Cloud</string>
+		<key>NSExtensionPointIdentifier</key>
+		<string>com.apple.fileprovider-nonui</string>
+		<key>NSExtensionPrincipalClass</key>
+		<string>$(PRODUCT_MODULE_NAME).FileProvider</string>
+	</dict>
+</dict>
+</plist>

+ 14 - 0
PickerFileProvider/PickerFileProvider.entitlements

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.security.application-groups</key>
+	<array>
+		<string>group.it.twsweb.Crypto-Cloud</string>
+	</array>
+	<key>keychain-access-groups</key>
+	<array>
+		<string>$(AppIdentifierPrefix)it.twsweb.Crypto-Cloud</string>
+	</array>
+</dict>
+</plist>

+ 1 - 1
Share Ext/InfoNextcloud.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.16</string>
+	<string>2.17</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>

+ 3 - 3
Share Ext/ShareViewController.m

@@ -119,7 +119,7 @@
     _hud = [[CCHud alloc] initWithView:self.navigationController.view];
     
     _networkingOperationQueue = [[NSOperationQueue alloc] init];
-    _networkingOperationQueue.name = @"it.twsweb.cryptocloud.queue";
+    _networkingOperationQueue.name = netQueueName;
     _networkingOperationQueue.maxConcurrentOperationCount = 1;
     
     [[CCNetworking sharedNetworking] settingDelegate:self];
@@ -369,14 +369,14 @@
     /*** NEXTCLOUD OWNCLOUD ***/
     
     if ([_typeCloud isEqualToString:typeCloudOwnCloud] || [_typeCloud isEqualToString:typeCloudNextcloud])
-        operation = [[OCnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withTypeCloud:_typeCloud oneByOne:YES activityIndicator:NO];
+        operation = [[OCnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withTypeCloud:_typeCloud activityIndicator:NO];
     
 #ifdef CC
     
     /*** DROPBOX ***/
 
     if ([_typeCloud isEqualToString:typeCloudDropbox])
-        operation = [[DBnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withActiveUID:_activeUID withActiveAccessToken:_activeAccessToken oneByOne:YES activityIndicator:NO];
+        operation = [[DBnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withActiveUID:_activeUID withActiveAccessToken:_activeAccessToken activityIndicator:NO];
 #endif
     
     [operation setQueuePriority:metadataNet.priority];

+ 3 - 1
iOSClient/AppDelegate.h

@@ -175,9 +175,11 @@
 - (void)updateApplicationIconBadgeNumber;
 - (BOOL)handleShortCutItem:(UIApplicationShortcutItem *)shortcutItem;
 
+- (void)plusButtonVisibile:(BOOL)visible;
+
 // Operation Networking
 - (void)cancelAllOperations;
-- (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet oneByOne:(BOOL)oneByOne;
+- (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet;
 
 - (NSMutableArray *)verifyExistsInQueuesDownloadSelector:(NSString *)selector;
 - (NSMutableArray *)verifyExistsInQueuesUploadSelector:(NSString *)selector;

+ 113 - 10
iOSClient/AppDelegate.m

@@ -38,6 +38,8 @@
 #import "CCMain.h"
 #import "CCDetail.h"
 
+#import "Nextcloud-Swift.h"
+
 @interface AppDelegate ()
 {
     
@@ -217,11 +219,15 @@
     [self.window setTintColor:COLOR_BRAND];
     
     UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    //UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
     UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
-    
+
     navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
     splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;
     
+    // Settings TabBar
+    [self createTabBarController];
+    
     // passcode
     [[BKPasscodeLockScreenManager sharedManager] setDelegate:self];
     
@@ -711,6 +717,103 @@
     return iconImage;
 }
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== TabBarController =====
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)createTabBarController
+{
+    UITabBarItem *item;
+    NSLayoutConstraint *constraint;
+    
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
+    
+    [CCAspect aspectTabBar:tabBarController.tabBar hidden:NO];
+    
+    // File
+    item = [tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexFile];
+    [item setTitle:NSLocalizedString(@"_home_", nil)];
+    item.image = [UIImage imageNamed:image_tabBarFile];
+    item.selectedImage = [UIImage imageNamed:image_tabBarFile];
+    
+    // Favorite - Local
+    item = [tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexFavorite];
+    if (app.isLocalStorage) {
+        [item setTitle:NSLocalizedString(@"_local_storage_", nil)];
+        item.image = [UIImage imageNamed:image_tabBarLocal];
+        item.selectedImage = [UIImage imageNamed:image_tabBarLocal];
+    } else {
+        [item setTitle:NSLocalizedString(@"_favorites_", nil)];
+        item.image = [UIImage imageNamed:image_tabBarFavorite];
+        item.selectedImage = [UIImage imageNamed:image_tabBarFavorite];
+    }
+    
+    // Hide (PLUS)
+    item = [tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexHide];
+    item.title = nil;
+    item.image = nil;
+    item.enabled = false;
+    
+    // Photos
+    item = [tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexPhotos];
+    [item setTitle:NSLocalizedString(@"_photo_camera_", nil)];
+    item.image = [UIImage imageNamed:image_tabBarPhotos];
+    item.selectedImage = [UIImage imageNamed:image_tabBarPhotos];
+    
+    // Settings
+    item = [tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexSettings];
+    [item setTitle:NSLocalizedString(@"_settings_", nil)];
+    item.image = [UIImage imageNamed:image_tabBarSettings];
+    item.selectedImage = [UIImage imageNamed:image_tabBarSettings];
+    
+    // Plus Button
+    UIImage *buttonImage = [UIImage imageNamed:@"Plus"];
+    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+    button.tag = 99;
+    button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
+    [button setBackgroundImage:buttonImage forState:UIControlStateNormal];
+    [button setBackgroundImage:buttonImage forState:UIControlStateHighlighted];
+    [button addTarget:self action:@selector(handleTouchTabbarCenter:) forControlEvents:UIControlEventTouchUpInside];
+    
+    [button setTranslatesAutoresizingMaskIntoConstraints:NO];
+    [tabBarController.view addSubview:button];
+    
+    constraint =[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:tabBarController.view attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:0];
+    
+    [tabBarController.view addConstraint:constraint];
+    
+    constraint =[NSLayoutConstraint constraintWithItem:button attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:tabBarController.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
+    
+    [tabBarController.view addConstraint:constraint];
+}
+
+- (void)plusButtonVisibile:(BOOL)visible
+{
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
+    
+    UIButton *buttonPlus = [tabBarController.view viewWithTag:99];
+    if (buttonPlus) {
+
+        if (visible) {
+            
+            buttonPlus.hidden = false;
+        
+        } else {
+            
+            buttonPlus.hidden = true;
+        }
+    }
+}
+
+- (void)handleTouchTabbarCenter:(id)sender
+{
+    CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] init];
+    
+    [menuAdd createMenuPlainWithView:self.window.rootViewController.view];
+}
+
 - (void)updateApplicationIconBadgeNumber
 {
     // Core Data
@@ -731,10 +834,10 @@
 #ifdef CC
         
         /*** DROPBOX ***/
-
+        
         if ([app.typeCloud isEqualToString:typeCloudDropbox])
             if (((DBnetworking *)operation).isExecuting == NO) _queueNunDownload++;
-
+        
 #endif
     }
     
@@ -752,7 +855,7 @@
         
         if ([app.typeCloud isEqualToString:typeCloudDropbox])
             if (((DBnetworking *)operation).isExecuting == NO) _queueNumDownloadWWan++;
-
+        
 #endif
     }
     
@@ -788,8 +891,8 @@
         if ([app.typeCloud isEqualToString:typeCloudDropbox])
             if (((DBnetworking *)operation).isExecuting == NO) _queueNumUploadWWan++;
 #endif
-     }
-
+    }
+    
     // Total
     NSUInteger total = _queueNunDownload + _queueNumDownloadWWan + _queueNumUpload + _queueNumUploadWWan + [CCCoreData countTableAutomaticUploadForAccount:self.activeAccount selector:nil];
     
@@ -1019,7 +1122,7 @@
     [self performSelector:@selector(updateApplicationIconBadgeNumber) withObject:nil afterDelay:0.5];
 }
 
-- (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet oneByOne:(BOOL)oneByOne
+- (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet
 {
     id operation;
     BOOL activityIndicator = NO;
@@ -1031,14 +1134,14 @@
     /*** NEXTCLOUD OWNCLOUD ***/
     
     if ([_typeCloud isEqualToString:typeCloudOwnCloud] || [_typeCloud isEqualToString:typeCloudNextcloud])
-        operation = [[OCnetworking alloc] initWithDelegate:delegate metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withTypeCloud:_typeCloud oneByOne:oneByOne activityIndicator:activityIndicator];
+        operation = [[OCnetworking alloc] initWithDelegate:delegate metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withTypeCloud:_typeCloud activityIndicator:activityIndicator];
     
 #ifdef CC
     
     /*** DROPBOX ***/
     
     if ([_typeCloud isEqualToString:typeCloudDropbox])
-        operation = [[DBnetworking alloc] initWithDelegate:delegate metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withActiveUID:_activeUID withActiveAccessToken:_activeAccessToken oneByOne:oneByOne activityIndicator:activityIndicator];
+        operation = [[DBnetworking alloc] initWithDelegate:delegate metadataNet:metadataNet withUser:_activeUser withPassword:_activePassword withUrl:_activeUrl withActiveUID:_activeUID withActiveAccessToken:_activeAccessToken activityIndicator:activityIndicator];
 #endif
     
     [operation setQueuePriority:metadataNet.priority];
@@ -1156,7 +1259,7 @@
         else
             queue = app.netQueueUpload;
         
-        [self addNetworkingOperationQueue:queue delegate:app.activeMain metadataNet:metadataNet oneByOne:YES];
+        [self addNetworkingOperationQueue:queue delegate:app.activeMain metadataNet:metadataNet];
     }
 }
 

+ 18 - 15
iOSClient/CCGlobal.h

@@ -41,7 +41,7 @@ extern NSString *const urlBaseUploadDB;
 
 extern NSString *const BKPasscodeKeychainServiceName;
 
-#ifndef SHARE_IN
+#ifndef EXTENSION
 
 //AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
 #define app ((AppDelegate *)[[UIApplication sharedApplication] delegate])
@@ -117,18 +117,20 @@ extern NSString *const BKPasscodeKeychainServiceName;
 #define MaxGroupBySessionUploadDatasource 50
 #define MaxGroupBySessionDownloadDatasource 50
 
-#define returnCreaCartellaChiaro 0
-#define returnCreaFotoVideoChiaro 1
-#define returnCreaCartellaCriptata 2
-#define returnCreaFotoVideoCriptato 3
-#define returnCartaDiCredito 4
-#define returnBancomat 5
-#define returnContoCorrente 6
-#define returnAccountWeb 7
-#define returnNote 8
-#define returnPatenteGuida 9
-#define returnCartaIdentita 10
-#define returnPassaporto 11
+#define returnCreateFolderPlain 0
+#define returnCreateFotoVideoPlain 1
+#define returnCreateFilePlain 2
+#define returnCreateFolderEncrypted 3
+#define returnCreateFotoVideoEncrypted 4
+#define returnCreateFileEncrypted 5
+#define returnCartaDiCredito 6
+#define returnBancomat 7
+#define returnContoCorrente 8
+#define returnAccountWeb 9
+#define returnNote 10
+#define returnPatenteGuida 11
+#define returnCartaIdentita 12
+#define returnPassaporto 13
 
 #define RalewayBold(s) [UIFont fontWithName:@"Raleway-Bold" size:s]
 #define RalewayExtraBold(s) [UIFont fontWithName:@"Raleway-ExtraBold" size:s]
@@ -298,8 +300,9 @@ extern NSString *const BKPasscodeKeychainServiceName;
 
 #define TabBarApplicationIndexFile      0
 #define TabBarApplicationIndexFavorite  1
-#define TabBarApplicationIndexPhotos    2
-#define TabBarApplicationIndexSettings  3
+#define TabBarApplicationIndexHide      2
+#define TabBarApplicationIndexPhotos    3
+#define TabBarApplicationIndexSettings  4
 
 @interface CCAspect : NSObject
 

+ 8 - 10
iOSClient/CCImages.h

@@ -31,18 +31,16 @@
 #define image_launchscreen                      @"nextcloudlaunchscreen"
 #endif
 
-#define image_actionSheetOpenIn                 @"actionSheetOpenIn"
-#define image_actionSheetRename                 @"actionSheetRename"
-#define image_actionSheetMove                   @"actionSheetMove"
+#define image_actionSheetRename                 @"renameNextcloud"
+#define image_actionSheetMove                   @"moveNextcloud"
 #define image_actionSheetCrypto                 @"actionSheetCrypto"
 #define image_actionSheetLock                   @"actionSheetLock"
-#define image_actionSheetShare                  @"actionSheetShare"
-#define image_actionSheetSynchronized           @"actionSheetSynchronized"
-#define image_actionSheetReload                 @"actionSheetReload"
-#define image_actionSheetOpenIn                 @"actionSheetOpenIn"
-#define image_actionSheetShare                  @"actionSheetShare"
-#define image_actionSheetFavorite               @"actionSheetFavorite"
-#define image_actionSheetLocal                  @"actionSheetLocal"
+#define image_actionSheetShare                  @"shareNextcloud"
+#define image_actionSheetSynchronized           @"SynchronizedNextcloud"
+#define image_actionSheetReload                 @"reloadNextcloud"
+#define image_actionSheetOpenIn                 @"openInNextcloud"
+#define image_actionSheetFavorite               @"favoriteNextcloud"
+#define image_actionSheetLocal                  @"localStorageNextcloud"
 
 #ifdef CC
 #define image_activeCameraUpload_en             @"activeCameraUpload_en"

+ 264 - 0
iOSClient/Create/CCCreateCloud.swift

@@ -0,0 +1,264 @@
+//
+//  CCCreateCloud.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 09/01/17.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+
+// MARK: - CreateMenuAdd
+
+class CreateMenuAdd: NSObject {
+    
+    let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 14)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
+    let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 14)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 241.0/255.0, green: 90.0/255.0, blue: 34.0/255.0, alpha: 1.0)]
+    let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)]
+    
+    let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
+    
+    func createMenuPlain(view : UIView) {
+        
+        let appDelegate = UIApplication.shared.delegate as! AppDelegate
+        let actionSheet = AHKActionSheet.init(view: view, title: nil)
+        
+        actionSheet?.animationDuration = 0.2
+        actionSheet?.cancelOnTapEmptyAreaEnabled = 1
+        actionSheet?.automaticallyTintButtonImages = 0
+        
+        actionSheet?.blurRadius = 0.0
+        actionSheet?.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
+        
+        actionSheet?.buttonHeight = 50.0
+        actionSheet?.cancelButtonHeight = 50.0
+        actionSheet?.separatorHeight = 30.0
+        
+        actionSheet?.selectedBackgroundColor = UIColor(colorLiteralRed: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 0.1)
+        actionSheet?.separatorColor = UIColor(colorLiteralRed: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 0.2)
+        
+        actionSheet?.buttonTextAttributes = fontButton
+        actionSheet?.encryptedButtonTextAttributes = fontEncrypted
+        actionSheet?.cancelButtonTextAttributes = fontCancel
+        
+        actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
+
+        actionSheet?.addButton(withTitle: "Create a new folder", image: UIImage(named: "createFolderNextcloud"), backgroundColor: UIColor.white, height: 50.0 ,type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFolderPlain))
+        })
+        
+        actionSheet?.addButton(withTitle: "Upload photos and videos", image: UIImage(named: "uploadPhotoNextcloud"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFotoVideoPlain))
+        })
+        
+        actionSheet?.addButton(withTitle: "Upload a file", image: UIImage(named: "uploadFileNextcloud"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFilePlain))
+        })
+        
+        actionSheet?.addButton(withTitle: "Upload Encrypted mode", image: UIImage(named: "actionSheetLock"), backgroundColor: colorLightGray, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            self.createMenuEncrypted(view: view)
+        })
+        
+        actionSheet?.show()
+    }
+    
+    func createMenuEncrypted(view : UIView) {
+        
+        let appDelegate = UIApplication.shared.delegate as! AppDelegate
+        let actionSheet = AHKActionSheet.init(view: view, title: nil)
+        
+        actionSheet?.animationDuration = 0.2
+        actionSheet?.cancelOnTapEmptyAreaEnabled = 1
+        
+        actionSheet?.blurRadius = 0.0
+        actionSheet?.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
+
+        actionSheet?.buttonHeight = 50.0
+        actionSheet?.cancelButtonHeight = 50.0
+        actionSheet?.separatorHeight = 30.0
+        
+        actionSheet?.selectedBackgroundColor = UIColor(colorLiteralRed: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 0.1)
+        actionSheet?.separatorColor = UIColor(colorLiteralRed: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 0.2)
+
+        actionSheet?.buttonTextAttributes = fontButton
+        actionSheet?.encryptedButtonTextAttributes = fontEncrypted
+        actionSheet?.cancelButtonTextAttributes = fontCancel
+        
+        actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
+        
+        actionSheet?.addButton(withTitle: "Create a new folder", image: UIImage(named: "foldercrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFolderEncrypted))
+        })
+        
+        actionSheet?.addButton(withTitle: "Upload photos and videos", image: UIImage(named: "photocrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFotoVideoEncrypted))
+        })
+        
+        actionSheet?.addButton(withTitle: "Upload a file", image: UIImage(named: "importCloudCrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCreateFileEncrypted))
+        })
+
+        actionSheet?.addButton(withTitle: NSLocalizedString("Upload Template", comment: ""), image: UIImage(named: "template"), backgroundColor: colorLightGray, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            self.createMenuTemplate(view: view)
+        })
+
+        actionSheet?.show()
+    }
+
+    func createMenuTemplate(view : UIView) {
+        
+        let appDelegate = UIApplication.shared.delegate as! AppDelegate
+        let actionSheet = AHKActionSheet.init(view: view, title: nil)
+        
+        actionSheet?.animationDuration = 0.2
+        actionSheet?.cancelOnTapEmptyAreaEnabled = 1
+        
+        actionSheet?.blurRadius = 0.0
+        actionSheet?.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
+
+        actionSheet?.buttonHeight = 50.0
+        actionSheet?.cancelButtonHeight = 50.0
+        actionSheet?.separatorHeight = 30.0
+        
+        actionSheet?.selectedBackgroundColor = UIColor(colorLiteralRed: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 0.1)
+        actionSheet?.separatorColor = UIColor(colorLiteralRed: 153.0/255.0, green: 153.0/255.0, blue: 153.0/255.0, alpha: 0.2)
+
+        actionSheet?.buttonTextAttributes = fontButton
+        actionSheet?.encryptedButtonTextAttributes = fontEncrypted
+        actionSheet?.cancelButtonTextAttributes = fontCancel
+        
+        actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_notes_", comment: ""), image: UIImage(named: "note"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnNote))
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_web_account_", comment: ""), image: UIImage(named: "baseurl"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnAccountWeb))
+        })
+        
+        actionSheet?.addButton(withTitle: "", image: nil, backgroundColor: UIColor.white, height: 10.0, type: AHKActionSheetButtonType.disabled, handler: {(AHKActionSheet) -> Void in
+            print("disable")
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_credit_card_", comment: ""), image: UIImage(named: "cartadicredito"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCartaDiCredito))
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_atm_", comment: ""), image: UIImage(named: "bancomat"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnBancomat))
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_bank_account_", comment: ""), image: UIImage(named: "contocorrente"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnContoCorrente))
+        })
+        
+        actionSheet?.addButton(withTitle: "", image: nil, backgroundColor: UIColor.white, height: 10.0, type: AHKActionSheetButtonType.disabled, handler: {(AHKActionSheet) -> Void in
+            print("disable")
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_driving_license_", comment: ""), image: UIImage(named: "patenteguida"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnPatenteGuida))
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_id_card_", comment: ""), image: UIImage(named: "cartaidentita"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnCartaIdentita))
+        })
+        
+        actionSheet?.addButton(withTitle: NSLocalizedString("_add_passport_", comment: ""), image: UIImage(named: "passaporto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(returnPassaporto))
+        })
+        
+        actionSheet?.show()
+    }
+
+}
+
+// MARK: - CreateFormUpload
+
+class CreateFormUpload: XLFormViewController {
+    
+    var destinationFolder : String?
+    
+    convenience init(_ destionationFolder : String?) {
+        
+        self.init()
+        
+        if destionationFolder == nil || destionationFolder?.isEmpty == true {
+            self.destinationFolder = "/" //NSLocalizedString("_root_", comment: "")
+        } else {
+            self.destinationFolder = destionationFolder
+        }
+    
+        self.initializeForm()
+    }
+    
+    override func viewDidLoad() {
+
+        super.viewDidLoad()
+        
+        let cancelButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(cancel))
+        
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        
+        self.navigationItem.leftBarButtonItem = cancelButton
+        self.navigationItem.rightBarButtonItem = saveButton
+    }
+    
+    func initializeForm() {
+        
+        let form : XLFormDescriptor = XLFormDescriptor() as XLFormDescriptor
+        form.rowNavigationOptions = XLFormRowNavigationOptions.stopDisableRow
+
+        var section : XLFormSectionDescriptor
+        var row : XLFormRowDescriptor
+
+        section = XLFormSectionDescriptor.formSection(withTitle: "_destination_folder_") as XLFormSectionDescriptor
+        form.addFormSection(section)
+        
+        row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: XLFormRowDescriptorTypeButton, title: self.destinationFolder)
+        row.cellConfig.setObject(UIImage(named: image_settingsManagePhotos)!, forKey: "imageView.image" as NSCopying)
+        section.addFormRow(row)
+        
+        section = XLFormSectionDescriptor.formSection(withTitle: "A") as XLFormSectionDescriptor
+        form.addFormSection(section)
+        
+        row = XLFormRowDescriptor(tag: "FolderPhoto", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: "Save in Pfoto folder")
+        section.addFormRow(row)
+        row = XLFormRowDescriptor(tag: "der", rowType: XLFormRowDescriptorTypeBooleanSwitch, title: "Subloder")
+        section.addFormRow(row)
+
+        section = XLFormSectionDescriptor.formSection(withTitle: "B") as XLFormSectionDescriptor
+        form.addFormSection(section)
+        
+        row = XLFormRowDescriptor(tag: "TextFieldAndTextView", rowType: XLFormRowDescriptorTypeName, title: "File name")
+        section.addFormRow(row)
+        
+        self.form = form
+    }
+    
+    func save() {
+        
+    }
+
+    func cancel() {
+        
+    }
+}
+
+

+ 18 - 5
iOSClient/Favorite/CCFavorite.m

@@ -343,7 +343,7 @@
         metadataNet.selector = selectorReadFileFavorite;
         metadataNet.priority = NSOperationQueuePriorityVeryLow;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 }
 
@@ -411,13 +411,24 @@
     [self setEditing:NO animated:YES];
     
     AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.view title:nil];
-        
-    actionSheet.blurRadius = 1.0f;
+    
+    actionSheet.animationDuration = 0.2;
+    actionSheet.cancelOnTapEmptyAreaEnabled = @(YES);
+    actionSheet.automaticallyTintButtonImages = @(NO);
+    
+    actionSheet.blurRadius = 0.0f;
+    actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.50f];
+    
     actionSheet.buttonHeight = 50.0;
     actionSheet.cancelButtonHeight = 50.0f;
+    actionSheet.separatorHeight = 30.0f;
+    
     actionSheet.selectedBackgroundColor = COLOR_SELECT_BACKGROUND;
-    actionSheet.cryptoButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_BRAND };
-    actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_GRAY };
+
+    actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
+    actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
+    actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:COLOR_BRAND };
+
     actionSheet.separatorColor = COLOR_SEPARATOR_TABLE;
     actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
 
@@ -432,6 +443,8 @@
         
     [actionSheet addButtonWithTitle:NSLocalizedString(@"_open_in_", nil)
                               image:[UIImage imageNamed:image_actionSheetOpenIn]
+                    backgroundColor:[UIColor whiteColor]
+                             height: 50.0
                                type:AHKActionSheetButtonTypeDefault
                             handler:^(AHKActionSheet *as) {
                                 [self performSelector:@selector(openWith:) withObject:self.metadata afterDelay:0.1];

+ 21 - 0
iOSClient/Images.xcassets/Plus.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "Plus@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/Plus.imageset/Plus@2x.png


BIN
iOSClient/Images.xcassets/accountweb.imageset/accountweb.png


BIN
iOSClient/Images.xcassets/accountweb.imageset/accountweb@2x.png


BIN
iOSClient/Images.xcassets/accountweb.imageset/accountweb@3x.png


BIN
iOSClient/Images.xcassets/bancomat.imageset/bancomat.png


BIN
iOSClient/Images.xcassets/bancomat.imageset/bancomat@2x.png


BIN
iOSClient/Images.xcassets/bancomat.imageset/bancomat@3x.png


BIN
iOSClient/Images.xcassets/baseurl.imageset/baseurl.png


BIN
iOSClient/Images.xcassets/baseurl.imageset/baseurl@2x.png


BIN
iOSClient/Images.xcassets/baseurl.imageset/baseurl@3x.png


BIN
iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito.png


BIN
iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito@2x.png


BIN
iOSClient/Images.xcassets/cartadicredito.imageset/cartadicredito@3x.png


BIN
iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita.png


BIN
iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita@2x.png


BIN
iOSClient/Images.xcassets/cartaidentita.imageset/cartaidentita@3x.png


BIN
iOSClient/Images.xcassets/contocorrente.imageset/contocorrente.png


BIN
iOSClient/Images.xcassets/contocorrente.imageset/contocorrente@2x.png


BIN
iOSClient/Images.xcassets/contocorrente.imageset/contocorrente@3x.png


+ 23 - 0
iOSClient/Images.xcassets/importCloud.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "importCloud.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "importCloud@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "importCloud@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/importCloud.imageset/importCloud.png


BIN
iOSClient/Images.xcassets/importCloud.imageset/importCloud@2x.png


BIN
iOSClient/Images.xcassets/importCloud.imageset/importCloud@3x.png


+ 23 - 0
iOSClient/Images.xcassets/importCloudCrypto.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "importCloudCrypto.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "importCloudCrypto@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "importCloudCrypto@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto.png


BIN
iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto@2x.png


BIN
iOSClient/Images.xcassets/importCloudCrypto.imageset/importCloudCrypto@3x.png


BIN
iOSClient/Images.xcassets/note.imageset/note.png


BIN
iOSClient/Images.xcassets/note.imageset/note@2x.png


BIN
iOSClient/Images.xcassets/note.imageset/note@3x.png


+ 6 - 6
iOSClient/Images.xcassets/passaporto.imageset/Contents.json

@@ -2,18 +2,18 @@
   "images" : [
     {
       "idiom" : "universal",
-      "scale" : "1x",
-      "filename" : "passaporto.png"
+      "filename" : "passaporto.png",
+      "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "scale" : "2x",
-      "filename" : "passaporto@2x.png"
+      "filename" : "passaporto@2x.png",
+      "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "scale" : "3x",
-      "filename" : "passaporto@3x.png"
+      "filename" : "passaporto@3x.png",
+      "scale" : "3x"
     }
   ],
   "info" : {

BIN
iOSClient/Images.xcassets/passaporto.imageset/passaporto.png


BIN
iOSClient/Images.xcassets/passaporto.imageset/passaporto@2x.png


BIN
iOSClient/Images.xcassets/passaporto.imageset/passaporto@3x.png


BIN
iOSClient/Images.xcassets/patenteguida.imageset/patenteguida.png


BIN
iOSClient/Images.xcassets/patenteguida.imageset/patenteguida@2x.png


BIN
iOSClient/Images.xcassets/patenteguida.imageset/patenteguida@3x.png


BIN
iOSClient/Images.xcassets/photo.imageset/photo.png


BIN
iOSClient/Images.xcassets/photo.imageset/photo@2x.png


BIN
iOSClient/Images.xcassets/photo.imageset/photo@3x.png


BIN
iOSClient/Images.xcassets/photocrypto.imageset/photocrypto.png


BIN
iOSClient/Images.xcassets/photocrypto.imageset/photocrypto@2x.png


BIN
iOSClient/Images.xcassets/photocrypto.imageset/photocrypto@3x.png


+ 23 - 0
iOSClient/Images.xcassets/template.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "template@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "template@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "template@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/template.imageset/template@1x.png


BIN
iOSClient/Images.xcassets/template.imageset/template@2x.png


BIN
iOSClient/Images.xcassets/template.imageset/template@3x.png


+ 1 - 1
iOSClient/InfoPlist/InfoNextcloud.plist

@@ -46,7 +46,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.16</string>
+	<string>2.17</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>

+ 1 - 1
iOSClient/Login/CCLoginNCOC.m

@@ -170,7 +170,7 @@
     if ([[self.baseUrl.text substringFromIndex:[self.baseUrl.text length] - 1] isEqualToString:@"/"])
         self.baseUrl.text = [self.baseUrl.text substringToIndex:[self.baseUrl.text length] - 1];
     
-    OCnetworking *ocNet = [[OCnetworking alloc] initWithDelegate:self metadataNet:nil withUser:self.user.text withPassword:self.password.text withUrl:nil withTypeCloud:_typeCloud oneByOne:YES activityIndicator:NO];
+    OCnetworking *ocNet = [[OCnetworking alloc] initWithDelegate:self metadataNet:nil withUser:self.user.text withPassword:self.password.text withUrl:nil withTypeCloud:_typeCloud activityIndicator:NO];
     NSError *error = [ocNet readFileSync:[NSString stringWithFormat:@"%@%@", self.baseUrl.text, webDAV]];
     
     if (!error) {

+ 3 - 0
iOSClient/Main/CCDetail.m

@@ -95,6 +95,9 @@
         self.tabBarController.tabBar.hidden = YES;
         self.tabBarController.tabBar.translucent = YES;
     }
+    
+    if (self.splitViewController.isCollapsed)
+        [app plusButtonVisibile:false];
 }
 
 - (void)viewDidAppear:(BOOL)animated

+ 4 - 3
iOSClient/Main/CCMain.h

@@ -36,7 +36,6 @@
 #import "CCLoginNCOC.h"
 #import "CCCellMain.h"
 #import "CCCellMainTransfer.h"
-#import "CCAdd.h"
 #import "CCMove.h"
 #import "CCDetail.h"
 #import "CTAssetsPickerController.h"
@@ -65,13 +64,13 @@
 #ifdef CC
 #import "CCShareDB.h"
 
-@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate ,CCAddDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCShareDBDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCDetailViewDelegate, CCPeekPopDelegate>
+@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCShareDBDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCDetailViewDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate>
 
 @property (nonatomic, weak) CCShareDB* shareDB;
 #endif
 
 #ifdef NC
-@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate ,CCAddDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCDetailViewDelegate, CCPeekPopDelegate>
+@interface CCMain : UITableViewController <UITableViewDataSource, UITableViewDelegate, UIActionSheetDelegate, UIGestureRecognizerDelegate, UIDocumentInteractionControllerDelegate, UIViewControllerPreviewingDelegate, CCMoveDelegate, CTAssetsPickerControllerDelegate, BKPasscodeViewControllerDelegate, UISplitViewControllerDelegate, UIPopoverControllerDelegate, CCNetworkingDelegate, CCShareOCDelegate, CCAccountWebDelegate, CCBancomatDelegate, CCCartaDiCreditoDelegate, CCCartaIdentitaDelegate, CCContoCorrenteDelegate, CCNoteDelegate, CCPassaportoDelegate, CCPatenteGuidaDelegate, CCDetailViewDelegate, CCPeekPopDelegate, UIDocumentMenuDelegate, UIDocumentPickerDelegate>
 #endif
 
 @property (nonatomic ,strong) NSString *localServerUrl;
@@ -86,6 +85,8 @@
 
 @property (nonatomic, weak) CCLoginNCOC *loginVC;
 
+- (void)returnCreate:(NSInteger)type;
+
 - (void)createFolderCameraUpload;
 - (void)createFolder:(NSString *)fileNameFolder folderCameraUpload:(BOOL)folderCameraUpload;
 - (void)readFolderWithForced:(BOOL)forced;

+ 238 - 128
iOSClient/Main/CCMain.m

@@ -27,6 +27,8 @@
 #import "CCPhotosCameraUpload.h"
 #import "CCSynchronization.h"
 
+#import "Nextcloud-Swift.h"
+
 #pragma GCC diagnostic ignored "-Wundeclared-selector"
 #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
 
@@ -197,9 +199,11 @@
     // Menu e Bar
     [self createReMainMenu];
     [self createReSelectMenu];
-    [self setUITabBarDefault];
     if (_isSelectedMode) [self setUINavigationBarSeleziona];
     else [self setUINavigationBarDefault];
+    
+    // Plus Button
+    [app plusButtonVisibile:true];
 }
 
 // E' arrivato
@@ -508,52 +512,10 @@
     }
 }
 
-- (void)setUITabBarDefault
-{
-    UITabBarItem *item;
-    
-    [CCAspect aspectTabBar:self.tabBarController.tabBar hidden:NO];
-    
-    // File
-    item = [self.tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexFile];
-    [item setTitle:NSLocalizedString(@"_home_", nil)];
-    item.image = [UIImage imageNamed:image_tabBarFile];
-    item.selectedImage = [UIImage imageNamed:image_tabBarFile];
-    
-    // Favorite - Local
-    item = [self.tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexFavorite];
-    if (app.isLocalStorage) {
-        [item setTitle:NSLocalizedString(@"_local_storage_", nil)];
-        item.image = [UIImage imageNamed:image_tabBarLocal];
-        item.selectedImage = [UIImage imageNamed:image_tabBarLocal];
-    } else {
-        [item setTitle:NSLocalizedString(@"_favorites_", nil)];
-        item.image = [UIImage imageNamed:image_tabBarFavorite];
-        item.selectedImage = [UIImage imageNamed:image_tabBarFavorite];
-    }
-    
-    // Photos
-    item = [self.tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexPhotos];
-    [item setTitle:NSLocalizedString(@"_photo_camera_", nil)];
-    item.image = [UIImage imageNamed:image_tabBarPhotos];
-    item.selectedImage = [UIImage imageNamed:image_tabBarPhotos];
-
-    // Settings
-    item = [self.tabBarController.tabBar.items objectAtIndex:TabBarApplicationIndexSettings];
-    [item setTitle:NSLocalizedString(@"_settings_", nil)];
-    item.image = [UIImage imageNamed:image_tabBarSettings];
-    item.selectedImage = [UIImage imageNamed:image_tabBarSettings];
-}
-
 - (void)setUINavigationBarDefault
 {
     [CCAspect aspectNavigationControllerBar:self.navigationController.navigationBar hidden:NO];
     
-    // +
-    UIBarButtonItem *buttonAdd = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addActionTable)];
-    buttonAdd.tintColor = COLOR_BRAND;
-    buttonAdd.enabled = true;
-    
     // =
     UIImage *icon = [UIImage imageNamed:image_more];
     UIBarButtonItem *buttonMore = [[UIBarButtonItem alloc] initWithImage:icon style:UIBarButtonItemStylePlain target:self action:@selector(toggleReMainMenu)];
@@ -561,7 +523,9 @@
     
     // <
     self.navigationController.navigationBar.hidden = NO;
-    self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonAdd, buttonMore, nil];
+    //self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonAdd, buttonMore, nil];
+    self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:buttonMore, nil];
+
     self.navigationItem.leftBarButtonItem = nil;
     
     // close Menu
@@ -603,18 +567,65 @@
 }
 
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Navigation Controller =====
+#pragma mark ===== Document Picker =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)addActionTable
+- (void)documentMenuWasCancelled:(UIDocumentMenuViewController *)documentMenu
 {
-    UINavigationController *navigationController = [[UIStoryboard storyboardWithName:@"Add" bundle:nil] instantiateViewControllerWithIdentifier:@"CCAddNC"];
-    
-    CCAdd *viewController = (CCAdd *)navigationController.topViewController;
-    viewController.delegate = self;
+    NSLog(@"Cancelled");
+}
+
+- (void)documentPickerWasCancelled:(UIDocumentPickerViewController *)controller
+{
+    NSLog(@"Cancelled");
+}
+
+- (void)documentMenu:(UIDocumentMenuViewController *)documentMenu didPickDocumentPicker:(UIDocumentPickerViewController *)documentPicker
+{
+    documentPicker.delegate = self;
+    [self presentViewController:documentPicker animated:YES completion:nil];
+}
+
+- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url
+{
+    if (controller.documentPickerMode == UIDocumentPickerModeImport) {
+        
+        NSFileCoordinator *coordinator = [[NSFileCoordinator alloc] initWithFilePresenter:nil];
+        __block NSError *error;
+        
+        [coordinator coordinateReadingItemAtURL:url options:0 error:&error byAccessor:^(NSURL *newURL) {
+            
+            NSString *fileName = [url lastPathComponent];
+            NSString *fileNamePath = [NSString stringWithFormat:@"%@/%@", app.directoryUser, fileName];
+            NSData *data = [NSData dataWithContentsOfURL:newURL];
+            
+            if (data && error == nil) {
+                
+                if ([data writeToFile:fileNamePath options:NSDataWritingAtomic error:&error]) {
+                    
+                    // Upload File
+                    [[CCNetworking sharedNetworking] uploadFile:fileName serverUrl:self.localServerUrl cryptated:_isPickerCriptate onlyPlist:NO session:upload_session taskStatus:taskStatusResume selector:nil selectorPost:nil parentRev:nil errorCode:0 delegate:nil];
+                    
+                } else {
+                    
+                    [app messageNotification:@"_error_" description:error.description visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeError];
+                }
+                
+            } else {
+                
+                [app messageNotification:@"_error_" description:@"_read_file_error_" visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeError];
+            }
+        }];
+    }
+}
+
+- (void)openImportDocumentPicker
+{
+    UIDocumentMenuViewController *documentProviderMenu = [[UIDocumentMenuViewController alloc] initWithDocumentTypes:@[@"public.data"] inMode:UIDocumentPickerModeImport];
+    documentProviderMenu.modalPresentationStyle = UIModalPresentationFormSheet;
     
-    [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
-    [self presentViewController:navigationController animated:YES completion:nil];
+    documentProviderMenu.delegate = self;
+    [self presentViewController:documentProviderMenu animated:YES completion:nil];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -623,6 +634,19 @@
 
 - (void)openAssetsPickerController
 {
+    
+#ifdef DEBUG
+    
+    CreateFormUpload *form = [[CreateFormUpload alloc] init:_titleMain];
+    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:form];
+    
+    //navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
+
+    [self presentViewController:navController animated:YES completion:nil];
+
+    return;
+#endif
+    
     CTAssetSelectionLabel *assetSelectionLabel = [CTAssetSelectionLabel appearance];
     assetSelectionLabel.borderWidth = 1.0;
     assetSelectionLabel.borderColor = COLOR_BRAND;
@@ -811,21 +835,33 @@
     _numTaskUploadInProgress =  [[CCCoreData getTableMetadataWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (session CONTAINS 'upload') AND ((sessionTaskIdentifier >= 0) OR (sessionTaskIdentifierPlist >= 0))", app.activeAccount] context:nil] count];
     
     switch (type) {
-        case returnCreaCartellaChiaro: {
+            
+        /* PLAIN */
+        case returnCreateFolderPlain: {
             UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_create_folder_",nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"_cancel_",nil) otherButtonTitles:NSLocalizedString(@"_save_", nil), nil];
             [alertView setAlertViewStyle:UIAlertViewStylePlainTextInput];
             alertView.tag = alertCreateFolder;
             [alertView show];
         }
             break;
-        case returnCreaFotoVideoChiaro: {
+        case returnCreateFotoVideoPlain: {
             
             _isPickerCriptate = false;
             
             [self openAssetsPickerController];
         }
             break;
-        case returnCreaCartellaCriptata: {
+        case returnCreateFilePlain: {
+            
+            _isPickerCriptate = false;
+            
+            [self openImportDocumentPicker];
+        }
+            break;
+            
+            
+        /* ENCRYPTED */
+        case returnCreateFolderEncrypted: {
             
             UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_create_folder_",nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"_cancel_",nil) otherButtonTitles:NSLocalizedString(@"_save_", nil), nil];
             [alertView setAlertViewStyle:UIAlertViewStylePlainTextInput];
@@ -833,13 +869,30 @@
             [alertView show];
         }
             break;
-        case returnCreaFotoVideoCriptato: {
+        case returnCreateFotoVideoEncrypted: {
             
             _isPickerCriptate = true;
             
             [self openAssetsPickerController];
         }
             break;
+        case returnCreateFileEncrypted: {
+            
+            _isPickerCriptate = true;
+            
+            [self openImportDocumentPicker];
+        }
+            break;
+    
+        /* UTILITY */
+        case returnNote:
+            [self openModel:@"note" isNew:true];
+            break;
+        case returnAccountWeb:
+            [self openModel:@"accountweb" isNew:true];
+            break;
+            
+         /* BANK */
         case returnCartaDiCredito:
             [self openModel:@"cartadicredito" isNew:true];
             break;
@@ -849,12 +902,8 @@
         case returnContoCorrente:
             [self openModel:@"contocorrente" isNew:true];
             break;
-        case returnAccountWeb:
-            [self openModel:@"accountweb" isNew:true];
-            break;
-        case returnNote:
-            [self openModel:@"note" isNew:true];
-            break;
+       
+        /* DOCUMENT */
         case returnPatenteGuida:
             [self openModel:@"patenteguida" isNew:true];
             break;
@@ -1013,10 +1062,10 @@
     if ([app.typeCloud isEqualToString:typeCloudOwnCloud] || [app.typeCloud isEqualToString:typeCloudNextcloud]) {
         
         metadataNet.action = actionGetFeaturesSuppServer;
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
         metadataNet.action = actionGetCapabilities;
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 }
 
@@ -1084,7 +1133,7 @@
     /*** NEXTCLOUD OWNCLOUD ***/
     
     if ([metadata.typeCloud isEqualToString:typeCloudOwnCloud] || [metadata.typeCloud isEqualToString:typeCloudNextcloud])
-        metadataNet.fileName = [self returnFileNamePathFromFileName:metadata.fileName serverUrl:_localServerUrl];
+        metadataNet.fileName = [CCUtility returnFileNamePathFromFileName:metadata.fileName serverUrl:_localServerUrl activeUrl:app.activeUrl typeCloud:app.typeCloud];
     
     metadataNet.fileNameLocal = metadata.fileID;
     metadataNet.fileNamePrint = metadata.fileNamePrint;
@@ -1093,7 +1142,7 @@
     metadataNet.selector = selectorDownloadThumbnail;
     metadataNet.serverUrl = _localServerUrl;
     
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -1358,7 +1407,7 @@
             metadataNet.session = download_session_foreground;
             metadataNet.taskStatus = taskStatusResume;
             
-            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         }
     }
 }
@@ -1459,9 +1508,9 @@
                 metadataNet.taskStatus = taskStatusResume;
                 
                 if ([metadataNet.session containsString:@"wwan"])
-                    [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet oneByOne:YES];
+                    [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet];
                 else
-                    [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet oneByOne:YES];
+                    [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet];
             }
             
             /*** NEXTCLOUD OWNCLOUD ***/
@@ -1477,7 +1526,7 @@
                 metadataNet.selector = selectorReadFileUploadFile;
                 metadataNet.serverUrl = serverUrl;
                 
-                [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+                [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
             }
         }
     }
@@ -1502,9 +1551,9 @@
             metadataNet.taskStatus = taskStatusResume;
             
             if ([metadataNet.session containsString:@"wwan"])
-                [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet oneByOne:YES];
+                [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet];
             else
-                [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet oneByOne:YES];
+                [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet];
             
         } else {
             
@@ -1512,7 +1561,7 @@
             if (metadataNet.errorRetry < 3) {
                 
                 // Retry read file
-                [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+                [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
                 
             } else {
                 
@@ -1553,9 +1602,9 @@
         metadataNet.taskStatus = taskStatusResume;
         
         if ([metadataNet.session containsString:@"wwan"])
-            [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueueUploadWWan delegate:self metadataNet:metadataNet];
         else
-            [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueueUpload delegate:self metadataNet:metadataNet];
     }
 }
 
@@ -1571,7 +1620,7 @@
     metadataNet.selector = selectorReadFileFolder;
     metadataNet.serverUrl = [CCCoreData getServerUrlFromDirectoryID:_localDirectoryID activeAccount:app.activeAccount];
 
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 }
 
 #pragma --------------------------------------------------------------------------------------------
@@ -1747,7 +1796,7 @@
         metadataNet.selector = selectorReadFolder;
         metadataNet.serverUrl = [CCCoreData getServerUrlFromDirectoryID:_localDirectoryID activeAccount:app.activeAccount];
 
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
     } else {
         
@@ -1842,14 +1891,14 @@
         metadataNet.selector = selectorDeleteCrypto;
             
         [_queueSelector addObject:metadataNet.selector];
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
         // plist
         metadataNet.fileName = metadata.fileName;
         metadataNet.selector = selectorDeletePlist;
             
         [_queueSelector addObject:metadataNet.selector];
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
             
     } else {
             
@@ -1865,7 +1914,7 @@
         metadataNet.serverUrl = _localServerUrl;
         
         [_queueSelector addObject:metadataNet.selector];
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
         
     [_hud visibleHudTitle:[NSString stringWithFormat:NSLocalizedString(@"_delete_file_n_", nil), ofFile - numFile + 1, ofFile] mode:MBProgressHUDModeIndeterminate color:nil];
@@ -1938,7 +1987,7 @@
     NSString *fileNameTo, *newTitleTo;
     CCCrypto *crypto = [[CCCrypto alloc] init];
     
-    fileNameTo = [CCUtility clearFile:fileName];
+    fileNameTo = [CCUtility removeForbiddenCharacters:fileName];
     if (![fileNameTo length]) return;
     
     if ([metadata.fileNamePrint isEqualToString:fileNameTo]) return;
@@ -1958,7 +2007,7 @@
         metadataNet.serverUrl = _localServerUrl;
         metadataNet.serverUrlTo = _localServerUrl;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
     } else {
         
@@ -1992,7 +2041,7 @@
         
         if ([CCCoreData isFavorite:metadata.fileID activeAccount:app.activeAccount]) metadataNet.selectorPost = selectorAddFavorite;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
         // delete file in filesystem
         [CCCoreData deleteFile:metadata serverUrl:_localServerUrl directoryUser:app.directoryUser typeCloud:app.typeCloud activeAccount:app.activeAccount];
@@ -2021,7 +2070,7 @@
         
         if ([CCCoreData isFavorite:metadata.fileID activeAccount:app.activeAccount]) metadataNet.selectorPost = selectorAddFavorite;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 }
 
@@ -2128,7 +2177,7 @@
             
             [_queueSelector addObject:metadataNet.selector];
             
-            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         }
         
         // cyptated
@@ -2152,7 +2201,7 @@
             metadataNet.selector = selectorMoveCrypto;
             
             [_queueSelector addObject:metadataNet.selector];
-            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
             
             // plist
             metadataNet.fileName = metadata.fileName;
@@ -2160,7 +2209,7 @@
             metadataNet.selector = selectorMovePlist;
             
             [_queueSelector addObject:metadataNet.selector];
-            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         }
         
         [_hud visibleHudTitle:[NSString stringWithFormat:NSLocalizedString(@"_move_file_n_", nil), _numSelectedMetadatas - [_selectedMetadatas count] + 1, _numSelectedMetadatas] mode:MBProgressHUDModeIndeterminate color:nil];
@@ -2234,7 +2283,7 @@
 {
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
     
-    fileNameFolder = [CCUtility clearFile:fileNameFolder];
+    fileNameFolder = [CCUtility removeForbiddenCharacters:fileNameFolder];
     if (![fileNameFolder length]) return;
     
     if (folderCameraUpload) metadataNet.serverUrl = [CCCoreData getCameraUploadFolderPathActiveAccount:app.activeAccount activeUrl:app.activeUrl typeCloud:app.typeCloud];
@@ -2247,7 +2296,7 @@
     metadataNet.selector = selectorCreateFolder;
     metadataNet.selectorPost = selectorReadFolderForced;
     
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     if (!folderCameraUpload)
         [_hud visibleHudTitle:NSLocalizedString(@"_create_folder_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
@@ -2259,7 +2308,7 @@
     CCCrypto *crypto = [[CCCrypto alloc] init];
     NSString *fileNamePlist;
     
-    fileNameFolder = [CCUtility clearFile:fileNameFolder];
+    fileNameFolder = [CCUtility removeForbiddenCharacters:fileNameFolder];
     if (![fileNameFolder length]) return;
     
     NSString *title = [AESCrypt encrypt:fileNameFolder password:[crypto getKeyPasscode:[CCUtility getUUID]]];
@@ -2275,7 +2324,7 @@
     metadataNet.selector = selectorCreateFolder;
     metadataNet.serverUrl = _localServerUrl;
     
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     // upload plist file
     metadataNet.action = actionUploadOnlyPlist;
@@ -2286,7 +2335,7 @@
     metadataNet.session = upload_session_foreground;
     metadataNet.taskStatus = taskStatusResume;
     
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     [_hud visibleHudTitle:NSLocalizedString(@"_create_folder_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
 }
@@ -2320,7 +2369,7 @@
         metadataNet.serverUrl = _localServerUrl;
         metadataNet.serverUrlTo = _localServerUrl;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
         //-------------------------- DELETE -------------------------------------------//
         
@@ -2332,7 +2381,7 @@
         metadataNet.selector = selectorDeletePlist;
         metadataNet.selectorPost = selectorReadFolderForced;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
     } else {
                 
@@ -2356,7 +2405,7 @@
         metadataNet.serverUrl = _localServerUrl;
         metadataNet.serverUrlTo = _localServerUrl;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         
         //-------------------------- UPLOAD -------------------------------------------//
         
@@ -2368,7 +2417,7 @@
         metadataNet.session = upload_session_foreground;
         metadataNet.taskStatus = taskStatusResume;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 }
 
@@ -2754,7 +2803,7 @@
     
     metadataNet.action = actionReadShareServer;
 
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 }
 
 - (void)shareFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
@@ -2803,13 +2852,13 @@
         
         metadataNet.action = actionShare;
         metadataNet.fileID = metadata.fileID;
-        metadataNet.fileName = [self returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl];
+        metadataNet.fileName = [CCUtility returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl activeUrl:app.activeUrl typeCloud:app.typeCloud];
         metadataNet.fileNamePrint = metadata.fileNamePrint;
         metadataNet.password = password;
         metadataNet.selector = selectorShare;
         metadataNet.serverUrl = serverUrl;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 
     /*** DROPBOX ***/
@@ -2832,7 +2881,7 @@
             metadataNet.action = actionShare;
             metadataNet.selector = selectorShare;
             
-            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+            [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
         }
     }
     
@@ -2878,7 +2927,7 @@
     metadataNet.serverUrl = serverUrl;
     metadataNet.share = share;
    
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     [_hud visibleHudTitle:NSLocalizedString(@"_updating_sharing_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
 }
@@ -2900,7 +2949,7 @@
         metadataNet.share = share;
         metadataNet.sharePermission = permission;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
 
     [_hud visibleHudTitle:NSLocalizedString(@"_updating_sharing_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
@@ -2933,7 +2982,7 @@
         metadataNet.options = find;
         metadataNet.selector = selectorGetUserAndGroup;
         
-        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+        [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     }
     
     [_hud visibleIndeterminateHud];
@@ -2946,7 +2995,7 @@
     metadataNet.action = actionShareWith;
     metadataNet.fileID = metadata.fileID;
     metadataNet.directoryID = directoryID;
-    metadataNet.fileName = [self returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl];
+    metadataNet.fileName = [CCUtility returnFileNamePathFromFileName:metadata.fileName serverUrl:serverUrl activeUrl:app.activeUrl typeCloud:app.typeCloud];
     metadataNet.fileNamePrint = metadata.fileNamePrint;
     metadataNet.serverUrl = serverUrl;
     metadataNet.selector = selectorShare;
@@ -2954,7 +3003,7 @@
     metadataNet.shareeType = shareeType;
     metadataNet.sharePermission = permission;
 
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     [_hud visibleHudTitle:NSLocalizedString(@"_creating_sharing_", nil) mode:MBProgressHUDModeIndeterminate color:nil];
 }
@@ -2970,7 +3019,7 @@
     metadataNet.selector = selectorOpenWindowShare;
     metadataNet.serverUrl = serverUrl;
     
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
     
     [_hud visibleIndeterminateHud];
 }
@@ -3004,15 +3053,6 @@
     }
 }
 
-- (NSString *)returnFileNamePathFromFileName:(NSString *)metadataFileName serverUrl:(NSString *)serverUrl
-{
-    NSString *fileName = [NSString stringWithFormat:@"%@/%@", [serverUrl stringByReplacingOccurrencesOfString:[CCUtility getHomeServerUrlActiveUrl:app.activeUrl typeCloud:app.typeCloud] withString:@""], metadataFileName];
-    
-    if ([fileName hasPrefix:@"/"]) fileName = [fileName substringFromIndex:1];
-    
-    return fileName;
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Favorite =====
 #pragma --------------------------------------------------------------------------------------------
@@ -4202,12 +4242,23 @@
         
         AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.view title:nil];
         
-        actionSheet.blurRadius = 1.0f;
+        actionSheet.animationDuration = 0.2;
+        actionSheet.cancelOnTapEmptyAreaEnabled = @(YES);
+        actionSheet.automaticallyTintButtonImages = @(NO);
+
+        actionSheet.blurRadius = 0.0f;
+        actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.50f];
+        
         actionSheet.buttonHeight = 50.0;
         actionSheet.cancelButtonHeight = 50.0f;
+        actionSheet.separatorHeight = 30.0f;
+        
         actionSheet.selectedBackgroundColor = COLOR_SELECT_BACKGROUND;
-        actionSheet.cryptoButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
-        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_GRAY };
+        
+        actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
+        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
+        actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:COLOR_BRAND };
+
         actionSheet.separatorColor = COLOR_SEPARATOR_TABLE;
         actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
 
@@ -4224,6 +4275,8 @@
             
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
                                       image:[UIImage imageNamed:image_actionSheetRename]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                    
@@ -4244,6 +4297,8 @@
             
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_move_", nil)
                                       image:[UIImage imageNamed:image_actionSheetMove]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                         
@@ -4258,7 +4313,9 @@
             
             [actionSheet addButtonWithTitle:titoloCriptaDecripta
                                       image:[UIImage imageNamed:image_actionSheetCrypto]
-                                       type:AHKActionSheetButtonTypeCrypto
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
+                                       type:AHKActionSheetButtonTypeEncrypted
                                     handler:^(AHKActionSheet *as) {
                                         
                                         // close swipe
@@ -4272,7 +4329,9 @@
             
             [actionSheet addButtonWithTitle:titoloLock
                                       image:[UIImage imageNamed:image_actionSheetLock]
-                                       type:AHKActionSheetButtonTypeCrypto
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
+                                       type:AHKActionSheetButtonTypeEncrypted
                                     handler:^(AHKActionSheet *as) {
                                         
                                         // close swipe
@@ -4286,6 +4345,8 @@
             
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_share_", nil)
                                       image:[UIImage imageNamed:image_actionSheetShare]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                         
@@ -4301,6 +4362,8 @@
         
             [actionSheet addButtonWithTitle:titoloSynchronized
                                       image:[UIImage imageNamed:image_actionSheetSynchronized]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                         
@@ -4332,12 +4395,23 @@
         
         AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.view title:nil];
         
-        actionSheet.blurRadius = 1.0f;
+        actionSheet.animationDuration = 0.2;
+        actionSheet.cancelOnTapEmptyAreaEnabled = @(YES);
+        actionSheet.automaticallyTintButtonImages = @(NO);
+        
+        actionSheet.blurRadius = 0.0f;
+        actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.50f];
+        
         actionSheet.buttonHeight = 50.0;
         actionSheet.cancelButtonHeight = 50.0f;
+        actionSheet.separatorHeight = 30.0f;
+        
         actionSheet.selectedBackgroundColor = COLOR_SELECT_BACKGROUND;
-        actionSheet.cryptoButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
-        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_GRAY };
+        
+        actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
+        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
+        actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:COLOR_BRAND };
+        
         actionSheet.separatorColor = COLOR_SEPARATOR_TABLE;
         actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
         
@@ -4352,6 +4426,8 @@
 
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
                                   image:[UIImage imageNamed:image_actionSheetRename]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4369,6 +4445,8 @@
         
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_move_", nil)
                                   image:[UIImage imageNamed:image_actionSheetMove]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4380,6 +4458,8 @@
         
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_reload_", nil)
                                   image:[UIImage imageNamed:image_actionSheetReload]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4391,6 +4471,8 @@
         
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_open_in_", nil)
                                   image:[UIImage imageNamed:image_actionSheetOpenIn]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4404,6 +4486,8 @@
             
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_share_", nil)
                                       image:[UIImage imageNamed:image_actionSheetShare]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                         
@@ -4416,7 +4500,9 @@
 
         [actionSheet addButtonWithTitle:titoloCriptaDecripta
                                   image:[UIImage imageNamed:image_actionSheetCrypto]
-                                   type:AHKActionSheetButtonTypeCrypto
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
+                                   type:AHKActionSheetButtonTypeEncrypted
                                 handler:^(AHKActionSheet *as) {
                                     
                                     // close swipe
@@ -4427,6 +4513,8 @@
         
         [actionSheet addButtonWithTitle:titoloPreferiti
                                   image:[UIImage imageNamed:image_actionSheetFavorite]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4442,6 +4530,8 @@
 
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_add_local_", nil)
                                   image:[UIImage imageNamed:image_actionSheetLocal]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4462,12 +4552,23 @@
      
         AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.view title:nil];
      
-        actionSheet.blurRadius = 1.0f;
+        actionSheet.animationDuration = 0.2;
+        actionSheet.cancelOnTapEmptyAreaEnabled = @(YES);
+        actionSheet.automaticallyTintButtonImages = @(NO);
+        
+        actionSheet.blurRadius = 0.0f;
+        actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.50f];
+        
         actionSheet.buttonHeight = 50.0;
         actionSheet.cancelButtonHeight = 50.0f;
+        actionSheet.separatorHeight = 30.0f;
+        
         actionSheet.selectedBackgroundColor = COLOR_SELECT_BACKGROUND;
-        actionSheet.cryptoButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
-        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:COLOR_GRAY };
+        
+        actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
+        actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
+        actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:COLOR_BRAND };
+        
         actionSheet.separatorColor = COLOR_SEPARATOR_TABLE;
         actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
 
@@ -4480,6 +4581,8 @@
         
             [actionSheet addButtonWithTitle:NSLocalizedString(@"_rename_", nil)
                                       image:[UIImage imageNamed:image_actionSheetRename]
+                            backgroundColor:[UIColor whiteColor]
+                                     height: 50.0
                                        type:AHKActionSheetButtonTypeDefault
                                     handler:^(AHKActionSheet *as) {
                                     
@@ -4498,6 +4601,8 @@
         
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_move_", nil)
                                   image:[UIImage imageNamed:image_actionSheetMove]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4509,6 +4614,8 @@
 
         [actionSheet addButtonWithTitle:titoloPreferiti
                                   image:[UIImage imageNamed:image_actionSheetFavorite]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -4523,6 +4630,8 @@
 
         [actionSheet addButtonWithTitle:NSLocalizedString(@"_add_local_", nil)
                                   image:[UIImage imageNamed:image_actionSheetLocal]
+                        backgroundColor:[UIColor whiteColor]
+                                 height: 50.0
                                    type:AHKActionSheetButtonTypeDefault
                                 handler:^(AHKActionSheet *as) {
                                     
@@ -5360,7 +5469,8 @@
     UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
     
     // se non può essere selezionata deseleziona
-    if ([cell isEditing] == NO) [tableView deselectRowAtIndexPath:indexPath animated:YES];
+    if ([cell isEditing] == NO)
+        [tableView deselectRowAtIndexPath:indexPath animated:YES];
     
     // se siamo in modalità editing impostiamo il titolo dei selezioati e usciamo subito
     if (self.tableView.editing) {

+ 1 - 0
iOSClient/Main/CCSplit.m

@@ -70,6 +70,7 @@
     }
 }
 
+
 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
 {
     [coordinator animateAlongsideTransition:nil completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {

+ 83 - 43
iOSClient/Main/Main.storyboard

@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="16A322" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="4IE-mo-rkp">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -19,7 +22,7 @@
                 </splitViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="6BR-HM-b4e" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="5198" y="-709"/>
+            <point key="canvasLocation" x="5146" y="-710"/>
         </scene>
         <!--Settings-->
         <scene sceneID="8L1-Aq-u4E">
@@ -34,6 +37,7 @@
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="10" sectionFooterHeight="10" translatesAutoresizingMaskIntoConstraints="NO" id="RbN-9l-HP2">
+                                <rect key="frame" x="0.0" y="-66" width="384" height="620"/>
                                 <color key="backgroundColor" red="0.93725490196078431" green="0.93725490196078431" blue="0.95686274509803926" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             </tableView>
                         </subviews>
@@ -59,14 +63,14 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="wVn-RD-GD2" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="8063.1999999999998" y="1210.344827586207"/>
+            <point key="canvasLocation" x="8499" y="1210"/>
         </scene>
         <!--Photos Camera Upload-->
         <scene sceneID="kWr-RF-gdq">
             <objects>
                 <collectionViewController extendedLayoutIncludesOpaqueBars="YES" id="1Ca-6H-d29" customClass="CCPhotosCameraUpload" sceneMemberID="viewController">
-                    <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="zkC-IW-U7O">
-                        <rect key="frame" x="0.0" y="0.0" width="384" height="512"/>
+                    <collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" misplaced="YES" dataMode="prototypes" id="zkC-IW-U7O">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="3" minimumInteritemSpacing="1" id="Ode-Gf-Nqo">
@@ -83,16 +87,20 @@
                                     <rect key="frame" x="0.0" y="0.0" width="75" height="75"/>
                                     <autoresizingMask key="autoresizingMask"/>
                                     <subviews>
-                                        <imageView userInteractionEnabled="NO" tag="100" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wv7-Pl-1S9"/>
+                                        <imageView userInteractionEnabled="NO" tag="100" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wv7-Pl-1S9">
+                                            <rect key="frame" x="0.0" y="0.0" width="75" height="75"/>
+                                        </imageView>
                                         <visualEffectView hidden="YES" opaque="NO" tag="200" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vaz-kb-VZC">
+                                            <rect key="frame" x="0.0" y="0.0" width="75" height="75"/>
                                             <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="zTo-QZ-xyF">
-                                                <frame key="frameInset"/>
+                                                <rect key="frame" x="0.0" y="0.0" width="75" height="75"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                             </view>
                                             <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                             <blurEffect style="extraLight"/>
                                         </visualEffectView>
                                         <imageView hidden="YES" opaque="NO" userInteractionEnabled="NO" tag="300" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="sj1-BH-NWl">
+                                            <rect key="frame" x="25" y="25" width="25" height="25"/>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="25" id="8D0-Br-VLn"/>
                                                 <constraint firstAttribute="width" constant="25" id="JTW-Py-sqE"/>
@@ -115,10 +123,11 @@
                             </collectionViewCell>
                         </cells>
                         <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="header" id="0S8-Db-U0e">
-                            <rect key="frame" x="0.0" y="0.0" width="384" height="20"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="20"/>
                             <autoresizingMask key="autoresizingMask"/>
                             <subviews>
                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="100" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Header" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="55Q-Lx-UkW">
+                                    <rect key="frame" x="6" y="3" width="352" height="14.5"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <nil key="highlightedColor"/>
@@ -131,10 +140,11 @@
                             </constraints>
                         </collectionReusableView>
                         <collectionReusableView key="sectionFooterView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="footer" id="jDW-vn-a9W">
-                            <rect key="frame" x="0.0" y="103" width="384" height="20"/>
+                            <rect key="frame" x="0.0" y="103" width="375" height="20"/>
                             <autoresizingMask key="autoresizingMask"/>
                             <subviews>
                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="100" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Header" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HVV-2C-7PP">
+                                    <rect key="frame" x="8" y="2.5" width="359" height="15"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     <nil key="highlightedColor"/>
@@ -153,22 +163,20 @@
                         </connections>
                     </collectionView>
                     <navigationItem key="navigationItem" id="Ljh-k8-LVi"/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="512"/>
                     <connections>
                         <segue destination="mtc-lf-PRo" kind="showDetail" identifier="segueDetail" id="op6-ow-K8v"/>
                     </connections>
                 </collectionViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="W1h-qt-Bld" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="7360.8000000000002" y="1210.344827586207"/>
+            <point key="canvasLocation" x="7781" y="1209"/>
         </scene>
         <!--Favorite-->
         <scene sceneID="JPc-HC-iQ7">
             <objects>
                 <tableViewController storyboardIdentifier="CCFavoriteVC" extendedLayoutIncludesOpaqueBars="YES" id="Per-s0-P6C" customClass="CCFavorite" sceneMemberID="viewController">
                     <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="ehH-Wz-w3L">
-                        <rect key="frame" x="0.0" y="64" width="384" height="603"/>
+                        <rect key="frame" x="0.0" y="64" width="375" height="603"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <sections/>
@@ -185,7 +193,7 @@
                 </tableViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="k1c-kg-b3Q" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="6604" y="1211"/>
+            <point key="canvasLocation" x="6346" y="1210"/>
         </scene>
         <!--Acknowledgements-->
         <scene sceneID="h9y-Lj-jxB">
@@ -196,10 +204,11 @@
                         <viewControllerLayoutGuide type="bottom" id="RWM-KX-MWW"/>
                     </layoutGuides>
                     <view key="view" opaque="NO" contentMode="scaleToFill" id="HYE-hK-m2I">
-                        <rect key="frame" x="0.0" y="64" width="384" height="603"/>
+                        <rect key="frame" x="0.0" y="64" width="375" height="603"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                         <subviews>
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" delaysContentTouches="NO" canCancelContentTouches="NO" bouncesZoom="NO" editable="NO" usesAttributedText="YES" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="vYq-of-LmL">
+                                <rect key="frame" x="3" y="0.0" width="369" height="603"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <attributedString key="attributedText">
                                     <fragment content="Copyright (C)">
@@ -240,9 +249,7 @@
                 <navigationController automaticallyAdjustsScrollViewInsets="NO" id="eZl-ut-xpC" sceneMemberID="viewController">
                     <extendedEdge key="edgesForExtendedLayout"/>
                     <toolbarItems/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="rJe-3o-bpZ">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="rJe-3o-bpZ">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -351,13 +358,14 @@
                     <connections>
                         <segue destination="bSZ-tE-FEj" kind="relationship" relationship="viewControllers" id="qbu-nX-qCk"/>
                         <segue destination="hwM-4d-Afb" kind="relationship" relationship="viewControllers" id="tds-0Q-7Zf"/>
+                        <segue destination="Cc7-4O-z6Q" kind="relationship" relationship="viewControllers" id="YKg-LH-tor"/>
                         <segue destination="Npr-vu-PSD" kind="relationship" relationship="viewControllers" id="XeU-GF-etm"/>
                         <segue destination="ftT-7F-lfU" kind="relationship" relationship="viewControllers" id="z8K-RX-gJH"/>
                     </connections>
                 </tabBarController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="d2B-Yg-rp2" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="6964" y="-709"/>
+            <point key="canvasLocation" x="7073" y="-709"/>
         </scene>
         <!--Detail-->
         <scene sceneID="zJM-E9-jgK">
@@ -368,10 +376,12 @@
                         <viewControllerLayoutGuide type="bottom" id="6Tt-yQ-gC5"/>
                     </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="cUA-lB-tGG">
-                        <rect key="frame" x="0.0" y="0.0" width="384" height="667"/>
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" image="cryptocloud_sfondo_iPad" translatesAutoresizingMaskIntoConstraints="NO" id="zlU-MP-ZVs"/>
+                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" preservesSuperviewLayoutMargins="YES" image="cryptocloud_sfondo_iPad" translatesAutoresizingMaskIntoConstraints="NO" id="zlU-MP-ZVs">
+                                <rect key="frame" x="59.5" y="240" width="256" height="187"/>
+                            </imageView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
@@ -393,7 +403,7 @@
             <objects>
                 <tableViewController storyboardIdentifier="CCMainVC" extendedLayoutIncludesOpaqueBars="YES" id="YJg-Xa-VYf" customClass="CCMain" sceneMemberID="viewController">
                     <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" allowsSelectionDuringEditing="YES" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="7sT-6b-Pnh">
-                        <rect key="frame" x="0.0" y="64" width="384" height="603"/>
+                        <rect key="frame" x="0.0" y="64" width="375" height="603"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <sections/>
@@ -410,16 +420,14 @@
                 </tableViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="q78-1k-pga" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="5864" y="1219"/>
+            <point key="canvasLocation" x="5653" y="1210"/>
         </scene>
         <!--Navigation Controller-->
         <scene sceneID="Xur-XN-mjy">
             <objects>
                 <navigationController storyboardIdentifier="CCDetailNC" extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="mtc-lf-PRo" sceneMemberID="viewController">
                     <toolbarItems/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="vxw-dW-rgx">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="vxw-dW-rgx">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -438,9 +446,7 @@
                 <navigationController storyboardIdentifier="CCMainNC" extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="bSZ-tE-FEj" customClass="CCControlCenter" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="File" image="tabBarCryptoCloud" id="Zxv-aS-HGF"/>
                     <toolbarItems/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="cj6-rT-wnB">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="cj6-rT-wnB">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -451,7 +457,7 @@
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="k95-tV-JJx" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="5864" y="327"/>
+            <point key="canvasLocation" x="5653" y="327"/>
         </scene>
         <!--Favorite-->
         <scene sceneID="YSr-JF-a0V">
@@ -459,9 +465,7 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="hwM-4d-Afb" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Favorite" image="tabBarFavorite" id="o09-67-hwf"/>
                     <toolbarItems/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="MJw-Bn-5le">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="MJw-Bn-5le">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -472,7 +476,26 @@
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="NME-vT-pfd" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="6604" y="327"/>
+            <point key="canvasLocation" x="6346" y="327"/>
+        </scene>
+        <!--View Controller-->
+        <scene sceneID="60G-IQ-Axc">
+            <objects>
+                <viewController id="5u0-hQ-Qcc" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="ydP-J5-ga0"/>
+                        <viewControllerLayoutGuide type="bottom" id="VEh-cM-lkh"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="vDQ-hO-q2d">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                    </view>
+                    <navigationItem key="navigationItem" id="DJa-X9-gd4"/>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="rff-dP-xgt" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="7073" y="1209"/>
         </scene>
         <!--Photos-->
         <scene sceneID="IuY-Iu-oAm">
@@ -480,9 +503,7 @@
                 <navigationController extendedLayoutIncludesOpaqueBars="YES" automaticallyAdjustsScrollViewInsets="NO" id="Npr-vu-PSD" sceneMemberID="viewController">
                     <tabBarItem key="tabBarItem" title="Photos" image="tabBarPhotos" id="5cw-bP-7It"/>
                     <toolbarItems/>
-                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
-                    <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="ixg-Pw-TNO">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="ixg-Pw-TNO">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -493,7 +514,7 @@
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="cZf-pk-3Bd" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="7361" y="327"/>
+            <point key="canvasLocation" x="7788" y="327"/>
         </scene>
         <!--Settings-->
         <scene sceneID="nEn-y9-HDF">
@@ -503,7 +524,7 @@
                     <toolbarItems/>
                     <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
                     <size key="freeformSize" width="384" height="667"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="Gr7-lE-Txr">
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" misplaced="YES" id="Gr7-lE-Txr">
                         <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                         <autoresizingMask key="autoresizingMask"/>
                     </navigationBar>
@@ -514,7 +535,7 @@
                 </navigationController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="5WQ-nE-llq" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="8064" y="327"/>
+            <point key="canvasLocation" x="8498" y="327"/>
         </scene>
         <!--Manage Synchronizations-->
         <scene sceneID="rlM-Pz-rta">
@@ -554,7 +575,26 @@
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="oeH-9e-IVz" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="8424" y="3020"/>
+            <point key="canvasLocation" x="8418" y="3019"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="cip-AF-Ks2">
+            <objects>
+                <navigationController automaticallyAdjustsScrollViewInsets="NO" id="Cc7-4O-z6Q" sceneMemberID="viewController">
+                    <tabBarItem key="tabBarItem" enabled="NO" title="" id="vIy-cM-ojV"/>
+                    <toolbarItems/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="jCU-so-Np6">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <nil name="viewControllers"/>
+                    <connections>
+                        <segue destination="5u0-hQ-Qcc" kind="relationship" relationship="rootViewController" id="XaQ-dk-iGO"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="ohd-Sv-ssv" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="7072.8000000000002" y="326.98650674662673"/>
         </scene>
     </scenes>
     <resources>
@@ -565,6 +605,6 @@
         <image name="tabBarSettings" width="25" height="25"/>
     </resources>
     <inferredMetricsTieBreakers>
-        <segue reference="op6-ow-K8v"/>
+        <segue reference="YTW-Kz-l02"/>
     </inferredMetricsTieBreakers>
 </document>

+ 4 - 4
iOSClient/Move/CCMove.m

@@ -23,7 +23,7 @@
 
 #import "CCMove.h"
 
-#ifndef SHARE_IN
+#ifndef EXTENSION
 #import "AppDelegate.h"
 #endif
 
@@ -119,7 +119,7 @@
     if (buttonIndex == 1) {
         NSString *nome = [alertView textFieldAtIndex:0].text;
         if ([nome length]) {
-            nome = [NSString stringWithFormat:@"%@/%@", self.localServerUrl, [CCUtility clearFile:nome]];
+            nome = [NSString stringWithFormat:@"%@/%@", self.localServerUrl, [CCUtility removeForbiddenCharacters:nome]];
         }
     }
 }
@@ -240,7 +240,7 @@
     
     if ([typeCloud isEqualToString:typeCloudOwnCloud] || [typeCloud isEqualToString:typeCloudNextcloud]) {
         
-        OCnetworking *operation = [[OCnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:activeUser withPassword:activePassword withUrl:activeUrl withTypeCloud:typeCloud oneByOne:YES activityIndicator:NO];
+        OCnetworking *operation = [[OCnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:activeUser withPassword:activePassword withUrl:activeUrl withTypeCloud:typeCloud activityIndicator:NO];
         
         _networkingOperationQueue.maxConcurrentOperationCount = maxConcurrentOperation;
         [_networkingOperationQueue addOperation:operation];
@@ -252,7 +252,7 @@
 
     if ([typeCloud isEqualToString:typeCloudDropbox]) {
         
-        DBnetworking *operation = [[DBnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:activeUser withPassword:activePassword withUrl:activeUrl withActiveUID:activeUID withActiveAccessToken:activeAccessToken oneByOne:YES activityIndicator:NO];
+        DBnetworking *operation = [[DBnetworking alloc] initWithDelegate:self metadataNet:metadataNet withUser:activeUser withPassword:activePassword withUrl:activeUrl withActiveUID:activeUID withActiveAccessToken:activeAccessToken activityIndicator:NO];
         
         _networkingOperationQueue.maxConcurrentOperationCount = maxConcurrentOperation;
         [_networkingOperationQueue addOperation:operation];

+ 21 - 16
iOSClient/Networking/CCNetworking.m

@@ -341,7 +341,7 @@
         });
     }
 
-#ifndef SHARE_IN
+#ifndef EXTENSION
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
         [app updateApplicationIconBadgeNumber];
     });
@@ -434,7 +434,7 @@
             NSDictionary *fields = [httpResponse allHeaderFields];
             
             if (errorCode == 0) {
-                rev = [CCUtility clearFile:[fields objectForKey:@"OC-ETag"]];
+                rev = [CCUtility removeForbiddenCharacters:[fields objectForKey:@"OC-ETag"]];
                 date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
             }
         }
@@ -478,8 +478,8 @@
             NSDictionary *fields = [httpResponse allHeaderFields];
             
             if (errorCode == 0) {
-                fileID = [CCUtility clearFile:[fields objectForKey:@"OC-FileId"]];
-                rev = [CCUtility clearFile:[fields objectForKey:@"OC-ETag"]];
+                fileID = [CCUtility removeForbiddenCharacters:[fields objectForKey:@"OC-FileId"]];
+                rev = [CCUtility removeForbiddenCharacters:[fields objectForKey:@"OC-ETag"]];
                 date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
             }
         }
@@ -677,7 +677,7 @@
         
         if (_currentProgressMetadata) {
  
-#ifndef SHARE_IN
+#ifndef EXTENSION
             // Control Center
             [app.controlCenter progressTask:_currentProgressMetadata.fileID serverUrl:serverUrl cryptated:_currentProgressMetadata.cryptated progress:progress];
         
@@ -723,7 +723,7 @@
 
 - (void)downloadFileSuccessFailure:(NSString *)fileName fileID:(NSString *)fileID rev:(NSString *)rev date:(NSDate *)date serverUrl:(NSString *)serverUrl selector:(NSString *)selector selectorPost:(NSString *)selectorPost errorCode:(NSInteger)errorCode
 {
-#ifndef SHARE_IN
+#ifndef EXTENSION
     if (fileID)
         [app.listProgressMetadata removeObjectForKey:fileID];
 #endif
@@ -1065,9 +1065,10 @@
                     CCMetadata *metadataDelete = [CCCoreData getMetadataWithPreficate:[NSPredicate predicateWithFormat:@"(account == %@) AND (fileName == %@) AND (directoryID == %@)", _activeAccount, [fileNameCrypto stringByAppendingString:@".plist"], directoryID] context:nil];
                     [CCCoreData deleteFile:metadataDelete serverUrl:serverUrl directoryUser:_directoryUser typeCloud:_typeCloud activeAccount:_activeAccount];
                     
-                    
+#ifndef EXTENSION
                     [CCGraphics createNewImageFrom:fileName directoryUser:_directoryUser fileNameTo:uploadID fileNamePrint:fileName size:@"m" imageForUpload:YES typeFile:metadata.typeFile writePreview:YES optimizedFileName:NO];
-                    
+#endif
+
                     if ([metadata.typeFile isEqualToString:metadataTypeFile_image] || [metadata.typeFile isEqualToString:metadataTypeFile_video])
                         [crypto addPlistImage:[NSString stringWithFormat:@"%@/%@", _directoryUser, [fileNameCrypto stringByAppendingString:@".plist"]] fileNamePathImage:[NSTemporaryDirectory() stringByAppendingString:uploadID]];
                     
@@ -1093,7 +1094,9 @@
                 
             } else {
                 
+#ifndef EXTENSION
                 [CCGraphics createNewImageFrom:fileName directoryUser:_directoryUser fileNameTo:uploadID fileNamePrint:fileName size:@"m" imageForUpload:YES typeFile:metadata.typeFile writePreview:YES optimizedFileName:NO];
+#endif
                 
                 if ([metadata.typeFile isEqualToString:metadataTypeFile_image] || [metadata.typeFile isEqualToString:metadataTypeFile_video])
                     [crypto addPlistImage:[NSString stringWithFormat:@"%@/%@", _directoryUser, [fileNameCrypto stringByAppendingString:@".plist"]] fileNamePathImage:[NSTemporaryDirectory() stringByAppendingString:uploadID]];
@@ -1175,8 +1178,10 @@
         } else {
             
             // -- Go to upload --
-            [CCGraphics createNewImageFrom:metadata.fileNamePrint directoryUser:_directoryUser fileNameTo:metadata.fileID fileNamePrint:metadata.fileNamePrint size:@"m" imageForUpload:YES typeFile:metadata.typeFile writePreview:YES optimizedFileName:NO];
             
+#ifndef EXTENSION
+            [CCGraphics createNewImageFrom:metadata.fileNamePrint directoryUser:_directoryUser fileNameTo:metadata.fileID fileNamePrint:metadata.fileNamePrint size:@"m" imageForUpload:YES typeFile:metadata.typeFile writePreview:YES optimizedFileName:NO];
+#endif
             [CCCoreData addMetadata:metadata activeAccount:_activeAccount activeUrl:_activeUrl typeCloud:_typeCloud context:_context];
             
             [self uploadURLSession:fileName fileNamePrint:fileName serverUrl:serverUrl directoryID:metadata.directoryID sessionID:uploadID session:metadata.session taskStatus:taskStatus assetDate:assetDate assetMediaType:assetMediaType cryptated:cryptated onlyPlist:onlyPlist parentRev:parentRev selector:selector];
@@ -1224,7 +1229,7 @@
         
         NSLog(@"[LOG] Error reUploadBackground, file not found.");
         
-#ifndef SHARE_IN
+#ifndef EXTENSION
         UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"_error_", nil) message:NSLocalizedString(@"_no_reuploadfile_", nil) delegate:nil cancelButtonTitle:nil otherButtonTitles:NSLocalizedString(@"_ok_", nil), nil];
         [alertView show];
 #endif
@@ -1392,7 +1397,7 @@
         
         if (_currentProgressMetadata) {
             
-#ifndef SHARE_IN
+#ifndef EXTENSION
             // Control Center
             [app.controlCenter progressTask:_currentProgressMetadata.fileID serverUrl:serverUrl cryptated:_currentProgressMetadata.cryptated progress:progress];
 #endif
@@ -1410,7 +1415,7 @@
     // ERRORE
     if (errorCode != 0) {
         
-#ifndef SHARE_IN
+#ifndef EXTENSION
         if (sessionID)
             [app.listProgressMetadata removeObjectForKey:sessionID];
 #endif
@@ -1464,7 +1469,7 @@
     // ALL TASK DONE (PLAIN/CRYPTO)
     if (metadata.sessionTaskIdentifier == taskIdentifierDone && metadata.sessionTaskIdentifierPlist == taskIdentifierDone) {
         
-#ifndef SHARE_IN
+#ifndef EXTENSION
         if (sessionID)
             [app.listProgressMetadata removeObjectForKey:sessionID];
 #endif
@@ -1720,7 +1725,7 @@
 
 - (void)readFileVerifyUpload:(NSString *)fileName fileNamePrint:(NSString *)fileNamePrint serverUrl:(NSString *)serverUrl
 {
-#ifndef SHARE_IN
+#ifndef EXTENSION
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:_activeAccount];
     
     metadataNet.action = actionReadFile;
@@ -1729,7 +1734,7 @@
     metadataNet.serverUrl = serverUrl;
     metadataNet.selector = selectorReadFileVerifyUpload;
 
-    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet oneByOne:YES];
+    [app addNetworkingOperationQueue:app.netQueue delegate:self metadataNet:metadataNet];
 #else
     NSLog(@"[LOG] Function not available for extension.");
 #endif
@@ -1856,7 +1861,7 @@
     
     if (version == 1) {
         
-#ifdef SHARE_IN
+#ifdef EXTENSION
         MPOAuthCredentialConcreteStore *mpoAuth = [[[CCSharedDBSession sharedDBSession] dBSession] credentialStoreForUserId:_activeUID];
 #else
         MPOAuthCredentialConcreteStore *mpoAuth = [[DBSession sharedSession] credentialStoreForUserId:_activeUID];

+ 1 - 1
iOSClient/Networking/OCNetworking.h

@@ -38,7 +38,7 @@
 
 @interface OCnetworking : NSOperation <CCNetworkingDelegate>
 
-- (id)initWithDelegate:(id <OCNetworkingDelegate>)delegate metadataNet:(CCMetadataNet *)metadataNet withUser:(NSString *)withUser withPassword:(NSString *)withPassword withUrl:(NSString *)withUrl withTypeCloud:(NSString *)withTypeCloud oneByOne:(BOOL)oneByOne activityIndicator:(BOOL)activityIndicator;
+- (id)initWithDelegate:(id <OCNetworkingDelegate>)delegate metadataNet:(CCMetadataNet *)metadataNet withUser:(NSString *)withUser withPassword:(NSString *)withPassword withUrl:(NSString *)withUrl withTypeCloud:(NSString *)withTypeCloud activityIndicator:(BOOL)activityIndicator;
 
 @property (nonatomic, weak) id <OCNetworkingDelegate> delegate;
 

+ 13 - 26
iOSClient/Networking/OCNetworking.m

@@ -44,14 +44,13 @@
     NSURLSessionDownloadTask *_downloadTask;
     NSURLSessionUploadTask *_uploadTask;
     
-    BOOL _oneByOne;
     BOOL _activityIndicator;
 }
 @end
 
 @implementation OCnetworking
 
-- (id)initWithDelegate:(id <OCNetworkingDelegate>)delegate metadataNet:(CCMetadataNet *)metadataNet withUser:(NSString *)withUser withPassword:(NSString *)withPassword withUrl:(NSString *)withUrl withTypeCloud:(NSString *)withTypeCloud oneByOne:(BOOL)oneByOne activityIndicator:(BOOL)activityIndicator
+- (id)initWithDelegate:(id <OCNetworkingDelegate>)delegate metadataNet:(CCMetadataNet *)metadataNet withUser:(NSString *)withUser withPassword:(NSString *)withPassword withUrl:(NSString *)withUrl withTypeCloud:(NSString *)withTypeCloud activityIndicator:(BOOL)activityIndicator
 {
     self = [super init];
     
@@ -67,7 +66,6 @@
         _activeUrl = withUrl;
         _typeCloud = withTypeCloud;
         
-        _oneByOne = oneByOne;
         _activityIndicator = activityIndicator;
     }
     
@@ -125,7 +123,7 @@
 
 - (void)poolNetworking
 {
-#ifndef SHARE_IN
+#ifndef EXTENSION
     // Animation network
     if (_activityIndicator) {
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -145,7 +143,7 @@
 
 - (void)complete
 {
-#ifndef SHARE_IN
+#ifndef EXTENSION
     // Animation network
     if (_activityIndicator) {
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
@@ -165,9 +163,6 @@
 - (void)downloadFile
 {
     [[CCNetworking sharedNetworking] downloadFile:_metadataNet.metadata serverUrl:_metadataNet.serverUrl downloadData:_metadataNet.downloadData downloadPlist:_metadataNet.downloadPlist selector:_metadataNet.selector selectorPost:_metadataNet.selectorPost session:_metadataNet.session taskStatus:_metadataNet.taskStatus delegate:self];
-    
-    if (!_oneByOne)
-        [self complete];
 }
 
 - (void)downloadTaskSave:(NSURLSessionDownloadTask *)downloadTask
@@ -201,33 +196,21 @@
 - (void)uploadFile
 {
     [[CCNetworking sharedNetworking] uploadFile:_metadataNet.fileName serverUrl:_metadataNet.serverUrl cryptated:_metadataNet.cryptated onlyPlist:NO session:_metadataNet.session taskStatus:_metadataNet.taskStatus selector:_metadataNet.selector selectorPost:_metadataNet.selectorPost parentRev:nil errorCode:_metadataNet.errorCode delegate:self];
-    
-    if (!_oneByOne)
-        [self complete];
 }
 
 - (void)uploadOnlyPlist
 {
     [[CCNetworking sharedNetworking] uploadFile:_metadataNet.fileName serverUrl:_metadataNet.serverUrl cryptated:YES onlyPlist:YES session:_metadataNet.session taskStatus:_metadataNet.taskStatus selector:_metadataNet.selector selectorPost:_metadataNet.selectorPost parentRev:nil errorCode:_metadataNet.errorCode delegate:self];
-    
-    if (!_oneByOne)
-        [self complete];
 }
 
 - (void)uploadAsset
 {
     [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:_metadataNet.assetLocalItentifier serverUrl:_metadataNet.serverUrl cryptated:_metadataNet.cryptated session:_metadataNet.session taskStatus:_metadataNet.taskStatus selector:_metadataNet.selector selectorPost:_metadataNet.selectorPost parentRev:nil errorCode:_metadataNet.errorCode delegate:self];
-    
-    if (!_oneByOne)
-        [self complete];
 }
 
 - (void)uploadTemplate
 {
     [[CCNetworking sharedNetworking] uploadTemplate:_metadataNet.fileNamePrint fileNameCrypto:_metadataNet.fileName serverUrl:_metadataNet.serverUrl session:_metadataNet.session taskStatus:_metadataNet.taskStatus selector:_metadataNet.selector selectorPost:_metadataNet.selectorPost parentRev:nil errorCode:_metadataNet.errorCode delegate:self];
-    
-    if (!_oneByOne)
-        [self complete];
 }
 
 - (void)uploadTaskSave:(NSURLSessionUploadTask *)uploadTask
@@ -374,11 +357,11 @@
             for (NSUInteger i=1; i < [itemsSortedArray count]; i++) {
                 
                 OCFileDto *itemDto = [itemsSortedArray objectAtIndex:i];
-                itemDto.fileName = [CCUtility clearFile:itemDto.fileName];
+                itemDto.fileName = [itemDto.fileName stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                 
                 // ----- BUG #942 ---------
                 if ([itemDto.etag length] == 0) {
-#ifndef SHARE_IN
+#ifndef EXTENSION
                     [app messageNotification:@"Server error" description:@"Metadata etag absent, record excluded, please fix" visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeError];
 #endif
                     continue;
@@ -641,6 +624,7 @@
             
             OCFileDto *itemDto = [items objectAtIndex:0];
             itemDto.fileName = _metadataNet.fileName;
+            
             NSString *directoryID = [CCCoreData getDirectoryIDFromServerUrl:_metadataNet.serverUrl activeAccount:_metadataNet.account];
             NSString *cameraFolderName = [CCCoreData getCameraUploadFolderNameActiveAccount:_metadataNet.account];
             NSString *cameraFolderPath = [CCCoreData getCameraUploadFolderPathActiveAccount:_metadataNet.account activeUrl:_activeUrl typeCloud:_typeCloud];
@@ -720,7 +704,7 @@
 
 - (NSMutableDictionary *)getShareID
 {
-#ifndef SHARE_IN
+#ifndef EXTENSION
     return app.sharesID;
 #endif
     return [NSMutableDictionary new];
@@ -743,8 +727,11 @@
         
         if ([recordAccount.account isEqualToString:_metadataNet.account]) {
         
-            for (OCSharedDto *item in items)
+            for (OCSharedDto *item in items) {
+                
+                item.path = [item.path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
                 [[self getShareID] setObject:item forKey:[@(item.idRemoteShared) stringValue]];
+            }
             
             if ([_metadataNet.selector isEqual:selectorOpenWindowShare]) openWindow = YES;
             
@@ -846,7 +833,7 @@
         
     } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
         
-#ifndef SHARE_IN
+#ifndef EXTENSION
         [app messageNotification:@"_error_" description:[CCError manageErrorOC:response.statusCode error:error] visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeError];
 #endif
         
@@ -881,7 +868,7 @@
         
     } failureRequest:^(NSHTTPURLResponse *response, NSError *error, NSString *redirectedServer) {
         
-#ifndef SHARE_IN
+#ifndef EXTENSION
         [app messageNotification:@"_error_" description:[CCError manageErrorOC:response.statusCode error:error] visible:YES delay:dismissAfterSecond type:TWMessageBarMessageTypeError];
 #endif
         

+ 7 - 0
iOSClient/Nextcloud-Bridging-Header.h

@@ -0,0 +1,7 @@
+//
+//  Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
+#import "AHKActionSheet.h"
+#import "AppDelegate.h"
+

+ 14 - 0
iOSClient/Nextcloud.entitlements

@@ -2,6 +2,20 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>com.apple.developer.icloud-container-identifiers</key>
+	<array>
+		<string>iCloud.$(CFBundleIdentifier)</string>
+	</array>
+	<key>com.apple.developer.icloud-services</key>
+	<array>
+		<string>CloudDocuments</string>
+	</array>
+	<key>com.apple.developer.ubiquity-container-identifiers</key>
+	<array>
+		<string>iCloud.$(CFBundleIdentifier)</string>
+	</array>
+	<key>com.apple.developer.ubiquity-kvstore-identifier</key>
+	<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
 	<key>com.apple.security.application-groups</key>
 	<array>
 		<string>group.it.twsweb.Crypto-Cloud</string>

+ 23 - 0
iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "SynchronizedNextcloud@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "SynchronizedNextcloud@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "SynchronizedNextcloud@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@1x.png


BIN
iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@2x.png


BIN
iOSClient/Nextcloud.xcassets/SynchronizedNextcloud.imageset/SynchronizedNextcloud@3x.png


+ 23 - 0
iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "createFolderNextcloud@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "createFolderNextcloud@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "createFolderNextcloud@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@1x.png


BIN
iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@2x.png


BIN
iOSClient/Nextcloud.xcassets/createFolderNextcloud.imageset/createFolderNextcloud@3x.png


+ 23 - 0
iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "favoriteNextcloud@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "favoriteNextcloud@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "favoriteNextcloud@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@1x.png


BIN
iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@2x.png


BIN
iOSClient/Nextcloud.xcassets/favoriteNextcloud.imageset/favoriteNextcloud@3x.png


+ 23 - 0
iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "localStorageNextcloud@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "localStorageNextcloud@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "localStorageNextcloud@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@1x.png


BIN
iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@2x.png


BIN
iOSClient/Nextcloud.xcassets/localStorageNextcloud.imageset/localStorageNextcloud@3x.png


Some files were not shown because too many files changed in this diff