Browse Source

Start new share extension

marinofaggiana 3 years ago
parent
commit
1494e830e7

+ 14 - 36
Nextcloud.xcodeproj/project.pbxproj

@@ -62,11 +62,12 @@
 		F710E8111EF95C9C00DC2427 /* ImagesIntro.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F710E80F1EF95C9C00DC2427 /* ImagesIntro.xcassets */; };
 		F7134186259747BA00768D21 /* NCPushNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = F7134185259747BA00768D21 /* NCPushNotification.m */; };
 		F713FF002472764100214AF6 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F713FEFF2472764100214AF6 /* UIImage+animatedGIF.m */; };
-		F71459C21D12E3B700CAFEEC /* ShareViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7C0F46F1C8880540059EC54 /* ShareViewController.m */; };
 		F71459D21D12E3B700CAFEEC /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; };
-		F7145A041D12E3B700CAFEEC /* CCloadItemData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7296A661C8880ED001A7809 /* CCloadItemData.swift */; };
 		F7145A1A1D12E3B700CAFEEC /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; };
 		F7145A231D12E3B700CAFEEC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; };
+		F7148035262EBE2F00693E51 /* CCloadItemData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7148034262EBE2F00693E51 /* CCloadItemData.swift */; };
+		F714803B262EBE3900693E51 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F714803A262EBE3900693E51 /* MainInterface.storyboard */; };
+		F7148041262EBE4000693E51 /* NCShareExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7148040262EBE4000693E51 /* NCShareExtension.swift */; };
 		F717402D24F699A5000C87D5 /* NCFavorite.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F717402B24F699A5000C87D5 /* NCFavorite.storyboard */; };
 		F717402E24F699A5000C87D5 /* NCFavorite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F717402C24F699A5000C87D5 /* NCFavorite.swift */; };
 		F7176DBA256672640017E83C /* FirebaseCrashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7176DAE256672630017E83C /* FirebaseCrashlytics.framework */; };
@@ -238,9 +239,6 @@
 		F78ACD52219046DC0088454D /* NCSectionHeaderFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78ACD51219046DC0088454D /* NCSectionHeaderFooter.swift */; };
 		F78ACD54219047D40088454D /* NCSectionFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = F78ACD53219047D40088454D /* NCSectionFooter.xib */; };
 		F78ACD58219048040088454D /* NCSectionHeaderMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F78ACD57219048040088454D /* NCSectionHeaderMenu.xib */; };
-		F78B9685234F785300F54315 /* NCSelectDestination.m in Sources */ = {isa = PBXBuildFile; fileRef = F78B9682234F785300F54315 /* NCSelectDestination.m */; };
-		F78B9686234F785300F54315 /* NCSelectDestination.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F78B9684234F785300F54315 /* NCSelectDestination.storyboard */; };
-		F78BFEE11D31126B00E513CF /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F78BFEDE1D31126B00E513CF /* MainInterface.storyboard */; };
 		F78F74342163757000C2ADAD /* NCTrash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F78F74332163757000C2ADAD /* NCTrash.storyboard */; };
 		F78F74362163781100C2ADAD /* NCTrash.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78F74352163781100C2ADAD /* NCTrash.swift */; };
 		F790110E21415BF600D7B136 /* NCViewerRichdocument.swift in Sources */ = {isa = PBXBuildFile; fileRef = F790110D21415BF600D7B136 /* NCViewerRichdocument.swift */; };
@@ -324,8 +322,6 @@
 		F7F4B1D823C74B3E00D82A6E /* NCRichWorkspace.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F4B1D723C74B3E00D82A6E /* NCRichWorkspace.swift */; };
 		F7F878AE1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */; };
 		F7F878AF1FB9E3B900599E4F /* NCEndToEndMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */; };
-		F7F8D71C1ED6183000E711F3 /* CCCellShareExt.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F8D71A1ED6183000E711F3 /* CCCellShareExt.m */; };
-		F7F8D71D1ED6183000E711F3 /* CCCellShareExt.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7F8D71B1ED6183000E711F3 /* CCCellShareExt.xib */; };
 		F7F9D1BB25397CE000D9BFF5 /* NCViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7F9D1BA25397CE000D9BFF5 /* NCViewer.swift */; };
 		F7FAC2672549E1B5008EE2C4 /* NCKTVHTTPCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FAC2662549E1B5008EE2C4 /* NCKTVHTTPCache.swift */; };
 /* End PBXBuildFile section */
@@ -434,6 +430,10 @@
 		F7134185259747BA00768D21 /* NCPushNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCPushNotification.m; sourceTree = "<group>"; };
 		F713FEFE2472764000214AF6 /* UIImage+animatedGIF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+animatedGIF.h"; sourceTree = "<group>"; };
 		F713FEFF2472764100214AF6 /* UIImage+animatedGIF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+animatedGIF.m"; sourceTree = "<group>"; };
+		F7148034262EBE2F00693E51 /* CCloadItemData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCloadItemData.swift; sourceTree = "<group>"; };
+		F714803A262EBE3900693E51 /* MainInterface.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainInterface.storyboard; sourceTree = "<group>"; };
+		F7148040262EBE4000693E51 /* NCShareExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCShareExtension.swift; sourceTree = "<group>"; };
+		F7148046262EBE4B00693E51 /* Share-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Share-Bridging-Header.h"; sourceTree = "<group>"; };
 		F7151A811D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A301EE59BB70086BD69 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A4C1EE59C640086BD69 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -465,7 +465,6 @@
 		F728B2BB23E83AD200E12DA0 /* Notification_Service_Extension.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Notification_Service_Extension.plist; sourceTree = "<group>"; };
 		F728B2BC23E83AD200E12DA0 /* Notification_Service_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Notification_Service_Extension.entitlements; sourceTree = "<group>"; };
 		F729289F253B0937009CA4FD /* NCMainNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMainNavigationController.swift; sourceTree = "<group>"; };
-		F7296A661C8880ED001A7809 /* CCloadItemData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCloadItemData.swift; sourceTree = "<group>"; };
 		F72A47EB2487B06B005AD489 /* NCOperationQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCOperationQueue.swift; sourceTree = "<group>"; };
 		F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUpload.swift; sourceTree = "<group>"; };
 		F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCPushNotificationEncryption.m; sourceTree = "<group>"; };
@@ -558,7 +557,6 @@
 		F76D3CF22428B94E005DFA87 /* NCViewerPDFSearchCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCViewerPDFSearchCell.xib; sourceTree = "<group>"; };
 		F76D3CF42428D0C0005DFA87 /* NCViewerPDF.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCViewerPDF.storyboard; sourceTree = "<group>"; };
 		F76E71E42244DF6900690001 /* Zip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Zip.framework; path = Carthage/Build/iOS/Zip.framework; sourceTree = "<group>"; };
-		F76F23321ED4600700C40023 /* Share-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Share-Bridging-Header.h"; sourceTree = "<group>"; };
 		F76FDEAA24859C3D0095B6C2 /* Queuer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Queuer.framework; path = Carthage/Build/iOS/Queuer.framework; sourceTree = "<group>"; };
 		F771E3D020E2392D00AFB62D /* File Provider Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "File Provider Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
 		F771E3D220E2392D00AFB62D /* FileProviderExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderExtension.swift; sourceTree = "<group>"; };
@@ -613,10 +611,6 @@
 		F78ACD51219046DC0088454D /* NCSectionHeaderFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSectionHeaderFooter.swift; sourceTree = "<group>"; };
 		F78ACD53219047D40088454D /* NCSectionFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCSectionFooter.xib; sourceTree = "<group>"; };
 		F78ACD57219048040088454D /* NCSectionHeaderMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCSectionHeaderMenu.xib; sourceTree = "<group>"; };
-		F78B9682234F785300F54315 /* NCSelectDestination.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCSelectDestination.m; sourceTree = "<group>"; };
-		F78B9683234F785300F54315 /* NCSelectDestination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCSelectDestination.h; sourceTree = "<group>"; };
-		F78B9684234F785300F54315 /* NCSelectDestination.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCSelectDestination.storyboard; sourceTree = "<group>"; };
-		F78BFEDE1D31126B00E513CF /* MainInterface.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainInterface.storyboard; sourceTree = "<group>"; };
 		F78D6F461F0B7CB9002F9619 /* es-MX */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-MX"; path = "es-MX.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F78D6F4D1F0B7CE4002F9619 /* nb-NO */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "nb-NO"; path = "nb-NO.lproj/Localizable.strings"; sourceTree = "<group>"; };
 		F78D6F541F0B7D47002F9619 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -656,8 +650,6 @@
 		F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDatabase.swift; sourceTree = "<group>"; };
 		F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCManageDatabase.swift; sourceTree = "<group>"; };
 		F7BB04851FD58ACB00BBFD2A /* cs-CZ */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "cs-CZ"; path = "cs-CZ.lproj/Localizable.strings"; sourceTree = "<group>"; };
-		F7C0F46E1C8880540059EC54 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ShareViewController.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
-		F7C0F46F1C8880540059EC54 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ShareViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F7C1EEA425053A9C00866ACC /* NCDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCDataSource.swift; sourceTree = "<group>"; };
 		F7C40BE221998C050004137E /* PDFGenerator.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PDFGenerator.framework; path = Carthage/Build/iOS/PDFGenerator.framework; sourceTree = "<group>"; };
 		F7C40BE421998D5A0004137E /* MGSwipeTableCell.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MGSwipeTableCell.framework; path = Carthage/Build/iOS/MGSwipeTableCell.framework; sourceTree = "<group>"; };
@@ -712,9 +704,6 @@
 		F7F4B1D723C74B3E00D82A6E /* NCRichWorkspace.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCRichWorkspace.swift; sourceTree = "<group>"; };
 		F7F67BB81A24D27800EE80DA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		F7F878AD1FB9E3B900599E4F /* NCEndToEndMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndMetadata.swift; sourceTree = "<group>"; };
-		F7F8D7191ED6183000E711F3 /* CCCellShareExt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCellShareExt.h; sourceTree = "<group>"; };
-		F7F8D71A1ED6183000E711F3 /* CCCellShareExt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCellShareExt.m; sourceTree = "<group>"; };
-		F7F8D71B1ED6183000E711F3 /* CCCellShareExt.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellShareExt.xib; sourceTree = "<group>"; };
 		F7F9D1BA25397CE000D9BFF5 /* NCViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCViewer.swift; sourceTree = "<group>"; };
 		F7FAC2662549E1B5008EE2C4 /* NCKTVHTTPCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCKTVHTTPCache.swift; sourceTree = "<group>"; };
 		F7FC7D551DC1F93800BB2C6A /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
@@ -1291,17 +1280,10 @@
 		F7C0F46D1C8880540059EC54 /* Share */ = {
 			isa = PBXGroup;
 			children = (
-				F78B9683234F785300F54315 /* NCSelectDestination.h */,
-				F78B9682234F785300F54315 /* NCSelectDestination.m */,
-				F78B9684234F785300F54315 /* NCSelectDestination.storyboard */,
-				F7F8D7191ED6183000E711F3 /* CCCellShareExt.h */,
-				F7F8D71A1ED6183000E711F3 /* CCCellShareExt.m */,
-				F7F8D71B1ED6183000E711F3 /* CCCellShareExt.xib */,
-				F78BFEDE1D31126B00E513CF /* MainInterface.storyboard */,
-				F7C0F46E1C8880540059EC54 /* ShareViewController.h */,
-				F7C0F46F1C8880540059EC54 /* ShareViewController.m */,
-				F7296A661C8880ED001A7809 /* CCloadItemData.swift */,
-				F76F23321ED4600700C40023 /* Share-Bridging-Header.h */,
+				F7148034262EBE2F00693E51 /* CCloadItemData.swift */,
+				F714803A262EBE3900693E51 /* MainInterface.storyboard */,
+				F7148040262EBE4000693E51 /* NCShareExtension.swift */,
+				F7148046262EBE4B00693E51 /* Share-Bridging-Header.h */,
 			);
 			path = Share;
 			sourceTree = "<group>";
@@ -1818,13 +1800,11 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				F78B9686234F785300F54315 /* NCSelectDestination.storyboard in Resources */,
+				F714803B262EBE3900693E51 /* MainInterface.storyboard in Resources */,
 				F7EDE515262DC2CD00414FE6 /* NCSelectCommandViewSelect+CreateFolder.xib in Resources */,
-				F78BFEE11D31126B00E513CF /* MainInterface.storyboard in Resources */,
 				F7145A1A1D12E3B700CAFEEC /* Images.xcassets in Resources */,
 				F7EDE50A262DA9D600414FE6 /* NCSelectCommandViewSelect.xib in Resources */,
 				F7EDE51C262DD0C400414FE6 /* NCSelectCommandViewCopyMove.xib in Resources */,
-				F7F8D71D1ED6183000E711F3 /* CCCellShareExt.xib in Resources */,
 				F7145A231D12E3B700CAFEEC /* Localizable.strings in Resources */,
 				F700222D1EC479840080073F /* Custom.xcassets in Resources */,
 			);
@@ -1975,9 +1955,9 @@
 				F73D5E48246DE09200DF6467 /* NCElementsJSON.swift in Sources */,
 				F7EDE4E5262D7BBE00414FE6 /* NCSectionHeaderFooter.swift in Sources */,
 				F7A0D1362591FBC5008F8A13 /* String+Extensions.swift in Sources */,
+				F7148035262EBE2F00693E51 /* CCloadItemData.swift in Sources */,
 				F7EDE4D6262D7B9600414FE6 /* NCListCell.swift in Sources */,
 				F70460532499095400BB98A7 /* NotificationCenter+MainThread.swift in Sources */,
-				F71459C21D12E3B700CAFEEC /* ShareViewController.m in Sources */,
 				F70BFC7520E0FA7D00C67599 /* NCUtility.swift in Sources */,
 				F7EDE4CC262D7B6F00414FE6 /* NCEmptyDataSet.swift in Sources */,
 				F798F0E225880608000DAFFD /* UIColor+Extensions.swift in Sources */,
@@ -1988,7 +1968,6 @@
 				F7EDE4DB262D7BA200414FE6 /* NCImageCellProtocol.swift in Sources */,
 				F7EDE4D1262D7B8400414FE6 /* NCDataSource.swift in Sources */,
 				F71459D21D12E3B700CAFEEC /* CCUtility.m in Sources */,
-				F7F8D71C1ED6183000E711F3 /* CCCellShareExt.m in Sources */,
 				F7EDE4EF262D7C8500414FE6 /* NCMenu.swift in Sources */,
 				F765609023BF813600765969 /* NCContentPresenter.swift in Sources */,
 				F75A9EE723796C6F0044CFCE /* NCNetworking.swift in Sources */,
@@ -1998,9 +1977,8 @@
 				F7BAADC91ED5A87C00B7EAD4 /* NCDatabase.swift in Sources */,
 				F7EDE4F4262D7C9A00414FE6 /* NCOperationQueue.swift in Sources */,
 				F780710A1EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */,
-				F78B9685234F785300F54315 /* NCSelectDestination.m in Sources */,
 				F7EDE4EA262D7C6C00414FE6 /* NCSortMenu.swift in Sources */,
-				F7145A041D12E3B700CAFEEC /* CCloadItemData.swift in Sources */,
+				F7148041262EBE4000693E51 /* NCShareExtension.swift in Sources */,
 				F76B3CCF1EAE01BD00921AC9 /* NCBrand.swift in Sources */,
 				F7EDE4C7262D7B4E00414FE6 /* NCSelect.swift in Sources */,
 				F7BAADCC1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,

+ 0 - 38
Share/CCCellShareExt.h

@@ -1,38 +0,0 @@
-//
-//  CCCellShareExt.h
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 27/01/16.
-//  Copyright (c) 2016 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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/UIKit.h>
-
-@interface CCCellShareExt : UITableViewCell
-
-@property(nonatomic, weak) IBOutlet UIImageView *fileImageView;
-@property(nonatomic, weak) IBOutlet UITextField *fileName;
-@property(nonatomic, weak) IBOutlet UILabel *info;
-
-//Last position of the scroll of the swipe
-@property (nonatomic, assign) CGFloat lastContentOffset;
-
-//Index path of the cell swipe gesture ocured
-@property (nonatomic, strong) NSIndexPath *indexPath;
-
-@end

+ 0 - 45
Share/CCCellShareExt.m

@@ -1,45 +0,0 @@
-//
-//  CCCellShareExt.m
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 29/07/15.
-//  Copyright (c) 2015 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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 "CCCellShareExt.h"
-
-@implementation CCCellShareExt
-
-- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
-{
-    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
-    if (self) {
-    }
-    return self;
-}
-
-- (void)setSelected:(BOOL)selected animated:(BOOL)animated
-{
-    [super setSelected:selected animated:animated];
-}
-
-- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView {
-    _lastContentOffset = scrollView.contentOffset.x;
-}
-
-@end

+ 0 - 65
Share/CCCellShareExt.xib

@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
-    <device id="retina6_1" orientation="portrait" appearance="light"/>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CustomCellFileAndDirectory"/>
-        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <tableViewCell contentMode="scaleToFill" selectionStyle="blue" indentationWidth="0.0" reuseIdentifier="ShareExtCell" rowHeight="80" id="2" customClass="CCCellShareExt">
-            <rect key="frame" x="0.0" y="0.0" width="597" height="80"/>
-            <autoresizingMask key="autoresizingMask" flexibleMaxY="YES"/>
-            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2" id="sQq-jC-UEV">
-                <rect key="frame" x="0.0" y="0.0" width="597" height="80"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="5">
-                        <rect key="frame" x="10" y="5" width="70" height="70"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="70" id="2Z3-9a-dWb"/>
-                            <constraint firstAttribute="width" constant="70" id="fbQ-SN-CAK"/>
-                        </constraints>
-                    </imageView>
-                    <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="VsB-d4-Sow">
-                        <rect key="frame" x="90" y="20" width="497" height="20"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="20" id="Dk0-na-bfK"/>
-                        </constraints>
-                        <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                        <textInputTraits key="textInputTraits"/>
-                    </textField>
-                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Ow-Hb-LiN">
-                        <rect key="frame" x="90" y="55" width="497" height="20"/>
-                        <constraints>
-                            <constraint firstAttribute="height" constant="20" id="9pk-f4-eS9"/>
-                        </constraints>
-                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
-                        <nil key="textColor"/>
-                        <nil key="highlightedColor"/>
-                    </label>
-                </subviews>
-                <constraints>
-                    <constraint firstItem="5" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="3LF-0l-IUQ"/>
-                    <constraint firstItem="VsB-d4-Sow" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="CrK-6o-Z32"/>
-                    <constraint firstAttribute="trailing" secondItem="0Ow-Hb-LiN" secondAttribute="trailing" constant="10" id="DiV-IR-cy6"/>
-                    <constraint firstAttribute="bottom" secondItem="0Ow-Hb-LiN" secondAttribute="bottom" constant="5" id="ObO-OF-tvn"/>
-                    <constraint firstItem="0Ow-Hb-LiN" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="PFo-Au-ORj"/>
-                    <constraint firstAttribute="trailing" secondItem="VsB-d4-Sow" secondAttribute="trailing" constant="10" id="Q94-2Q-wue"/>
-                    <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" constant="10" id="fuA-E4-YoA"/>
-                    <constraint firstItem="VsB-d4-Sow" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="20" id="pdW-jk-v6V"/>
-                </constraints>
-            </tableViewCellContentView>
-            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-            <connections>
-                <outlet property="Info" destination="9pk-f4-eS9" id="vm7-h8-kBz"/>
-                <outlet property="fileImageView" destination="5" id="6"/>
-                <outlet property="fileName" destination="VsB-d4-Sow" id="IiA-92-aJd"/>
-                <outlet property="info" destination="0Ow-Hb-LiN" id="Hhb-VE-mwc"/>
-            </connections>
-            <point key="canvasLocation" x="248.55072463768118" y="278.57142857142856"/>
-        </tableViewCell>
-    </objects>
-</document>

+ 5 - 5
Share/CCloadItemData.swift

@@ -26,7 +26,7 @@ import MobileCoreServices
 
 class CCloadItemData: NSObject {
     
-    @objc func loadFiles(_ directory: String, extensionContext: NSExtensionContext, vc: ShareViewController) {
+    @objc func loadFiles(_ directory: String, extensionContext: NSExtensionContext, vc: UIViewController) {
         
         var filesName: [String] = []
         var conuter = 0
@@ -43,7 +43,7 @@ class CCloadItemData: NSObject {
                         
                         extensionContext.completeRequest(returningItems: nil, completionHandler: nil)
                         
-                        vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
+                        //vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
                         
                         return
                     }
@@ -181,7 +181,7 @@ class CCloadItemData: NSObject {
                                     
                                     if index + 1 == attachments.count {
                                         
-                                        vc.performSelector(onMainThread: #selector(vc.reloadData), with:filesName, waitUntilDone: false)
+                                        //vc.performSelector(onMainThread: #selector(vc.reloadData), with:filesName, waitUntilDone: false)
                                     }
                                     
                                 }
@@ -193,13 +193,13 @@ class CCloadItemData: NSObject {
 
                 } else {
                     
-                    vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
+                    //vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
                 }
             }
             
         } else {
             
-            vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
+            //vc.performSelector(onMainThread: #selector(vc.close), with: nil, waitUntilDone: false);
         }
     }
 }

+ 80 - 65
Share/MainInterface.storyboard

@@ -1,90 +1,105 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="yQd-yC-53O">
-    <device id="retina4_7" orientation="portrait" appearance="light"/>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EAU-PF-EEd">
+    <device id="retina6_5" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
-        <!--Navigation Controller-->
-        <scene sceneID="ueh-Ta-TQZ">
-            <objects>
-                <navigationController id="yQd-yC-53O" sceneMemberID="viewController">
-                    <nil key="simulatedStatusBarMetrics"/>
-                    <navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="Qr0-yX-mDZ">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </navigationBar>
-                    <connections>
-                        <segue destination="j1y-V4-xli" kind="relationship" relationship="rootViewController" id="dCI-hj-EK1"/>
-                    </connections>
-                </navigationController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="SCm-q2-twq" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="-1057" y="-210"/>
-        </scene>
-        <!--Share View Controller-->
-        <scene sceneID="ceB-am-kn3">
+        <!--Share Extension-->
+        <scene sceneID="d4X-6u-1HM">
             <objects>
-                <viewController id="j1y-V4-xli" customClass="ShareViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="8bI-gs-bmD"/>
-                        <viewControllerLayoutGuide type="bottom" id="d5i-Ba-RvD"/>
-                    </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="wbc-yd-nQP">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="623"/>
+                <viewController id="VYq-xA-D35" customClass="NCShareExtension" customModule="Share" customModuleProvider="target" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="MaM-Im-7sc">
+                        <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <toolbar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gad-k1-Oh8">
-                                <rect key="frame" x="-8" y="579" width="387" height="44"/>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="0HI-k1-SD0">
+                                <rect key="frame" x="0.0" y="88" width="414" height="300"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="44" id="rZR-ep-syc"/>
+                                    <constraint firstAttribute="height" constant="300" id="fJa-nH-6ON"/>
                                 </constraints>
-                                <items>
-                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="ski-H2-N9g"/>
-                                    <barButtonItem title="Item" id="Dpo-t5-Knx">
-                                        <connections>
-                                            <action selector="destinyFolderButtonTapped:" destination="j1y-V4-xli" id="vt9-MN-l6i"/>
-                                        </connections>
-                                    </barButtonItem>
-                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="eZh-WQ-5L1"/>
-                                </items>
-                            </toolbar>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="110" sectionHeaderHeight="1" sectionFooterHeight="1" translatesAutoresizingMaskIntoConstraints="NO" id="6bg-ed-mfL">
-                                <rect key="frame" x="0.0" y="0.0" width="375" height="579"/>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="D7P-75-aB1">
+                                    <size key="itemSize" width="0.0" height="0.0"/>
+                                    <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                                    <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                                    <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                </collectionViewFlowLayout>
+                                <cells/>
                                 <connections>
-                                    <outlet property="dataSource" destination="j1y-V4-xli" id="cqC-oT-nbV"/>
-                                    <outlet property="delegate" destination="j1y-V4-xli" id="WE4-Xb-ohZ"/>
+                                    <outlet property="dataSource" destination="VYq-xA-D35" id="knG-ac-buS"/>
+                                    <outlet property="delegate" destination="VYq-xA-D35" id="EXB-bA-tje"/>
                                 </connections>
+                            </collectionView>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="tb6-e3-4GA">
+                                <rect key="frame" x="0.0" y="418" width="414" height="395"/>
+                                <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                             </tableView>
+                            <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d1F-Sb-G9O">
+                                <rect key="frame" x="0.0" y="813" width="414" height="49"/>
+                                <items>
+                                    <barButtonItem title="Item" id="McS-ZS-WzN"/>
+                                </items>
+                            </toolbar>
                         </subviews>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <viewLayoutGuide key="safeArea" id="vaA-85-uNN"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
-                            <constraint firstAttribute="trailingMargin" secondItem="gad-k1-Oh8" secondAttribute="trailing" constant="-20" id="Ogc-Ss-sTA"/>
-                            <constraint firstAttribute="trailing" secondItem="6bg-ed-mfL" secondAttribute="trailing" id="dku-zI-tdG"/>
-                            <constraint firstItem="d5i-Ba-RvD" firstAttribute="top" secondItem="gad-k1-Oh8" secondAttribute="bottom" id="n1F-h4-Uxd"/>
-                            <constraint firstItem="gad-k1-Oh8" firstAttribute="top" secondItem="6bg-ed-mfL" secondAttribute="bottom" id="qEs-cg-DMH"/>
-                            <constraint firstItem="gad-k1-Oh8" firstAttribute="leadingMargin" secondItem="wbc-yd-nQP" secondAttribute="leadingMargin" constant="-16" id="qnK-zI-jNY"/>
-                            <constraint firstItem="6bg-ed-mfL" firstAttribute="top" secondItem="8bI-gs-bmD" secondAttribute="bottom" id="sKS-dx-tS9"/>
-                            <constraint firstItem="gad-k1-Oh8" firstAttribute="top" secondItem="6bg-ed-mfL" secondAttribute="bottom" id="xUM-bt-esX"/>
-                            <constraint firstItem="6bg-ed-mfL" firstAttribute="leading" secondItem="wbc-yd-nQP" secondAttribute="leading" id="xkR-sP-qEX"/>
+                            <constraint firstItem="0HI-k1-SD0" firstAttribute="top" secondItem="vaA-85-uNN" secondAttribute="top" id="552-sP-Paj"/>
+                            <constraint firstItem="vaA-85-uNN" firstAttribute="trailing" secondItem="0HI-k1-SD0" secondAttribute="trailing" id="KT1-YT-Lps"/>
+                            <constraint firstItem="tb6-e3-4GA" firstAttribute="leading" secondItem="vaA-85-uNN" secondAttribute="leading" id="LQY-br-5G0"/>
+                            <constraint firstItem="vaA-85-uNN" firstAttribute="bottom" secondItem="d1F-Sb-G9O" secondAttribute="bottom" id="Wmt-Y6-V8T"/>
+                            <constraint firstItem="vaA-85-uNN" firstAttribute="trailing" secondItem="tb6-e3-4GA" secondAttribute="trailing" id="YQt-e1-B7Z"/>
+                            <constraint firstItem="d1F-Sb-G9O" firstAttribute="leading" secondItem="vaA-85-uNN" secondAttribute="leading" id="aCp-9X-sbV"/>
+                            <constraint firstItem="d1F-Sb-G9O" firstAttribute="top" secondItem="tb6-e3-4GA" secondAttribute="bottom" id="fsb-cn-A4e"/>
+                            <constraint firstItem="tb6-e3-4GA" firstAttribute="top" secondItem="0HI-k1-SD0" secondAttribute="bottom" constant="30" id="gCq-mK-zAm"/>
+                            <constraint firstItem="vaA-85-uNN" firstAttribute="trailing" secondItem="d1F-Sb-G9O" secondAttribute="trailing" id="o2P-Vd-ejX"/>
+                            <constraint firstItem="0HI-k1-SD0" firstAttribute="leading" secondItem="vaA-85-uNN" secondAttribute="leading" id="uLL-RT-YFO"/>
                         </constraints>
                     </view>
-                    <navigationItem key="navigationItem" id="DwO-O2-rAX"/>
-                    <nil key="simulatedStatusBarMetrics"/>
+                    <navigationItem key="navigationItem" id="N5K-De-4CP">
+                        <barButtonItem key="rightBarButtonItem" title="Cancel" id="qHj-AF-EN7">
+                            <connections>
+                                <action selector="actionCancel:" destination="VYq-xA-D35" id="LRW-H2-pbh"/>
+                            </connections>
+                        </barButtonItem>
+                    </navigationItem>
                     <connections>
-                        <outlet property="constraintTopTableView" destination="sKS-dx-tS9" id="Cps-IG-Eih"/>
-                        <outlet property="destinyFolderButton" destination="Dpo-t5-Knx" id="9p8-c0-Ocm"/>
-                        <outlet property="shareTable" destination="6bg-ed-mfL" id="tzz-SO-m9D"/>
-                        <outlet property="toolBar" destination="gad-k1-Oh8" id="gAK-GL-EcZ"/>
+                        <outlet property="buttonCancel" destination="qHj-AF-EN7" id="Fky-XJ-BxL"/>
+                        <outlet property="collectionView" destination="0HI-k1-SD0" id="xme-mG-bnz"/>
+                        <outlet property="tableView" destination="tb6-e3-4GA" id="6nq-jb-rai"/>
                     </connections>
                 </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="vH8-UY-9MN" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1195.6521739130435" y="227.67857142857142"/>
+        </scene>
+        <!--Navigation Controller-->
+        <scene sceneID="KP9-Ja-zsS">
+            <objects>
+                <navigationController automaticallyAdjustsScrollViewInsets="NO" id="EAU-PF-EEd" sceneMemberID="viewController">
+                    <toolbarItems/>
+                    <navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="OMR-Ah-U1w">
+                        <rect key="frame" x="0.0" y="44" width="414" height="44"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </navigationBar>
+                    <nil name="viewControllers"/>
+                    <connections>
+                        <segue destination="VYq-xA-D35" kind="relationship" relationship="rootViewController" id="dZh-kL-x5f"/>
+                    </connections>
+                </navigationController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="rcK-ZU-zTS" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="-290" y="-210"/>
+            <point key="canvasLocation" x="256.80000000000001" y="228.93553223388307"/>
         </scene>
     </scenes>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
 </document>

+ 0 - 65
Share/NCSelectDestination.h

@@ -1,65 +0,0 @@
-//
-//  NCSelectDestination.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/09/14.
-//  Copyright (c) 2014 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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/UIKit.h>
-
-#import "CCUtility.h"
-
-@class tableMetadata;
-
-@protocol NCSelectDestinationDelegate;
-
-@interface NCSelectDestination : UITableViewController <UIAlertViewDelegate, UITableViewDelegate>
-
-@property (nonatomic, weak) id <NCSelectDestinationDelegate> delegate;
-
-@property BOOL includeDirectoryE2EEncryption;
-@property BOOL includeImages;
-
-@property BOOL hideCreateFolder;
-@property BOOL hideMoveutton;
-
-@property BOOL selectFile;
-
-@property (nonatomic, strong) NSString *serverUrl;
-@property (nonatomic, strong) tableMetadata *passMetadata;
-@property (nonatomic, strong) NSString *type;
-
-// Color
-@property (nonatomic, strong) UIColor *barTintColor;
-@property (nonatomic, strong) UIColor *tintColor;
-@property (nonatomic, strong) UIColor *tintColorTitle;
-
-@property (nonatomic, weak) IBOutlet UIBarButtonItem *cancel;
-@property (nonatomic, weak) IBOutlet UIBarButtonItem *move;
-@property (nonatomic, weak) IBOutlet UIBarButtonItem *create;
-
-@end
-
-@protocol NCSelectDestinationDelegate <NSObject>
-
-@optional - (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title type:(NSString *)type;
-@optional - (void)dismissMove;
-@optional - (void)selectMetadata:(tableMetadata *)metadata serverUrl:(NSString *)serverUrl;
-
-@end

+ 0 - 320
Share/NCSelectDestination.m

@@ -1,320 +0,0 @@
-//
-//  CCMove.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 04/09/14.
-//  Copyright (c) 2014 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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 "NCSelectDestination.h"
-#import "NCBridgeSwift.h"
-
-@interface NCSelectDestination ()
-{    
-    NSString *account;
-    NSString *urlBase;
-  
-    BOOL _loadingFolder;
-    
-    // Automatic Upload Folder
-    NSString *_autoUploadFileName;
-    NSString *_autoUploadDirectory;
-    
-    NSPredicate *predicateDataSource;
-}
-@end
-
-@implementation NCSelectDestination
-
-// MARK: - View
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
-    
-    tableAccount *tableAccount = [[NCManageDatabase shared] getAccountActive];
-    
-    if (tableAccount) {
-        
-        account = tableAccount.account;
-        urlBase = tableAccount.urlBase;
-                
-    } else {
-        
-        UIAlertController * alert= [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"_no_active_account_", nil) preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
-            [alert dismissViewControllerAnimated:YES completion:nil];
-        }];
-        [alert addAction:ok];
-        [self presentViewController:alert animated:YES completion:nil];
-    }
-    
-    [self.cancel setTitle:NSLocalizedString(@"_cancel_", nil)];
-    [self.create setTitle:NSLocalizedString(@"_create_folder_", nil)];
-    
-    UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0,0, self.navigationItem.titleView.frame.size.width, 40)];
-    label.textColor = NCBrandColor.shared.brandText;
-    label.backgroundColor =[UIColor clearColor];
-    label.textAlignment = NSTextAlignmentCenter;
-    
-    if (![_serverUrl length]) {
-                
-        _serverUrl = [[NCUtilityFileSystem shared] getHomeServerWithUrlBase:urlBase account:account];
-        label.text = NSLocalizedString(@"_home_dir_", nil);
-        
-    } else {
-               
-        label.text = self.passMetadata.fileNameView;
-    }
-    
-    self.navigationItem.titleView = label;
-    
-    // TableView : at the end of rows nothing
-    self.tableView.tableFooterView = [UIView new];
-    self.tableView.separatorColor =  NCBrandColor.shared.separator;
-
-    // get auto upload folder
-    _autoUploadFileName = [[NCManageDatabase shared] getAccountAutoUploadFileName];
-    _autoUploadDirectory = [[NCManageDatabase shared] getAccountAutoUploadDirectoryWithUrlBase:urlBase account:account];
-    
-    [self readFolder];
-}
-
-// Apparirà
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    self.navigationController.navigationBar.barTintColor = NCBrandColor.shared.brandElement;
-    self.navigationController.navigationBar.tintColor = NCBrandColor.shared.brandText;
-    
-    self.navigationController.toolbar.barTintColor = NCBrandColor.shared.tabBar;
-    self.navigationController.toolbar.tintColor = [UIColor grayColor];
-    
-    if (self.hideCreateFolder) {
-        [self.create setEnabled:NO];
-        [self.create setTintColor: [UIColor clearColor]];
-    }
-    
-    if (self.hideMoveutton) {
-        [self.move setEnabled:NO];
-        [self.move setTintColor: [UIColor clearColor]];
-    }
-    
-    self.view.backgroundColor = NCBrandColor.shared.backgroundView;
-    self.tableView.backgroundColor = NCBrandColor.shared.backgroundView;
-}
-
-// MARK: - IBAction
-
-- (IBAction)cancel:(UIBarButtonItem *)sender
-{
-    if ([self.delegate respondsToSelector:@selector(dismissMove)])
-        [self.delegate dismissMove];
-    
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (IBAction)move:(UIBarButtonItem *)sender
-{
-    if ([self.delegate respondsToSelector:@selector(dismissMove)])
-        [self.delegate dismissMove];
-    
-    [self.delegate moveServerUrlTo:_serverUrl title:self.passMetadata.fileNameView type:self.type];
-        
-    [self dismissViewControllerAnimated:YES completion:nil];
-}
-
-- (IBAction)create:(UIBarButtonItem *)sender
-{
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_create_folder_",nil) message:@"" preferredStyle:UIAlertControllerStyleAlert];
-    
-    [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
-        //textField.placeholder = NSLocalizedString(@"LoginPlaceholder", @"Login");
-        textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
-    }];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_save_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-        [self createFolder:alertController.textFields.firstObject.text];
-    }]];
-    
-    [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-    }]];
-    
-    [self presentViewController:alertController animated:YES completion:nil];
-}
-
-// MARK: - Read Folder
-
-- (void)readFolder
-{
-    [[NCNetworking shared] readFolderWithServerUrl:_serverUrl account:account completion:^(NSString *account, tableMetadata *metadataFolder, NSArray *metadatas, NSArray *metadatasUpdate, NSArray *metadatasLocalUpdate, NSInteger errorCode, NSString *errorDescription) {
-        
-        if (errorCode == 0) {
-            self.move.enabled = true;
-        } else {
-            self.move.enabled = false;
-        }
-        
-        _loadingFolder = NO;
-        [self.tableView reloadData];
-    }];
-    
-    _loadingFolder = YES;
-    [self.tableView reloadData];
-}
-
-    
-// MARK: - Create Folder
-
-- (void)createFolder:(NSString *)fileNameFolder
-{
-    NSString *serverUrlFileName = [NSString stringWithFormat:@"%@/%@", _serverUrl, fileNameFolder];
-     
-    [[NCCommunication shared] createFolder:serverUrlFileName customUserAgent:nil addCustomHeaders:nil completionHandler:^(NSString *account, NSString *ocID, NSDate *date, NSInteger errorCode, NSString *errorDecription) {
-        if (errorCode == 0) {
-           [self readFolder];
-        } else {
-            UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:errorDecription preferredStyle:UIAlertControllerStyleAlert];
-            [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }]];
-            [self presentViewController:alertController animated:YES completion:nil];
-        }
-    }];
-}
-
-// MARK: - Table
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    if (self.includeDirectoryE2EEncryption) {
-        
-        if (self.includeImages) {
-            predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND (directory == true OR typeFile == 'image')", account, _serverUrl];
-        } else {
-            predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND directory == true", account, _serverUrl];
-        }
-        
-    } else {
-        
-        if (self.includeImages) {
-            predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND (directory == true OR typeFile == 'image')", account, _serverUrl];
-        } else {
-            predicateDataSource = [NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@ AND e2eEncrypted == false AND directory == true", account, _serverUrl];
-        }
-    }
-    
-    NSArray *result = [[NCManageDatabase shared] getMetadatasWithPredicate:predicateDataSource];
-    
-    if (result)
-        return [result count];
-    else
-        return 0;    
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    static NSString *CellIdentifier = @"MyCustomCell";
-    
-    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
-    if (cell == nil) {
-        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
-    }
-    
-    tableMetadata *metadata = [[NCManageDatabase shared] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row];
-    
-    // Create Directory Provider Storage ocId
-    [CCUtility getDirectoryProviderStorageOcId:metadata.ocId];
-    
-    // colors
-    cell.textLabel.textColor = NCBrandColor.shared.textView;
-    
-    cell.detailTextLabel.text = @"";
-    
-    if (metadata.directory) {
-    
-        if (metadata.e2eEncrypted)
-            cell.imageView.image = [[UIImage imageNamed:@"folderEncrypted"] imageWithColor:NCBrandColor.shared.brandElement size:50];
-        else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory])
-            cell.imageView.image = [[UIImage imageNamed:@"folderAutomaticUpload"] imageWithColor:NCBrandColor.shared.brandElement size:50];
-        else
-            cell.imageView.image = [[UIImage imageNamed:@"folder"] imageWithColor:NCBrandColor.shared.brandElement size:50];
-        
-    } else {
-        
-        UIImage *thumb = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconOcId:metadata.ocId etag:metadata.etag]];
-        
-        if (thumb) {
-            cell.imageView.image = thumb;
-        } else {
-            if (metadata.iconName.length > 0) {
-                cell.imageView.image = [UIImage imageNamed:metadata.iconName];
-            } else {
-                cell.imageView.image = [UIImage imageNamed:@"file"];
-            }
-        }
-    }
-
-    cell.textLabel.text = metadata.fileNameView;
-    cell.accessoryType = UITableViewCellAccessoryNone;
-    
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    tableMetadata *metadata = [[NCManageDatabase shared] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row ];
-    
-    if (metadata.directory) {
-        
-        UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"NCSelectDestination" bundle:nil] instantiateInitialViewController];
-        NCSelectDestination *viewController = (NCSelectDestination *)navigationController.topViewController;
-        
-        viewController.delegate = self.delegate;
-        viewController.includeDirectoryE2EEncryption = self.includeDirectoryE2EEncryption;
-        viewController.includeImages = self.includeImages;
-        viewController.move.title = self.move.title;
-        viewController.hideCreateFolder = self.hideCreateFolder;
-        viewController.hideMoveutton = self.hideMoveutton;
-        viewController.selectFile = self.selectFile;
-        viewController.type = self.type;
-        viewController.passMetadata = metadata;
-        viewController.serverUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:metadata.fileName];
-        
-        [self.navigationController pushViewController:viewController animated:YES];
-        
-    } else {
-        
-        if (self.selectFile) {
-            
-            if ([self.delegate respondsToSelector:@selector(dismissMove)])
-                [self.delegate dismissMove];
-            
-            if ([self.delegate respondsToSelector:@selector(selectMetadata:serverUrl:)])
-                [self.delegate selectMetadata:metadata serverUrl:_serverUrl];
-            
-            [self dismissViewControllerAnimated:YES completion:nil];
-        }
-    }
-}
-
-@end

+ 0 - 100
Share/NCSelectDestination.storyboard

@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="GGi-ld-Icm">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--Select Destination-->
-        <scene sceneID="72G-64-9xM">
-            <objects>
-                <tableViewController storyboardIdentifier="CCMoveVC" id="r57-Y0-NGA" customClass="NCSelectDestination" sceneMemberID="viewController">
-                    <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="50" sectionHeaderHeight="22" sectionFooterHeight="22" id="McT-Wl-5yC">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <prototypes>
-                            <tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="MyCustomCell" textLabel="Z3y-WW-606" rowHeight="60" style="IBUITableViewCellStyleDefault" id="w3K-MH-HTI">
-                                <rect key="frame" x="0.0" y="22" width="375" height="60"/>
-                                <autoresizingMask key="autoresizingMask"/>
-                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="w3K-MH-HTI" id="o7i-Tv-3Dy">
-                                    <rect key="frame" x="0.0" y="0.0" width="341" height="59.5"/>
-                                    <autoresizingMask key="autoresizingMask"/>
-                                    <subviews>
-                                        <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Z3y-WW-606">
-                                            <rect key="frame" x="16" y="0.0" width="324" height="59.5"/>
-                                            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
-                                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
-                                            <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                            <nil key="highlightedColor"/>
-                                        </label>
-                                    </subviews>
-                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                </tableViewCellContentView>
-                                <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                            </tableViewCell>
-                        </prototypes>
-                        <connections>
-                            <outlet property="dataSource" destination="r57-Y0-NGA" id="Ri8-7Y-4Eb"/>
-                            <outlet property="delegate" destination="r57-Y0-NGA" id="NFD-Pt-S38"/>
-                        </connections>
-                    </tableView>
-                    <toolbarItems>
-                        <barButtonItem title="Create" id="POg-4h-6PE">
-                            <connections>
-                                <action selector="create:" destination="r57-Y0-NGA" id="osR-ef-mcW"/>
-                            </connections>
-                        </barButtonItem>
-                        <barButtonItem style="plain" systemItem="flexibleSpace" id="W6q-bt-WEv"/>
-                        <barButtonItem title="Move" id="lHO-dx-i7G">
-                            <connections>
-                                <action selector="move:" destination="r57-Y0-NGA" id="Lrp-5d-IUd"/>
-                            </connections>
-                        </barButtonItem>
-                    </toolbarItems>
-                    <navigationItem key="navigationItem" id="6DA-qZ-eT5">
-                        <barButtonItem key="rightBarButtonItem" title="Cancel" id="YzK-6z-T0K">
-                            <connections>
-                                <action selector="cancel:" destination="r57-Y0-NGA" id="lSc-Ic-ZvZ"/>
-                            </connections>
-                        </barButtonItem>
-                    </navigationItem>
-                    <connections>
-                        <outlet property="cancel" destination="YzK-6z-T0K" id="ieh-Qu-oWw"/>
-                        <outlet property="create" destination="POg-4h-6PE" id="UyP-ep-sWK"/>
-                        <outlet property="move" destination="lHO-dx-i7G" id="8iF-b5-5v2"/>
-                    </connections>
-                </tableViewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="WJJ-7C-06z" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="8901" y="-447"/>
-        </scene>
-        <!--Navigation Controller-->
-        <scene sceneID="XhT-lY-9Eo">
-            <objects>
-                <navigationController automaticallyAdjustsScrollViewInsets="NO" toolbarHidden="NO" id="GGi-ld-Icm" sceneMemberID="viewController">
-                    <toolbarItems/>
-                    <navigationItem key="navigationItem" id="uMb-zy-0sS"/>
-                    <navigationBar key="navigationBar" alpha="0.89999997615814209" contentMode="scaleToFill" misplaced="YES" translucent="NO" id="emo-5L-Jsr">
-                        <rect key="frame" x="0.0" y="20" width="375" height="44"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </navigationBar>
-                    <nil name="viewControllers"/>
-                    <toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" alpha="0.89999997615814209" contentMode="scaleToFill" translucent="NO" id="rcA-x8-dow">
-                        <rect key="frame" x="0.0" y="623" width="375" height="44"/>
-                        <autoresizingMask key="autoresizingMask"/>
-                    </toolbar>
-                    <connections>
-                        <segue destination="r57-Y0-NGA" kind="relationship" relationship="rootViewController" id="ASc-lI-Ps1"/>
-                    </connections>
-                </navigationController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="gU9-pc-48i" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="8089" y="-447"/>
-        </scene>
-    </scenes>
-</document>

+ 664 - 0
Share/NCShareExtension.swift

@@ -0,0 +1,664 @@
+//
+//  NCShareExtension.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 20/04/2021.
+//  Copyright © 2021 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  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
+import NCCommunication
+
+class NCShareExtension: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresentationControllerDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, NCEmptyDataSetDelegate {
+    
+    @IBOutlet weak var collectionView: UICollectionView!
+    @IBOutlet weak var tableView: UITableView!
+
+    @IBOutlet fileprivate weak var buttonCancel: UIBarButtonItem!
+   
+    // -------------------------------------------------------------
+    var titleCurrentFolder = NCBrandOptions.shared.brand
+    var serverUrl = ""
+    // -------------------------------------------------------------
+        
+    private var emptyDataSet: NCEmptyDataSet?
+    
+    private let keyLayout = NCGlobal.shared.layoutViewMove
+    private var serverUrlPush = ""
+    private var metadataTouch: tableMetadata?
+    private var metadataFolder = tableMetadata()
+    
+    private var networkInProgress = false
+    
+    private var dataSource = NCDataSource()
+    internal var richWorkspaceText: String?
+
+    private var sort: String = ""
+    private var ascending: Bool = true
+    private var directoryOnTop: Bool = true
+    private var layout = ""
+    private var groupBy = ""
+    private var titleButton = ""
+    private var itemForLine = 0
+
+    private var autoUploadFileName = ""
+    private var autoUploadDirectory = ""
+    
+    private var listLayout: NCListLayout!
+    private var gridLayout: NCGridLayout!
+        
+    private let headerHeight: CGFloat = 50
+    private var headerRichWorkspaceHeight: CGFloat = 0
+    private let footerHeight: CGFloat = 100
+    
+    private var shares: [tableShare]?
+    
+    private let refreshControl = UIRefreshControl()
+    
+    private var activeAccount: tableAccount!
+        
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        self.navigationController?.navigationBar.prefersLargeTitles = true
+        self.navigationController?.presentationController?.delegate = self
+        
+        activeAccount = NCManageDatabase.shared.getAccountActive()
+        
+        // Cell
+        collectionView.register(UINib.init(nibName: "NCListCell", bundle: nil), forCellWithReuseIdentifier: "listCell")
+        collectionView.register(UINib.init(nibName: "NCGridCell", bundle: nil), forCellWithReuseIdentifier: "gridCell")
+        
+        // Header
+        collectionView.register(UINib.init(nibName: "NCSectionHeaderMenu", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "sectionHeaderMenu")
+        
+        // Footer
+        collectionView.register(UINib.init(nibName: "NCSectionFooter", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "sectionFooter")
+        collectionView.alwaysBounceVertical = true
+        
+        listLayout = NCListLayout()
+        gridLayout = NCGridLayout()
+        
+        // Add Refresh Control
+        collectionView.addSubview(refreshControl)
+        refreshControl.tintColor = NCBrandColor.shared.brandText
+        refreshControl.backgroundColor = NCBrandColor.shared.brandElement
+        refreshControl.addTarget(self, action: #selector(loadDatasource), for: .valueChanged)
+        
+        // Empty
+        emptyDataSet = NCEmptyDataSet.init(view: collectionView, offset: 0, delegate: self)
+
+        NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(reloadDataSource), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterReloadDataSource), object: nil)
+
+        changeTheming()
+    }
+    
+    override func viewWillAppear(_ animated: Bool) {
+        super.viewWillAppear(animated)
+        
+        self.navigationItem.title = titleCurrentFolder
+        
+        // set the serverUrl
+        if serverUrl == "" {
+            serverUrl = NCUtilityFileSystem.shared.getHomeServer(urlBase: activeAccount.urlBase, account: activeAccount.account)
+        }
+                
+        // get auto upload folder
+        autoUploadFileName = NCManageDatabase.shared.getAccountAutoUploadFileName()
+        autoUploadDirectory = NCManageDatabase.shared.getAccountAutoUploadDirectory(urlBase: activeAccount.urlBase, account: activeAccount.account)
+        
+        (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout,serverUrl: serverUrl)
+        gridLayout.itemForLine = CGFloat(itemForLine)
+        
+        if layout == NCGlobal.shared.layoutList {
+            collectionView.collectionViewLayout = listLayout
+        } else {
+            collectionView.collectionViewLayout = gridLayout
+        }
+        
+        loadDatasource(withLoadFolder: true)
+
+        shares = NCManageDatabase.shared.getTableShares(account: activeAccount.account, serverUrl: serverUrl)
+    }
+    
+    override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
+        super.viewWillTransition(to: size, with: coordinator)
+        
+        coordinator.animate(alongsideTransition: nil) { _ in
+            self.collectionView?.collectionViewLayout.invalidateLayout()
+        }
+    }
+    
+    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        super.traitCollectionDidChange(previousTraitCollection)
+        
+        if traitCollection.userInterfaceStyle == .dark {
+            
+        } else {
+            
+        }
+    }
+    
+    @objc func changeTheming() {
+        view.backgroundColor = NCBrandColor.shared.backgroundView
+        collectionView.backgroundColor = NCBrandColor.shared.backgroundView
+        collectionView.reloadData()
+        refreshControl.backgroundColor = NCBrandColor.shared.backgroundView
+    }
+    
+    func presentationControllerDidDismiss( _ presentationController: UIPresentationController) {
+        // Dismission
+    }
+    
+    // MARK: - Empty
+    
+    func emptyDataSetView(_ view: NCEmptyView) {
+                
+        if networkInProgress {
+            view.emptyImage.image = UIImage.init(named: "networkInProgress")?.image(color: .gray, size: UIScreen.main.bounds.width)
+            view.emptyTitle.text = NSLocalizedString("_request_in_progress_", comment: "")
+            view.emptyDescription.text = ""
+        } else {
+            view.emptyImage.image = UIImage.init(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width)
+            view.emptyTitle.text = NSLocalizedString("_files_no_files_", comment: "")
+            view.emptyDescription.text = ""
+        }
+    }
+    
+    // MARK: ACTION
+    
+    @IBAction func actionCancel(_ sender: UIBarButtonItem) {
+        self.dismiss(animated: true, completion: nil)
+    }
+    
+    func createFolderButtonPressed(_ sender: UIButton) {
+        
+        let alertController = UIAlertController(title: NSLocalizedString("_create_folder_", comment: ""), message:"", preferredStyle: .alert)
+        
+        alertController.addTextField { (textField) in
+            textField.autocapitalizationType = UITextAutocapitalizationType.words
+        }
+        
+        let actionSave = UIAlertAction(title: NSLocalizedString("_save_", comment: ""), style: .default) { (action:UIAlertAction) in
+            if let fileName = alertController.textFields?.first?.text  {
+                self.createFolder(with: fileName)
+            }
+        }
+        
+        let actionCancel = UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel) { (action:UIAlertAction) in
+            print("You've pressed cancel button")
+        }
+        
+        alertController.addAction(actionSave)
+        alertController.addAction(actionCancel)
+        
+        self.present(alertController, animated: true, completion:nil)
+    }
+    
+    // MARK: TAP EVENT
+    
+    func tapSwitchHeader(sender: Any) {
+        
+        if collectionView.collectionViewLayout == gridLayout {
+            // list layout
+            UIView.animate(withDuration: 0.0, animations: {
+                self.collectionView.collectionViewLayout.invalidateLayout()
+                self.collectionView.setCollectionViewLayout(self.listLayout, animated: false, completion: { (_) in
+                    self.collectionView.reloadData()
+                })
+            })
+            layout = NCGlobal.shared.layoutList
+        } else {
+            // grid layout
+            UIView.animate(withDuration: 0.0, animations: {
+                self.collectionView.collectionViewLayout.invalidateLayout()
+                self.collectionView.setCollectionViewLayout(self.gridLayout, animated: false, completion: { (_) in
+                    self.collectionView.reloadData()
+                })
+            })
+            layout = NCGlobal.shared.layoutGrid
+        }
+    }
+    
+    func tapOrderHeader(sender: Any) {
+        
+        let sortMenu = NCSortMenu()
+        sortMenu.toggleMenu(viewController: self, key: keyLayout, sortButton: sender as? UIButton, serverUrl: serverUrl)
+    }
+    
+    func tapMoreHeader(sender: Any) {
+    }
+    
+    func tapMoreListItem(with objectId: String, namedButtonMore: String, image: UIImage?, sender: Any) {
+    }
+    
+    func tapMoreGridItem(with objectId: String, namedButtonMore: String, image: UIImage?, sender: Any) {
+    }
+    
+    func tapShareListItem(with objectId: String, sender: Any) {
+    }
+    
+    func tapRichWorkspace(sender: Any) {
+    }
+    
+    func longPressListItem(with objectId: String, gestureRecognizer: UILongPressGestureRecognizer) {
+    }
+    
+    func longPressGridItem(with objectId: String, gestureRecognizer: UILongPressGestureRecognizer) {
+    }
+    
+    func longPressMoreListItem(with objectId: String, namedButtonMore: String, gestureRecognizer: UILongPressGestureRecognizer) {
+    }
+    
+    func longPressMoreGridItem(with objectId: String, namedButtonMore: String, gestureRecognizer: UILongPressGestureRecognizer) {
+    }
+}
+
+// MARK: - Collection View
+
+extension NCShareExtension: UICollectionViewDelegate {
+
+    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        
+        guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return }
+                
+        if metadata.directory {
+            
+            guard let serverUrlPush = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName) else { return }
+            guard let visualController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateViewController(withIdentifier: "NCSelect.storyboard") as? NCSelect else { return }
+
+            self.serverUrlPush = serverUrlPush
+            self.metadataTouch = metadata
+            
+            visualController.titleCurrentFolder = metadataTouch!.fileNameView
+            visualController.serverUrl = serverUrlPush
+                   
+            self.navigationController?.pushViewController(visualController, animated: true)
+            
+        }
+    }
+}
+
+extension NCShareExtension: UICollectionViewDataSource {
+
+    func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
+        
+        if kind == UICollectionView.elementKindSectionHeader {
+            
+            let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeaderMenu", for: indexPath) as! NCSectionHeaderMenu
+            
+            if collectionView.collectionViewLayout == gridLayout {
+                header.buttonSwitch.setImage(UIImage.init(named: "switchList")?.image(color: NCBrandColor.shared.icon, size: 25), for: .normal)
+            } else {
+                header.buttonSwitch.setImage(UIImage.init(named: "switchGrid")?.image(color: NCBrandColor.shared.icon, size: 25), for: .normal)
+            }
+            
+            header.delegate = self
+            header.setStatusButton(count: dataSource.metadatas.count)
+            header.setTitleSorted(datasourceTitleButton: titleButton)
+            header.viewRichWorkspaceHeightConstraint.constant = headerRichWorkspaceHeight
+            header.setRichWorkspaceText(richWorkspaceText: richWorkspaceText)
+            
+            return header
+            
+        } else {
+            
+            let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCSectionFooter
+            
+            let info = dataSource.getFilesInformation()
+            footer.setTitleLabel(directories: info.directories, files: info.files, size: info.size)
+            
+            return footer
+        }
+            
+    }
+    
+    func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        let numberOfItems = dataSource.numberOfItems()
+        emptyDataSet?.numberOfItemsInSection(numberOfItems, section:section)
+        return numberOfItems
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        
+        guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else {
+            if layout == NCGlobal.shared.layoutList {
+                return collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
+            } else {
+                return collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
+            }
+        }
+        
+        var tableShare: tableShare?
+        var isShare = false
+        var isMounted = false
+        
+        // Download preview
+        NCOperationQueue.shared.downloadThumbnail(metadata: metadata, urlBase: activeAccount.urlBase, view: collectionView, indexPath: indexPath)
+        
+        isShare = metadata.permissions.contains(NCGlobal.shared.permissionShared) && !metadataFolder.permissions.contains(NCGlobal.shared.permissionShared)
+        isMounted = metadata.permissions.contains(NCGlobal.shared.permissionMounted) && !metadataFolder.permissions.contains(NCGlobal.shared.permissionMounted)
+        
+        if dataSource.metadataShare[metadata.ocId] != nil {
+            tableShare = dataSource.metadataShare[metadata.ocId]
+        }
+        
+        // LAYOUT LIST
+        
+        if layout == NCGlobal.shared.layoutList {
+            
+            let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "listCell", for: indexPath) as! NCListCell
+            cell.delegate = self
+            
+            cell.objectId = metadata.ocId
+            cell.indexPath = indexPath
+            cell.labelTitle.text = metadata.fileNameView
+            cell.labelTitle.textColor = NCBrandColor.shared.textView
+            cell.separator.backgroundColor = NCBrandColor.shared.separator
+            
+            cell.imageSelect.image = nil
+            cell.imageStatus.image = nil
+            cell.imageLocal.image = nil
+            cell.imageFavorite.image = nil
+            cell.imageShared.image = nil
+            cell.imageMore.image = nil
+            
+            cell.imageItem.image = nil
+            cell.imageItem.backgroundColor = nil
+            
+            cell.progressView.progress = 0.0
+            
+            if metadata.directory {
+                
+                if metadata.e2eEncrypted {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
+                } else if isShare {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
+                } else if (tableShare != nil && tableShare?.shareType != 3) {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
+                } else if (tableShare != nil && tableShare?.shareType == 3) {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
+                } else if metadata.mountType == "group" {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
+                } else if isMounted {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
+                } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
+                } else {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
+                }
+                
+                cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date)
+                
+                let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
+                let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account, lockServerUrl))
+                
+                // Local image: offline
+                if tableDirectory != nil && tableDirectory!.offline {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
+                }
+                
+            } else {
+                
+                if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
+                    cell.imageItem.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
+                } else {
+                    if metadata.hasPreview {
+                        cell.imageItem.backgroundColor = .lightGray
+                    } else {
+                        if metadata.iconName.count > 0 {
+                            cell.imageItem.image = UIImage.init(named: metadata.iconName)
+                        } else {
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
+                        }
+                    }
+                }
+                
+                cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
+                
+                // image local
+                if dataSource.metadataOffLine.contains(metadata.ocId) {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
+                } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
+                }
+            }
+            
+            // image Favorite
+            if metadata.favorite {
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
+            }
+            
+            // Share image
+            if (isShare) {
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
+            } else if (tableShare != nil && tableShare?.shareType == 3) {
+                cell.imageShared.image = NCBrandColor.cacheImages.shareByLink
+            } else if (tableShare != nil && tableShare?.shareType != 3) {
+                cell.imageShared.image = NCBrandColor.cacheImages.shared
+            } else {
+                cell.imageShared.image = NCBrandColor.cacheImages.canShare
+            }
+            if metadata.ownerId.count > 0 && metadata.ownerId != activeAccount.userId {
+                let fileNameUser = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(activeAccount.user, urlBase: activeAccount.urlBase)) + "-" + metadata.ownerId + ".png"
+                if FileManager.default.fileExists(atPath: fileNameUser) {
+                    cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)
+                } else {
+                    NCCommunication.shared.downloadAvatar(userId: metadata.ownerId, fileNameLocalPath: fileNameUser, size: NCGlobal.shared.avatarSize) { (account, data, errorCode, errorMessage) in
+                        if errorCode == 0 && account == self.activeAccount.account {
+                            cell.imageShared.image = UIImage(contentsOfFile: fileNameUser)
+                        }
+                    }
+                }
+            }
+            
+            cell.imageSelect.isHidden = true
+            cell.backgroundView = nil
+            cell.hideButtonMore(true)
+            cell.hideButtonShare(true)
+            cell.selectMode(false)
+    
+            // Live Photo
+            if metadata.livePhoto {
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
+            }
+            
+            // Remove last separator
+            if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 {
+                cell.separator.isHidden = true
+            } else {
+                cell.separator.isHidden = false
+            }
+            
+            return cell
+        }
+        
+        // LAYOUT GRID
+        
+        if layout == NCGlobal.shared.layoutGrid {
+            
+            let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
+            cell.delegate = self
+            
+            cell.objectId = metadata.ocId
+            cell.indexPath = indexPath
+            cell.labelTitle.text = metadata.fileNameView
+            cell.labelTitle.textColor = NCBrandColor.shared.textView
+            
+            cell.imageSelect.image = nil
+            cell.imageStatus.image = nil
+            cell.imageLocal.image = nil
+            cell.imageFavorite.image = nil
+            
+            cell.imageItem.image = nil
+            cell.imageItem.backgroundColor = nil
+            
+            cell.progressView.progress = 0.0
+
+            if metadata.directory {
+                
+                if metadata.e2eEncrypted {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderEncrypted
+                } else if isShare {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
+                } else if (tableShare != nil && tableShare!.shareType != 3) {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderSharedWithMe
+                } else if (tableShare != nil && tableShare!.shareType == 3) {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderPublic
+                } else if metadata.mountType == "group" {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderGroup
+                } else if isMounted {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderExternal
+                } else if metadata.fileName == autoUploadFileName && metadata.serverUrl == autoUploadDirectory {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folderAutomaticUpload
+                } else {
+                    cell.imageItem.image = NCBrandColor.cacheImages.folder
+                }
+    
+                let lockServerUrl = CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!
+                let tableDirectory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account, lockServerUrl))
+                                
+                // Local image: offline
+                if tableDirectory != nil && tableDirectory!.offline {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
+                }
+                
+            } else {
+                
+                if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)) {
+                    cell.imageItem.image =  UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
+                } else {
+                    if metadata.hasPreview {
+                        cell.imageItem.backgroundColor = .lightGray
+                    } else {
+                        if metadata.iconName.count > 0 {
+                            cell.imageItem.image = UIImage.init(named: metadata.iconName)
+                        } else {
+                            cell.imageItem.image = NCBrandColor.cacheImages.file
+                        }
+                    }
+                }
+                
+                // image Local
+                if dataSource.metadataOffLine.contains(metadata.ocId) {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.offlineFlag
+                } else if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
+                    cell.imageLocal.image = NCBrandColor.cacheImages.local
+                }
+            }
+            
+            // image Favorite
+            if metadata.favorite {
+                cell.imageFavorite.image = NCBrandColor.cacheImages.favorite
+            }
+            
+            cell.imageSelect.isHidden = true
+            cell.backgroundView = nil
+            cell.hideButtonMore(true)
+
+            // Live Photo
+            if metadata.livePhoto {
+                cell.imageStatus.image = NCBrandColor.cacheImages.livePhoto
+            }
+            
+            return cell
+        }
+        
+        return collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridCell
+    }
+}
+
+extension NCShareExtension: UICollectionViewDelegateFlowLayout {
+
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
+        
+        headerRichWorkspaceHeight = 0
+        
+        if let richWorkspaceText = richWorkspaceText {
+            let trimmed = richWorkspaceText.trimmingCharacters(in: .whitespaces)
+            if trimmed.count > 0 {
+                headerRichWorkspaceHeight = UIScreen.main.bounds.size.height / 4
+            }
+        }
+        
+        return CGSize(width: collectionView.frame.width, height: headerHeight + headerRichWorkspaceHeight)
+    }
+    
+    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
+        return CGSize(width: collectionView.frame.width, height: footerHeight)
+    }
+}
+
+// MARK: - NC API & Algorithm
+
+extension NCShareExtension {
+
+    @objc func reloadDataSource() {
+        loadDatasource(withLoadFolder: false)
+    }
+    
+    @objc func loadDatasource(withLoadFolder: Bool) {
+                
+        (layout, sort, ascending, groupBy, directoryOnTop, titleButton, itemForLine) = NCUtility.shared.getLayoutForView(key: keyLayout, serverUrl: serverUrl)
+                
+        let metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account, serverUrl))
+        self.dataSource = NCDataSource.init(metadatasSource: metadatasSource, sort: sort, ascending: ascending, directoryOnTop: directoryOnTop, favoriteOnTop: true, filterLivePhoto: true)
+        
+        if withLoadFolder {
+            loadFolder()
+        } else {
+            self.refreshControl.endRefreshing()
+        }
+        
+        let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount.account,serverUrl))
+        richWorkspaceText = directory?.richWorkspace
+        
+        collectionView.reloadData()
+    }
+    
+    func createFolder(with fileName: String) {
+        
+        NCNetworking.shared.createFolder(fileName: fileName, serverUrl: serverUrl, account: activeAccount.account, urlBase: activeAccount.urlBase) { (errorCode, errorDescription) in
+            
+            if errorCode == 0 {
+                self.loadDatasource(withLoadFolder: true)
+            }  else {
+                NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
+            }
+        }
+    }
+    
+    func loadFolder() {
+        
+        networkInProgress = true
+        collectionView.reloadData()
+        
+        NCNetworking.shared.readFolder(serverUrl: serverUrl, account: activeAccount.account) { (_, _, _, _, _, errorCode, errorDescription) in
+            if errorCode != 0 {
+                NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
+            }
+            self.networkInProgress = false
+            self.loadDatasource(withLoadFolder: false)
+        }
+    }
+}

+ 1 - 1
Share/Share-Bridging-Header.h

@@ -2,5 +2,5 @@
 //  Use this file to import your target's public headers that you would like to expose to Swift.
 //
 
-#import "ShareViewController.h"
 #import "NCEndToEndEncryption.h"
+#import "CCUtility.h"

+ 0 - 42
Share/ShareViewController.h

@@ -1,42 +0,0 @@
-//
-//  ShareViewController.h
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 26/01/16.
-//  Copyright (c) 2016 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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 "CCCellShareExt.h"
-#import "NCSelectDestination.h"
-
-@interface ShareViewController : UIViewController <UITableViewDelegate, NCSelectDestinationDelegate, UITextFieldDelegate>
-
-@property (nonatomic, strong) NSString *account;
-@property (nonatomic, strong) NSString *urlBase;
-@property (nonatomic, strong) NSString *serverUrl;
-@property (nonatomic, retain) NSMutableArray *filesName;
-
-@property (nonatomic, weak) IBOutlet UITableView *shareTable;
-@property (nonatomic, weak) IBOutlet UIBarButtonItem *destinyFolderButton;
-@property (nonatomic, weak) IBOutlet NSLayoutConstraint *constraintTopTableView;
-@property (nonatomic, weak) IBOutlet UIToolbar *toolBar;
-
-- (void)closeShareViewController;
-- (void)reloadData:(NSArray *)files;
-
-@end

+ 0 - 462
Share/ShareViewController.m

@@ -1,462 +0,0 @@
-//
-//  ShareViewController.m
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 26/01/16.
-//  Copyright (c) 2016 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  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 "ShareViewController.h"
-#import "NCBridgeSwift.h"
-
-@import MobileCoreServices;
-
-@interface ShareViewController () <NCSelectDestinationDelegate>
-{
-    NSURL *dirGroup;
-    NSUInteger totalSize;
-    
-    NSExtensionItem *inputItem;
-    
-    UIColor *barTintColor;
-    UIColor *tintColor;
-    
-    NSString *fileNameOriginal;
-    
-    UIBarButtonItem *rightButtonUpload, *leftButtonCancel;
-}
-@end
-
-@implementation ShareViewController
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== View =====
-#pragma --------------------------------------------------------------------------------------------
-
--(void)viewDidLoad
-{
-    tableAccount *tableAccount = [[NCManageDatabase shared] getAccountActive];
-    
-    if (tableAccount == nil) {
-        
-        // close now
-        [self performSelector:@selector(closeShareViewController) withObject:nil afterDelay:0.1];
-        
-        return;
-        
-    } else {
-        
-        NSInteger serverVersionMajor = [[NCManageDatabase shared] getCapabilitiesServerIntWithAccount:tableAccount.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
-        NSString *webDav = [[NCUtilityFileSystem shared] getWebDAVWithAccount:tableAccount.account];
-        
-        // LOG
-        NSInteger levelLog = [CCUtility getLogLevel];
-        [[NCCommunicationCommon shared] setLevelLog:levelLog];
-        
-        NSString *pathDirectoryGroup = [[CCUtility getDirectoryGroup] path];
-        [[NCCommunicationCommon shared] setPathLog: pathDirectoryGroup];
-                
-        NSString *versionNextcloudiOS = [NSString stringWithFormat:[NCBrandOptions shared].textCopyrightNextcloudiOS, NCUtility.shared.getVersionApp];
-        [[NCCommunicationCommon shared] writeLog:[NSString stringWithFormat:@"Start session with level %lu %@", (unsigned long)levelLog, versionNextcloudiOS]];
-        
-        // Networking
-        [[NCCommunicationCommon shared] setupWithAccount:tableAccount.account user:tableAccount.user userId:tableAccount.userId password:[CCUtility getPassword:tableAccount.account] urlBase:tableAccount.urlBase userAgent:[CCUtility getUserAgent] webDav:webDav dav:nil nextcloudVersion:serverVersionMajor delegate:[NCNetworking shared]];
-       
-        _account = tableAccount.account;
-        _urlBase = tableAccount.urlBase;
-        
-        if ([_account isEqualToString:[CCUtility getAccountExt]]) {
-            
-            // load
-            
-            _serverUrl = [CCUtility getServerUrlExt];
-            
-            _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), [CCUtility getTitleServerUrlExt]];
-            
-        } else {
-            
-            // Default settings
-            
-            [CCUtility setAccountExt:self.account];
-
-            _serverUrl  = [[NCUtilityFileSystem shared] getHomeServerWithUrlBase:tableAccount.urlBase account:tableAccount.account];
-            [CCUtility setServerUrlExt:_serverUrl];
-
-            _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
-            [CCUtility setTitleServerUrlExt:NSLocalizedString(@"_home_", nil)];
-        }
-    }
-    
-    self.filesName = [[NSMutableArray alloc] init];
-        
-    [self.shareTable registerNib:[UINib nibWithNibName:@"CCCellShareExt" bundle:nil] forCellReuseIdentifier:@"ShareExtCell"];
-    
-    [self navigationBarToolBar];
-    
-    [self loadDataSwift];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-        
-    self.view.backgroundColor = NCBrandColor.shared.backgroundView;
-    self.shareTable.backgroundColor = NCBrandColor.shared.backgroundView;
-}
-
-- (void)closeShareViewController
-{
-    [self.extensionContext completeRequestReturningItems:self.extensionContext.inputItems completionHandler:nil];
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-    NSLog(@"[LOG] bye bye, Nextcloud Share Extension!");
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark == TextField Delegate ==
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)textFieldDidBeginEditing:(UITextField *)textField
-{
-    rightButtonUpload.enabled = false;
-    fileNameOriginal = textField.text;
-}
-
-- (void)textFieldDidEndEditing:(UITextField *)textField
-{
-    rightButtonUpload.enabled = true;
-    NSInteger index = [self.filesName indexOfObject:fileNameOriginal];
-    if (index != NSNotFound) {
-        self.filesName[index] = textField.text;
-    }
-}
-
-- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
-{
-    NSError *error;
-    
-    if ([string isEqualToString:@"\n"]) {
-        
-        //NSString *fileName = [textField.text stringByDeletingPathExtension];
-        NSString *ext = [textField.text pathExtension];
-
-        if (![ext isEqualToString:@""]) {
-            NSString *fileNameAtPath = [NSTemporaryDirectory() stringByAppendingString:fileNameOriginal];
-            NSString *fileNameToPath = [NSTemporaryDirectory() stringByAppendingString:textField.text];
-            
-            [[NSFileManager defaultManager] moveItemAtPath:fileNameAtPath toPath:fileNameToPath error:&error];
-            
-            if (error != nil) {
-                textField.text = fileNameOriginal;
-            }
-        } else {
-            textField.text = fileNameOriginal;
-        }
-        
-        [textField endEditing:true];
-        return false;
-    }
-    
-    return true;
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark == Action ==
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)navigationBarToolBar
-{
-    // Theming
-    if ([NCBrandOptions shared].use_themingColor) {
-        NSString *themingColor = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:self.account elements:NCElementsJSON.shared.capabilitiesThemingColor];
-        NSString *themingColorElement = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:self.account elements:NCElementsJSON.shared.capabilitiesThemingColorElement];
-        NSString *themingColorText = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:self.account elements:NCElementsJSON.shared.capabilitiesThemingColorText];
-        [NCBrandColor.shared settingBrandColor:themingColor themingColorElement:themingColorElement themingColorText:themingColorText];
-    }
-    
-    self.navigationController.navigationBar.barTintColor = NCBrandColor.shared.brand;
-    self.navigationController.navigationBar.tintColor = NCBrandColor.shared.brandText;
-    
-    self.toolBar.barTintColor = NCBrandColor.shared.tabBar;
-    self.toolBar.tintColor = [UIColor grayColor];
-    
-    // Upload
-    rightButtonUpload = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_save_", nil) style:UIBarButtonItemStylePlain target:self action:@selector(selectPost)];
-    
-    // Cancel
-    leftButtonCancel = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIBarButtonItemStylePlain target:self action:@selector(cancelPost)];
-    
-    // Title
-    [self.navigationController.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:self.navigationController.navigationBar.tintColor}];
-    
-    self.navigationItem.title = [NCBrandOptions shared].brand;
-    self.navigationItem.leftBarButtonItem = leftButtonCancel;
-    self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:rightButtonUpload, nil];
-    self.navigationItem.hidesBackButton = YES;
-}
-
-- (void)moveServerUrlTo:(NSString *)serverUrlTo title:(NSString *)title type:(NSString *)type
-{
-    // DENIED e2e
-    if ([CCUtility isFolderEncrypted:serverUrlTo e2eEncrypted:false account:self.account urlBase:self.urlBase]) {
-        return;
-    }
-    
-    if (serverUrlTo)
-        _serverUrl = serverUrlTo;
-    
-    if (title) {
-        self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), title];
-        [CCUtility setTitleServerUrlExt:title];
-    } else {
-        self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
-        [CCUtility setTitleServerUrlExt:NSLocalizedString(@"_home_", nil)];
-    }
-    
-    [CCUtility setAccountExt:self.account];
-    [CCUtility setServerUrlExt:_serverUrl];
-}
-
-- (IBAction)destinyFolderButtonTapped:(UIBarButtonItem *)sender
-{
-    UINavigationController* navigationController = [[UIStoryboard storyboardWithName:@"NCSelectDestination" bundle:nil] instantiateInitialViewController];
-    
-    NCSelectDestination *viewController = (NCSelectDestination *)navigationController.topViewController;
-    
-    viewController.delegate = self;
-    viewController.move.title = NSLocalizedString(@"_select_", nil);
-    viewController.tintColor = tintColor;
-    viewController.barTintColor = barTintColor;
-    viewController.tintColorTitle = tintColor;
-    // E2EE
-    viewController.includeDirectoryE2EEncryption = NO;
-
-    [navigationController setModalPresentationStyle:UIModalPresentationFormSheet];
-    [self presentViewController:navigationController animated:YES completion:nil];
-}
-
-- (void)selectPost
-{
-    if ([self.filesName count] > 0) {
-    
-        
-        
-        
-        
-        [[NCUtility shared] startActivityIndicatorWithBackgroundView:nil blurEffect:true bottom:0 style: UIActivityIndicatorViewStyleWhiteLarge];
-        
-        NSString *fileName = [self.filesName objectAtIndex:0];
-        NSString *fileNameLocal = [NSTemporaryDirectory() stringByAppendingString:fileName];
-
-        // CONVERSION -->
-        
-        if ([fileName.pathExtension.uppercaseString isEqualToString:@"HEIC"] && [CCUtility getFormatCompatibility]) {
-            UIImage *image = [UIImage imageWithContentsOfFile:fileNameLocal];
-            if (image != nil) {
-                fileName = fileName.stringByDeletingPathExtension;
-                fileName = [NSString stringWithFormat:@"%@.jpg", fileName];
-                [self.filesName replaceObjectAtIndex:0 withObject:fileName];
-                fileNameLocal = [NSTemporaryDirectory() stringByAppendingString:fileName];
-                [UIImageJPEGRepresentation(image, 1.0) writeToFile:fileNameLocal atomically:YES];
-                
-                [self.shareTable reloadData];
-            }
-        }
-        
-        // <--
-        
-        NSString *fileNameForUpload = [[NCUtilityFileSystem shared] createFileName:fileName serverUrl:self.serverUrl account:self.account];
-        NSString *fileNameServer = [NSString stringWithFormat:@"%@/%@", self.serverUrl, fileNameForUpload];
-        
-        [[NCCommunication shared] uploadWithServerUrlFileName:fileNameServer fileNameLocalPath:fileNameLocal dateCreationFile:nil dateModificationFile:nil customUserAgent:nil addCustomHeaders:nil taskHandler:^(NSURLSessionTask *task) {
-                        
-        } progressHandler:^(NSProgress *progress) {
-            
-            
-        } completionHandler:^(NSString *account, NSString *ocId, NSString *etag, NSDate *date, int64_t size, NSDictionary *allHeaderFields, NSInteger errorCode, NSString *errorDescription) {
-            
-            [[NCUtility shared] stopActivityIndicator];
-            [self.filesName removeObject:fileName];
-           
-            if (errorCode == 0) {
-               
-                [CCUtility copyFileAtPath:fileNameLocal toPath:[CCUtility getDirectoryProviderStorageOcId:ocId fileNameView:fileNameForUpload]];
-               
-                tableMetadata *metadata = [[NCManageDatabase shared] createMetadataWithAccount:self.account fileName:fileNameForUpload fileNameView:fileNameForUpload ocId:ocId serverUrl:self.serverUrl urlBase:self.urlBase url:@"" contentType:@"" livePhoto:false chunk:false];
-                               
-                metadata.date = date;
-                metadata.etag = etag;
-                metadata.serverUrl = self.serverUrl;
-                metadata.size = size;
-                
-                [[NCManageDatabase shared] addMetadata:metadata];
-                [[NCManageDatabase shared] addLocalFileWithMetadata:metadata];
-               
-                [self.shareTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
-                [self performSelector:@selector(selectPost) withObject:nil];
-               
-            } else {
-               
-                UIAlertController * alert= [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_", nil) message: errorDescription preferredStyle:UIAlertControllerStyleAlert];
-                UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
-                                                          handler:^(UIAlertAction * action) {
-                   [alert dismissViewControllerAnimated:YES completion:nil];
-                   [self closeShareViewController];
-                }];
-                [alert addAction:ok];
-                [self presentViewController:alert animated:YES completion:nil];
-            }
-        }];
-        
-    } else {
-        
-        [self closeShareViewController];
-    }
-}
-
-- (void)cancelPost
-{
-    // rimuoviamo i file+ico
-    for (NSString *fileName in self.filesName) {
-        
-        [[NSFileManager defaultManager] removeItemAtPath:[NSTemporaryDirectory() stringByAppendingString:fileName] error:nil];
-    }
-    
-    [self closeShareViewController];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Swipe Table DELETE -> menu =====
-#pragma--------------------------------------------------------------------------------------------
-
-- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    [self setEditing:NO animated:YES];
-    
-    NSString *fileName = [self.filesName objectAtIndex:indexPath.row];
-    
-    [[NSFileManager defaultManager] removeItemAtPath:[NSTemporaryDirectory() stringByAppendingString:fileName] error:nil];
-
-    [self.filesName removeObjectAtIndex:indexPath.row];
-    
-    if ([self.filesName count] == 0) [self closeShareViewController];
-    else [self.shareTable performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark == Table ==
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)loadDataSwift
-{
-    CCloadItemData *loadItem = [[CCloadItemData alloc] init];
-    
-    [loadItem loadFiles:NSTemporaryDirectory() extensionContext:self.extensionContext vc:self];
-}
-
-- (void)reloadData:(NSArray *)files
-{
-    totalSize = 0;
-
-    for (NSString *file in files) {
-        
-        NSUInteger fileSize = (NSInteger)[[[NSFileManager defaultManager] attributesOfItemAtPath:[NSTemporaryDirectory() stringByAppendingString:file] error:nil] fileSize];
-        totalSize += fileSize;
-    }
-    
-    if (totalSize > 0) {
-        
-        self.filesName = [[NSMutableArray alloc] initWithArray:files];
-        [self.shareTable reloadData];
-        
-    } else {
-        
-        [self closeShareViewController];
-    }
-}
-
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    return 80;
-}
-
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    return [self.filesName count];
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    NSString *fileName = [self.filesName objectAtIndex:indexPath.row];
-    UIImage *image = nil;
-    
-    CCCellShareExt *cell = (CCCellShareExt *)[tableView dequeueReusableCellWithIdentifier:@"ShareExtCell" forIndexPath:indexPath];
-
-    CFStringRef fileExtension = (__bridge CFStringRef)[fileName pathExtension];
-    CFStringRef fileUTI = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, fileExtension, NULL);
-
-    if (UTTypeConformsTo(fileUTI, kUTTypeZipArchive) && [(__bridge NSString *)fileUTI containsString:@"org.openxmlformats"] == NO) image = [UIImage imageNamed:@"file_compress"];
-    else if (UTTypeConformsTo(fileUTI, kUTTypeAudio)) image = [UIImage imageNamed:@"file_audio"];
-    else if (UTTypeConformsTo(fileUTI, kUTTypeMovie)) image = [UIImage imageNamed:@"file_movie"];
-    else if (UTTypeConformsTo(fileUTI, kUTTypeImage)) {
-        image = [UIImage imageWithContentsOfFile:[NSTemporaryDirectory() stringByAppendingString:fileName]];
-        if (image) {
-            image = [image resizeImageWithSize:CGSizeMake(100, 100) isAspectRation:true];
-        } else {
-            image = [UIImage imageNamed:@"file_photo"];
-        }
-    }
-    else if (UTTypeConformsTo(fileUTI, kUTTypeContent)) {
-        
-        image = [UIImage imageNamed:@"document"];
-        
-        NSString *typeFile = (__bridge NSString *)fileUTI;
-        
-        if ([typeFile isEqualToString:@"com.adobe.pdf"]) image = [UIImage imageNamed:@"file_pdf"];
-        if ([typeFile isEqualToString:@"org.openxmlformats.spreadsheetml.sheet"]) image = [UIImage imageNamed:@"file_xls"];
-        if ([typeFile isEqualToString:@"public.plain-text"]) image = [UIImage imageNamed:@"file_txt"];
-    }
-    else image = [UIImage imageNamed:@"file"];
-    
-    NSUInteger fileSize = (NSInteger)[[[NSFileManager defaultManager] attributesOfItemAtPath:[NSTemporaryDirectory() stringByAppendingString:fileName] error:nil] fileSize];
-    
-    cell.fileImageView.image = image;
-
-    cell.fileName.text = fileName;
-    cell.fileName.textColor = NCBrandColor.shared.textView;
-    cell.fileName.delegate = self;
-    
-    cell.info.text = [CCUtility transformedSize:fileSize];
-    cell.info.textColor = NCBrandColor.shared.textView;
-    
-    return cell;
-}
-
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    [tableView deselectRowAtIndexPath:indexPath animated:YES];
-}
-
-@end

+ 1 - 1
iOSClient/EmptyView/NCEmptyDataSet.swift

@@ -6,7 +6,7 @@
 //  Copyright © 2020 Marino Faggiana. All rights reserved.
 //
 
-import Foundation
+import UIKit
 
 @objc public protocol NCEmptyDataSetDelegate {
     @objc optional func emptyDataSetView(_ view: NCEmptyView)

+ 1 - 1
iOSClient/Extensions/UIColor+Extensions.swift

@@ -21,7 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-import Foundation
+import UIKit
 
 extension UIColor {
     

+ 1 - 1
iOSClient/Extensions/UIImage+Extensions.swift

@@ -21,7 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-import Foundation
+import UIKit
 import Accelerate
 
 extension UIImage {

+ 1 - 1
iOSClient/Main/Section Header Footer/NCSectionHeaderFooter.swift

@@ -21,7 +21,7 @@
 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 //
 
-import Foundation
+import UIKit
 import MarkdownKit
 
 class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate {