diff --git a/File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h b/File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h deleted file mode 100644 index 50a48beebe..0000000000 --- a/File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// PickerFileProvider-Bridging-Header.h -// Nextcloud -// -// Created by Marino Faggiana on 24/05/17. -// Copyright © 2017 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// - -#import "CCUtility.h" diff --git a/File Provider Extension/FileProviderExtension-Bridging-Header.h b/File Provider Extension/FileProviderExtension-Bridging-Header.h deleted file mode 100644 index 50a48beebe..0000000000 --- a/File Provider Extension/FileProviderExtension-Bridging-Header.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// PickerFileProvider-Bridging-Header.h -// Nextcloud -// -// Created by Marino Faggiana on 24/05/17. -// Copyright © 2017 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// - -#import "CCUtility.h" diff --git a/File Provider Extension/FileProviderExtension.swift b/File Provider Extension/FileProviderExtension.swift index 3e3c9bf23f..bd876d60f3 100644 --- a/File Provider Extension/FileProviderExtension.swift +++ b/File Provider Extension/FileProviderExtension.swift @@ -22,6 +22,7 @@ // import UIKit +import UniformTypeIdentifiers import FileProvider import NextcloudKit import Alamofire diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 69b9fed843..4521fa904a 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -211,7 +211,6 @@ F7134186259747BA00768D21 /* NCPushNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = F7134185259747BA00768D21 /* NCPushNotification.m */; }; F713FF002472764100214AF6 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F713FEFF2472764100214AF6 /* UIImage+animatedGIF.m */; }; F7145610296433C80038D028 /* NCDocumentCamera.swift in Sources */ = {isa = PBXBuildFile; fileRef = F714560F296433C80038D028 /* NCDocumentCamera.swift */; }; - F71459D21D12E3B700CAFEEC /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F7145A231D12E3B700CAFEEC /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; }; F714803B262EBE3900693E51 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F714803A262EBE3900693E51 /* MainInterface.storyboard */; }; F7148041262EBE4000693E51 /* NCShareExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7148040262EBE4000693E51 /* NCShareExtension.swift */; }; @@ -432,7 +431,6 @@ F7490E8729882CA8009DCE94 /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; }; F7490E8929882CC8009DCE94 /* SwiftEntryKit in Frameworks */ = {isa = PBXBuildFile; productRef = F7490E8829882CC8009DCE94 /* SwiftEntryKit */; }; F7490E8B29882CE4009DCE94 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F7490E8A29882CE4009DCE94 /* NextcloudKit */; }; - F7490E8C29882D02009DCE94 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F7490E8D29882F5B009DCE94 /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; }; F7490E8E2988334A009DCE94 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; }; F749B64A297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */ = {isa = PBXBuildFile; fileRef = F749B649297B0CBB00087535 /* NCManageDatabase+Share.swift */; }; @@ -600,7 +598,6 @@ F77444F622281649000D5EB0 /* NCGridMediaCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F77444F422281649000D5EB0 /* NCGridMediaCell.xib */; }; F77444F8222816D5000D5EB0 /* NCPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */; }; F77A697D250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */; }; - F77B0DF51D118A16002130FE /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F77B0F631D118A16002130FE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; }; F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; }; F77BB746289984CA0090FC19 /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77BB745289984CA0090FC19 /* UIViewController+Extension.swift */; }; @@ -643,13 +640,10 @@ F783030628B4C51E00B84583 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; F783030728B4C52800B84583 /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; }; F783030D28B4C59A00B84583 /* SwiftEntryKit in Frameworks */ = {isa = PBXBuildFile; productRef = F783030C28B4C59A00B84583 /* SwiftEntryKit */; }; - F783031228B4C8EC00B84583 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F783034428B5142B00B84583 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F783034328B5142B00B84583 /* NextcloudKit */; }; F785EE9D246196DF00B3F945 /* NCNetworkingE2EE.swift in Sources */ = {isa = PBXBuildFile; fileRef = F785EE9C246196DF00B3F945 /* NCNetworkingE2EE.swift */; }; F785EE9E2461A09900B3F945 /* NCNetworking.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75A9EE523796C6F0044CFCE /* NCNetworking.swift */; }; F785EEA42461A4A600B3F945 /* NCUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70BFC7320E0FA7C00C67599 /* NCUtility.swift */; }; - F785EEA52461A4CF00B3F945 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; - F785EEA62461A4FB00B3F945 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F7864ACC2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; }; F7864ACD2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; }; F7864ACE2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7864ACB2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift */; }; @@ -747,7 +741,6 @@ F7A8D74228F18261008BBE1C /* NCUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70BFC7320E0FA7C00C67599 /* NCUtility.swift */; }; F7A8D74328F1826F008BBE1C /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; }; F7A8D74428F1827B008BBE1C /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; }; - F7A8D74528F1828E008BBE1C /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; }; F7AC1CB028AB94490032D99F /* Array+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AC1CAF28AB94490032D99F /* Array+Extension.swift */; }; F7AC934A296193050002BC0F /* Reasons to use Nextcloud.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F7AC9349296193050002BC0F /* Reasons to use Nextcloud.pdf */; }; F7AE00F5230D5F9E007ACF8A /* NCLoginWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F4230D5F9E007ACF8A /* NCLoginWeb.swift */; }; @@ -1176,15 +1169,12 @@ F704B5E42430AA8000632F5F /* NCCreateFormUploadConflict.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadConflict.swift; sourceTree = ""; }; F704B5E62430C06700632F5F /* NCCreateFormUploadConflictCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NCCreateFormUploadConflictCell.xib; sourceTree = ""; }; F704B5E82430C0B800632F5F /* NCCreateFormUploadConflictCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCreateFormUploadConflictCell.swift; sourceTree = ""; }; - F7053E3C1C639DF500741EA5 /* CCUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCUtility.h; sourceTree = ""; }; - F7053E3D1C639DF500741EA5 /* CCUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCUtility.m; sourceTree = ""; }; F7063DEC2199E55F003F38DA /* SVGKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SVGKit.framework; path = Carthage/Build/iOS/SVGKit.framework; sourceTree = ""; }; F7063DEE2199E568003F38DA /* CocoaLumberjack.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjack.framework; path = Carthage/Build/iOS/CocoaLumberjack.framework; sourceTree = ""; }; F7063DF02199E56E003F38DA /* CocoaLumberjackSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjackSwift.framework; path = Carthage/Build/iOS/CocoaLumberjackSwift.framework; sourceTree = ""; }; F70716E32987F81500E72C1D /* File Provider Extension UI.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "File Provider Extension UI.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; F70716E52987F81500E72C1D /* DocumentActionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentActionViewController.swift; sourceTree = ""; }; F70716E82987F81500E72C1D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; - F70716F52987FA2F00E72C1D /* FileProviderExtensionUI-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FileProviderExtensionUI-Bridging-Header.h"; sourceTree = ""; }; F70753EA2542A99800972D44 /* NCViewerMediaPage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerMediaPage.swift; sourceTree = ""; }; F70753F02542A9A200972D44 /* NCViewerMedia.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerMedia.swift; sourceTree = ""; }; F70753F62542A9C000972D44 /* NCViewerMediaPage.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerMediaPage.storyboard; sourceTree = ""; }; @@ -1309,7 +1299,6 @@ F73F537E1E929C8500F8678D /* NCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMore.swift; sourceTree = ""; }; F741C2232B6B9FD600E849BB /* NCMediaSelectTabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMediaSelectTabBar.swift; sourceTree = ""; }; F7421EAE2294044B00C4B7C1 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - F7434B5F20E2440600417916 /* FileProviderExtension-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "FileProviderExtension-Bridging-Header.h"; sourceTree = ""; }; F745B250222D871800346520 /* QRCodeReader.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QRCodeReader.framework; path = Carthage/Build/iOS/QRCodeReader.framework; sourceTree = ""; }; F745B252222D88AE00346520 /* NCLoginQRCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginQRCode.swift; sourceTree = ""; }; F749B649297B0CBB00087535 /* NCManageDatabase+Share.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Share.swift"; sourceTree = ""; }; @@ -2060,7 +2049,6 @@ F70716E42987F81500E72C1D /* File Provider Extension UI */ = { isa = PBXGroup; children = ( - F70716F52987FA2F00E72C1D /* FileProviderExtensionUI-Bridging-Header.h */, F70716E52987F81500E72C1D /* DocumentActionViewController.swift */, F70716E72987F81500E72C1D /* MainInterface.storyboard */, ); @@ -2453,7 +2441,6 @@ F771E3F220E239A600AFB62D /* FileProviderData.swift */, F76673EC22C901F5007ED366 /* FileProviderDomain.swift */, F771E3D620E2392D00AFB62D /* FileProviderEnumerator.swift */, - F7434B5F20E2440600417916 /* FileProviderExtension-Bridging-Header.h */, F771E3D220E2392D00AFB62D /* FileProviderExtension.swift */, F771E3F420E239B400AFB62D /* FileProviderExtension+Actions.swift */, F771E3F520E239B400AFB62D /* FileProviderExtension+Thumbnail.swift */, @@ -2691,8 +2678,6 @@ isa = PBXGroup; children = ( F702F2FC25EE5D2C008F8E80 /* NYMnemonic */, - F7053E3C1C639DF500741EA5 /* CCUtility.h */, - F7053E3D1C639DF500741EA5 /* CCUtility.m */, F76D364528A4F8BF00214537 /* NCActivityIndicator.swift */, F733598025C1C188002ABA72 /* NCAskAuthorization.swift */, F77C97382953131000FDDD09 /* NCCameraRoll.swift */, @@ -3789,7 +3774,6 @@ files = ( F73EF7BD2B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift in Sources */, F73EF7C52B02250B0087E6E9 /* NCManageDatabase+GPS.swift in Sources */, - F785EEA52461A4CF00B3F945 /* CCUtility.m in Sources */, 2C1D5D7923E2DE9100334ABB /* NCBrand.swift in Sources */, F770768A263A8A2500A1BA94 /* NCUtilityFileSystem.swift in Sources */, F76D364928A4F8BF00214537 /* NCActivityIndicator.swift in Sources */, @@ -3900,7 +3884,6 @@ F76882382C0DD22F001CF441 /* NCKeychain.swift in Sources */, F7C9B9222B582F550064EA91 /* NCManageDatabase+SecurityGuard.swift in Sources */, F7490E8529882C8C009DCE94 /* NCManageDatabase+Video.swift in Sources */, - F7490E8C29882D02009DCE94 /* CCUtility.m in Sources */, F7490E7729882C10009DCE94 /* UIColor+Extension.swift in Sources */, F70716E62987F81500E72C1D /* DocumentActionViewController.swift in Sources */, F359D86C2A7D03420023F405 /* NCUtility+Exif.swift in Sources */, @@ -3988,7 +3971,6 @@ F7EDE4D1262D7B8400414FE6 /* NCDataSource.swift in Sources */, F73EF7BA2B0224AB0087E6E9 /* NCManageDatabase+ExternalSites.swift in Sources */, F711A4EB2AF9327D00095DD8 /* UIImage+animatedGIF.m in Sources */, - F71459D21D12E3B700CAFEEC /* CCUtility.m in Sources */, F36E64FA2B96236C0085ABB5 /* UIView+Extension.swift in Sources */, F75A9EE723796C6F0044CFCE /* NCNetworking.swift in Sources */, AF730AFA27843E4C00B7520E /* NCShareExtension+NCDelegate.swift in Sources */, @@ -4090,7 +4072,6 @@ F7327E292B73A53400A462C7 /* NCNetworking+Upload.swift in Sources */, F343A4BC2A1E734600DDA874 /* Optional+Extension.swift in Sources */, F7327E362B73AEDE00A462C7 /* NCNetworking+LivePhoto.swift in Sources */, - F783031228B4C8EC00B84583 /* CCUtility.m in Sources */, F72EA95828B7BC4F00C88F0C /* FilesData.swift in Sources */, F7327E312B73A86700A462C7 /* NCNetworking+WebDAV.swift in Sources */, F793E59E28B763C2005E4B02 /* NCAskAuthorization.swift in Sources */, @@ -4179,7 +4160,6 @@ F76882392C0DD230001CF441 /* NCKeychain.swift in Sources */, F343A4BF2A1E734600DDA874 /* Optional+Extension.swift in Sources */, AF4BF62027562B3F0081CEEF /* NCManageDatabase+Activity.swift in Sources */, - F785EEA62461A4FB00B3F945 /* CCUtility.m in Sources */, F73ADD2226554FD10069EA0D /* NCContentPresenter.swift in Sources */, F72FD3B9297ED49A00075D28 /* NCManageDatabase+E2EE.swift in Sources */, ); @@ -4198,7 +4178,6 @@ F702F30825EE5D47008F8E80 /* NCPopupViewController.swift in Sources */, F733598125C1C188002ABA72 /* NCAskAuthorization.swift in Sources */, 370D26AF248A3D7A00121797 /* NCCellProtocol.swift in Sources */, - F77B0DF51D118A16002130FE /* CCUtility.m in Sources */, F70D87D025EE6E58008CBBBD /* NCRenameFile.swift in Sources */, F768822C2C0DD1E7001CF441 /* NCKeychain.swift in Sources */, F71CD6CA2930D7B1006C95C1 /* NCApplicationHandle.swift in Sources */, @@ -4454,7 +4433,6 @@ F7A8D73D28F181D3008BBE1C /* NCUtilityFileSystem.swift in Sources */, F73EF7E12B02266D0087E6E9 /* NCManageDatabase+Trash.swift in Sources */, F7C9B91F2B582F550064EA91 /* NCManageDatabase+SecurityGuard.swift in Sources */, - F7A8D74528F1828E008BBE1C /* CCUtility.m in Sources */, F75DD767290ABB25002EB562 /* Intent.intentdefinition in Sources */, F72437812C10B92500C7C68D /* NCPermissions.swift in Sources */, F749B64C297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */, @@ -5022,7 +5000,6 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_FILE_PROVIDER_EXTENSION_UI"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -5049,7 +5026,6 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_FILE_PROVIDER_EXTENSION_UI"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -5190,7 +5166,6 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_FILE_PROVIDER_EXTENSION"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/File Provider Extension/FileProviderExtension-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -5214,7 +5189,6 @@ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) EXTENSION EXTENSION_FILE_PROVIDER_EXTENSION"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/File Provider Extension/FileProviderExtension-Bridging-Header.h"; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -5404,7 +5378,6 @@ OTHER_LDFLAGS = ""; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) NC DEBUG"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Brand/Nextcloud-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -5468,7 +5441,6 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) NC"; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/Brand/Nextcloud-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Notification Service Extension/Notification_Service_Extension-Bridging-Header.h b/Notification Service Extension/Notification_Service_Extension-Bridging-Header.h index 0bead8f751..09b925f10e 100644 --- a/Notification Service Extension/Notification_Service_Extension-Bridging-Header.h +++ b/Notification Service Extension/Notification_Service_Extension-Bridging-Header.h @@ -19,5 +19,4 @@ // along with this program. If not, see . // -#import "CCUtility.h" #import "NCPushNotificationEncryption.h" diff --git a/Share/Share-Bridging-Header.h b/Share/Share-Bridging-Header.h index 760793c13d..c19b600db6 100644 --- a/Share/Share-Bridging-Header.h +++ b/Share/Share-Bridging-Header.h @@ -3,5 +3,4 @@ // #import "NCEndToEndEncryption.h" -#import "CCUtility.h" #import "UIImage+animatedGIF.h" diff --git a/Widget/Widget-Brinding-header.h b/Widget/Widget-Brinding-header.h index 3022099ad6..084fef8ee7 100644 --- a/Widget/Widget-Brinding-header.h +++ b/Widget/Widget-Brinding-header.h @@ -2,5 +2,4 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "CCUtility.h" #import "UIImage+animatedGIF.h" diff --git a/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h b/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h index b905120e16..1b2cb5d6d0 100644 --- a/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h +++ b/WidgetDashboardIntentHandler/WidgetDashboardIntentHandler-Brinding-header.h @@ -2,4 +2,3 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "CCUtility.h" diff --git a/iOSClient/Data/NCManageDatabase+Avatar.swift b/iOSClient/Data/NCManageDatabase+Avatar.swift index d76444c264..bf43e0ceeb 100644 --- a/iOSClient/Data/NCManageDatabase+Avatar.swift +++ b/iOSClient/Data/NCManageDatabase+Avatar.swift @@ -22,6 +22,7 @@ // import Foundation +import UIKit import RealmSwift import NextcloudKit diff --git a/iOSClient/Data/NCManageDatabase+PhotoLibrary.swift b/iOSClient/Data/NCManageDatabase+PhotoLibrary.swift index 5ea775ffd9..c97d5cc795 100644 --- a/iOSClient/Data/NCManageDatabase+PhotoLibrary.swift +++ b/iOSClient/Data/NCManageDatabase+PhotoLibrary.swift @@ -22,6 +22,8 @@ // import Foundation +import UIKit +import Photos import RealmSwift import NextcloudKit diff --git a/iOSClient/Extensions/PHAsset+Extension.swift b/iOSClient/Extensions/PHAsset+Extension.swift index cefb6b0080..61e44fb449 100644 --- a/iOSClient/Extensions/PHAsset+Extension.swift +++ b/iOSClient/Extensions/PHAsset+Extension.swift @@ -23,6 +23,7 @@ import Foundation import UIKit +import Photos extension PHAsset { var originalFilename: NSString { diff --git a/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift b/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift index 7790db9111..07a1c608fc 100644 --- a/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift +++ b/iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift @@ -340,8 +340,8 @@ import XLForm } self.dismiss(animated: true, completion: { - let createFileName = (fileName as NSString).deletingPathExtension + "." + self.fileNameExtension - let metadata = NCManageDatabase.shared.createMetadata(account: self.appDelegate.account, user: self.appDelegate.user, userId: self.appDelegate.userId, fileName: createFileName, fileNameView: createFileName, ocId: UUID, serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url, contentType: "") + let newFileName = (fileName as NSString).deletingPathExtension + "." + self.fileNameExtension + let metadata = NCManageDatabase.shared.createMetadata(account: self.appDelegate.account, user: self.appDelegate.user, userId: self.appDelegate.userId, fileName: newFileName, fileNameView: newFileName, ocId: UUID, serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url, contentType: "") if let viewController = self.controller?.currentViewController() { NCViewer().view(viewController: viewController, metadata: metadata, metadatas: [metadata], imageIcon: nil) } diff --git a/iOSClient/Main/Create cloud/Upload Assets/NCUploadAssetsModel.swift b/iOSClient/Main/Create cloud/Upload Assets/NCUploadAssetsModel.swift index 2a5d9ec95b..8492ce73ed 100644 --- a/iOSClient/Main/Create cloud/Upload Assets/NCUploadAssetsModel.swift +++ b/iOSClient/Main/Create cloud/Upload Assets/NCUploadAssetsModel.swift @@ -116,14 +116,13 @@ class NCUploadAssetsModel: NSObject, ObservableObject, NCCreateFormUploadConflic NCKeychain().setFileNameType(key: NCGlobal.shared.keyFileNameType, prefix: addFilenametype) NCKeychain().setFileNameMask(key: NCGlobal.shared.keyFileNameMask, mask: fileName) - preview = CCUtility.createFileName( - getOriginalFilenameForPreview() as String, - fileDate: creationDate, - fileType: asset.mediaType, - keyFileName: fileName.isEmptyOrNil ? nil : NCGlobal.shared.keyFileNameMask, - keyFileNameType: NCGlobal.shared.keyFileNameType, - keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, - forcedNewFileName: false + preview = NCUtilityFileSystem().createFileName(getOriginalFilenameForPreview() as String, + fileDate: creationDate, + fileType: asset.mediaType, + keyFileName: fileName.isEmptyOrNil ? nil : NCGlobal.shared.keyFileNameMask, + keyFileNameType: NCGlobal.shared.keyFileNameType, + keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, + forcedNewFileName: false ) let trimmedPreview = preview.trimmingCharacters(in: .whitespacesAndNewlines) @@ -223,14 +222,13 @@ class NCUploadAssetsModel: NSObject, ObservableObject, NCCreateFormUploadConflic let creationDate = asset.creationDate ?? Date() let ext = assetFileName.pathExtension.lowercased() - let fileName = previewStore.fileName.isEmpty - ? CCUtility.createFileName(assetFileName as String, - fileDate: creationDate, - fileType: asset.mediaType, - keyFileName: NCGlobal.shared.keyFileNameMask, - keyFileNameType: NCGlobal.shared.keyFileNameType, - keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, - forcedNewFileName: false)! + let fileName = previewStore.fileName.isEmpty ? utilityFileSystem.createFileName(assetFileName as String, + fileDate: creationDate, + fileType: asset.mediaType, + keyFileName: NCGlobal.shared.keyFileNameMask, + keyFileNameType: NCGlobal.shared.keyFileNameType, + keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, + forcedNewFileName: false) : (previewStore.fileName + "." + ext) if previewStore.assetType == .livePhoto && NCKeychain().livePhoto && previewStore.data == nil { diff --git a/iOSClient/Main/NCActionCenter.swift b/iOSClient/Main/NCActionCenter.swift index ad549cc6b4..ef565e2380 100644 --- a/iOSClient/Main/NCActionCenter.swift +++ b/iOSClient/Main/NCActionCenter.swift @@ -374,7 +374,13 @@ class NCActionCenter: NSObject, UIDocumentInteractionControllerDelegate, NCSelec func saveAsScan(metadata: tableMetadata, controller: NCMainTabBarController?) { let fileNamePath = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView) - let fileNameDestination = CCUtility.createFileName("scan.png", fileDate: Date(), fileType: PHAssetMediaType.image, keyFileName: NCGlobal.shared.keyFileNameMask, keyFileNameType: NCGlobal.shared.keyFileNameType, keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, forcedNewFileName: true)! + let fileNameDestination = utilityFileSystem.createFileName("scan.png", + fileDate: Date(), + fileType: PHAssetMediaType.image, + keyFileName: NCGlobal.shared.keyFileNameMask, + keyFileNameType: NCGlobal.shared.keyFileNameType, + keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginal, + forcedNewFileName: true) let fileNamePathDestination = utilityFileSystem.directoryScan + "/" + fileNameDestination utilityFileSystem.copyFile(atPath: fileNamePath, toPath: fileNamePathDestination) diff --git a/iOSClient/Main/NCDragDrop.swift b/iOSClient/Main/NCDragDrop.swift index a4eb68a95b..b8bc98d47a 100644 --- a/iOSClient/Main/NCDragDrop.swift +++ b/iOSClient/Main/NCDragDrop.swift @@ -22,6 +22,7 @@ // import UIKit +import UniformTypeIdentifiers import NextcloudKit class NCDragDrop: NSObject { diff --git a/iOSClient/Main/NCPickerViewController.swift b/iOSClient/Main/NCPickerViewController.swift index 70c06e8616..66c3d8cb4d 100644 --- a/iOSClient/Main/NCPickerViewController.swift +++ b/iOSClient/Main/NCPickerViewController.swift @@ -48,9 +48,8 @@ class NCPhotosPickerViewController: NSObject { if !assets.isEmpty { let serverUrl = controller.currentServerUrl() let view = NCUploadAssetsView(model: NCUploadAssetsModel(assets: assets, serverUrl: serverUrl, userBaseUrl: self.appDelegate, controller: controller)) - let controller = UIHostingController(rootView: view) DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) { - controller.present(controller, animated: true, completion: nil) + controller.present(UIHostingController(rootView: view), animated: true, completion: nil) } } } diff --git a/iOSClient/Media/NCMedia+DragDrop.swift b/iOSClient/Media/NCMedia+DragDrop.swift index 9b737ac4b1..304c8bac13 100644 --- a/iOSClient/Media/NCMedia+DragDrop.swift +++ b/iOSClient/Media/NCMedia+DragDrop.swift @@ -22,6 +22,7 @@ // import UIKit +import UniformTypeIdentifiers import NextcloudKit // MARK: - Drag diff --git a/iOSClient/Menu/UIViewController+Menu.swift b/iOSClient/Menu/UIViewController+Menu.swift index 95e58839d9..fbe6265d60 100644 --- a/iOSClient/Menu/UIViewController+Menu.swift +++ b/iOSClient/Menu/UIViewController+Menu.swift @@ -22,9 +22,10 @@ // import Foundation +import UIKit +import MessageUI import SVGKit import NextcloudKit -import UIKit extension UIViewController { fileprivate func handleProfileAction(_ action: NKHovercard.Action, for userId: String) { diff --git a/iOSClient/More/CCManageAccount.m b/iOSClient/More/CCManageAccount.m index 229f99216e..ac89ff723d 100644 --- a/iOSClient/More/CCManageAccount.m +++ b/iOSClient/More/CCManageAccount.m @@ -23,7 +23,6 @@ #import "CCManageAccount.h" #import "NCBridgeSwift.h" -#import "CCUtility.h" #define actionSheetCancellaAccount 1 diff --git a/iOSClient/Networking/E2EE/NCEndToEndEncryption.m b/iOSClient/Networking/E2EE/NCEndToEndEncryption.m index 6b575dfe52..89d74afdb9 100644 --- a/iOSClient/Networking/E2EE/NCEndToEndEncryption.m +++ b/iOSClient/Networking/E2EE/NCEndToEndEncryption.m @@ -23,7 +23,6 @@ #import "NCEndToEndEncryption.h" #import "NCBridgeSwift.h" -#import "CCUtility.h" #import #import diff --git a/iOSClient/Networking/NCAutoUpload.swift b/iOSClient/Networking/NCAutoUpload.swift index b922c39cae..404827529b 100644 --- a/iOSClient/Networking/NCAutoUpload.swift +++ b/iOSClient/Networking/NCAutoUpload.swift @@ -115,7 +115,13 @@ class NCAutoUpload: NSObject { let assetDate = asset.creationDate ?? Date() let assetMediaType = asset.mediaType var serverUrl: String = "" - let fileName = CCUtility.createFileName(asset.originalFilename as String, fileDate: assetDate, fileType: assetMediaType, keyFileName: NCGlobal.shared.keyFileNameAutoUploadMask, keyFileNameType: NCGlobal.shared.keyFileNameAutoUploadType, keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginalAutoUpload, forcedNewFileName: false)! + let fileName = NCUtilityFileSystem().createFileName(asset.originalFilename as String, + fileDate: assetDate, + fileType: assetMediaType, + keyFileName: NCGlobal.shared.keyFileNameAutoUploadMask, + keyFileNameType: NCGlobal.shared.keyFileNameAutoUploadType, + keyFileNameOriginal: NCGlobal.shared.keyFileNameOriginalAutoUpload, + forcedNewFileName: false) if account.autoUploadCreateSubfolder { serverUrl = NCUtilityFileSystem().createGranularityPath(asset: asset, serverUrl: autoUploadPath) diff --git a/iOSClient/Nextcloud-Bridging-Header.h b/iOSClient/Nextcloud-Bridging-Header.h index 011c0db6c6..42cc076c22 100644 --- a/iOSClient/Nextcloud-Bridging-Header.h +++ b/iOSClient/Nextcloud-Bridging-Header.h @@ -6,6 +6,5 @@ #import "NCEndToEndEncryption.h" #import "NYMnemonic.h" #import "UIImage+animatedGIF.h" -#import "CCUtility.h" #import "NCPushNotification.h" #import "NCPushNotificationEncryption.h" diff --git a/iOSClient/PushNotification/NCPushNotification.m b/iOSClient/PushNotification/NCPushNotification.m index f283422325..13f50c5bcb 100644 --- a/iOSClient/PushNotification/NCPushNotification.m +++ b/iOSClient/PushNotification/NCPushNotification.m @@ -26,7 +26,6 @@ #import "NCPushNotification.h" #import "NCPushNotificationEncryption.h" #import "NCEndToEndEncryption.h" -#import "CCUtility.h" @interface NCPushNotification () { diff --git a/iOSClient/PushNotification/NCPushNotificationEncryption.m b/iOSClient/PushNotification/NCPushNotificationEncryption.m index 91d96fe3a5..2bafe11d98 100644 --- a/iOSClient/PushNotification/NCPushNotificationEncryption.m +++ b/iOSClient/PushNotification/NCPushNotificationEncryption.m @@ -28,7 +28,6 @@ #import #import #import "NCEndToEndEncryption.h" -#import "CCUtility.h" @implementation NCPushNotificationEncryption diff --git a/iOSClient/Scan document/NCDocumentCamera.swift b/iOSClient/Scan document/NCDocumentCamera.swift index 4d1432ff1a..42701bd433 100644 --- a/iOSClient/Scan document/NCDocumentCamera.swift +++ b/iOSClient/Scan document/NCDocumentCamera.swift @@ -22,6 +22,8 @@ // import Foundation +import UIKit +import Photos import VisionKit class NCDocumentCamera: NSObject, VNDocumentCameraViewControllerDelegate { @@ -46,13 +48,13 @@ class NCDocumentCamera: NSObject, VNDocumentCameraViewControllerDelegate { func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) { for pageNumber in 0.. -// -// 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 . -// - -#import -#import -#import -#import -#import -#import -#import -#import - -@class tableMetadata; - -@interface CCUtility : NSObject - -+ (NSString *)createFileName:(NSString *)fileName fileDate:(NSDate *)fileDate fileType:(PHAssetMediaType)fileType keyFileName:(NSString *)keyFileName keyFileNameType:(NSString *)keyFileNameType keyFileNameOriginal:(NSString *)keyFileNameOriginal forcedNewFileName:(BOOL)forcedNewFileName; - -@end diff --git a/iOSClient/Utility/CCUtility.m b/iOSClient/Utility/CCUtility.m deleted file mode 100644 index b232fcc47f..0000000000 --- a/iOSClient/Utility/CCUtility.m +++ /dev/null @@ -1,138 +0,0 @@ -// -// CCUtility.m -// Nextcloud -// -// Created by Marino Faggiana on 02/02/16. -// Copyright (c) 2016 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// - -#import "CCUtility.h" -#import "NCBridgeSwift.h" -#import -#import -#include - -@implementation CCUtility - -#pragma -------------------------------------------------------------------------------------------- -#pragma mark ===== Various ===== -#pragma -------------------------------------------------------------------------------------------- - -+ (NSString *)createFileName:(NSString *)fileName fileDate:(NSDate *)fileDate fileType:(PHAssetMediaType)fileType keyFileName:(NSString *)keyFileName keyFileNameType:(NSString *)keyFileNameType keyFileNameOriginal:(NSString *)keyFileNameOriginal forcedNewFileName:(BOOL)forcedNewFileName -{ - BOOL addFileNameType = NO; - - // Original FileName ? - if ([[[NCKeychain alloc] init] getOriginalFileNameWithKey:keyFileNameOriginal] && !forcedNewFileName) { - return fileName; - } - - NSString *numberFileName; - if ([fileName length] > 8) numberFileName = [fileName substringWithRange:NSMakeRange(04, 04)]; - else numberFileName = [[NCKeychain alloc] init].incrementalNumber; - - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]]; - [formatter setDateFormat:@"yy-MM-dd HH-mm-ss"]; - NSString *fileNameDate = [formatter stringFromDate:fileDate]; - - NSString *fileNameType = @""; - if (fileType == PHAssetMediaTypeImage) - fileNameType = NSLocalizedString(@"_photo_", nil); - if (fileType == PHAssetMediaTypeVideo) - fileNameType = NSLocalizedString(@"_video_", nil); - if (fileType == PHAssetMediaTypeAudio) - fileNameType = NSLocalizedString(@"_audio_", nil); - if (fileType == PHAssetMediaTypeUnknown) - fileNameType = NSLocalizedString(@"_unknown_", nil); - - // Use File Name Type - if (keyFileNameType) - addFileNameType = [[[NCKeychain alloc] init] getFileNameTypeWithKey:keyFileNameType]; - - NSString *fileNameExt = [[fileName pathExtension] lowercaseString]; - - if (keyFileName) { - - fileName = [[[NCKeychain alloc] init] getFileNameMaskWithKey:keyFileName]; - - if ([fileName length] > 0) { - - [formatter setDateFormat:@"dd"]; - NSString *dayNumber = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"MMM"]; - NSString *month = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"MM"]; - NSString *monthNumber = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"yyyy"]; - NSString *year = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"yy"]; - NSString *yearNumber = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"HH"]; - NSString *hour24 = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"hh"]; - NSString *hour12 = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"mm"]; - NSString *minute = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"ss"]; - NSString *second = [formatter stringFromDate:fileDate]; - [formatter setDateFormat:@"a"]; - NSString *ampm = [formatter stringFromDate:fileDate]; - - // Replace string with date - - fileName = [fileName stringByReplacingOccurrencesOfString:@"DD" withString:dayNumber]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"MMM" withString:month]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"MM" withString:monthNumber]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"YYYY" withString:year]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"YY" withString:yearNumber]; - - fileName = [fileName stringByReplacingOccurrencesOfString:@"HH" withString:hour24]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"hh" withString:hour12]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"mm" withString:minute]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"ss" withString:second]; - fileName = [fileName stringByReplacingOccurrencesOfString:@"ampm" withString:ampm]; - - if (addFileNameType) - fileName = [NSString stringWithFormat:@"%@%@%@.%@", fileNameType, fileName, numberFileName, fileNameExt]; - else - fileName = [NSString stringWithFormat:@"%@%@.%@", fileName, numberFileName, fileNameExt]; - - fileName = [fileName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - - } else { - - if (addFileNameType) - fileName = [NSString stringWithFormat:@"%@ %@ %@.%@", fileNameType, fileNameDate, numberFileName, fileNameExt]; - else - fileName = [NSString stringWithFormat:@"%@ %@.%@", fileNameDate, numberFileName, fileNameExt]; - } - - } else { - - if (addFileNameType) - fileName = [NSString stringWithFormat:@"%@ %@ %@.%@", fileNameType, fileNameDate, numberFileName, fileNameExt]; - else - fileName = [NSString stringWithFormat:@"%@ %@.%@", fileNameDate, numberFileName, fileNameExt]; - - } - - return fileName; -} - -@end diff --git a/iOSClient/Utility/NCAskAuthorization.swift b/iOSClient/Utility/NCAskAuthorization.swift index 4bf998c6cd..9f5c7ffd7b 100644 --- a/iOSClient/Utility/NCAskAuthorization.swift +++ b/iOSClient/Utility/NCAskAuthorization.swift @@ -22,6 +22,8 @@ // import UIKit +import AVFAudio +import Photos class NCAskAuthorization: NSObject { diff --git a/iOSClient/Utility/NCCameraRoll.swift b/iOSClient/Utility/NCCameraRoll.swift index bb867d64c4..2a5f93d6c7 100644 --- a/iOSClient/Utility/NCCameraRoll.swift +++ b/iOSClient/Utility/NCCameraRoll.swift @@ -22,6 +22,7 @@ // import Foundation +import Photos import NextcloudKit class NCCameraRoll: NSObject { diff --git a/iOSClient/Utility/NCUtility+Exif.swift b/iOSClient/Utility/NCUtility+Exif.swift index 301e4527d3..706b5d2944 100644 --- a/iOSClient/Utility/NCUtility+Exif.swift +++ b/iOSClient/Utility/NCUtility+Exif.swift @@ -20,6 +20,7 @@ // import Foundation +import UIKit public struct ExifData { var colorModel: String? diff --git a/iOSClient/Utility/NCUtilityFileSystem.swift b/iOSClient/Utility/NCUtilityFileSystem.swift index e6747af111..d2cdb0bfa0 100644 --- a/iOSClient/Utility/NCUtilityFileSystem.swift +++ b/iOSClient/Utility/NCUtilityFileSystem.swift @@ -427,6 +427,96 @@ class NCUtilityFileSystem: NSObject { return fileNamePath } + func createFileName(_ fileName: String, fileDate: Date, fileType: PHAssetMediaType, keyFileName: String?, keyFileNameType: String, keyFileNameOriginal: String, forcedNewFileName: Bool) -> String { + var fileName = fileName + let keychain = NCKeychain() + var addFileNameType: Bool = keychain.getFileNameType(key: keyFileNameType) + var useFileNameOriginal: Bool = keychain.getOriginalFileName(key: keyFileNameOriginal) + var numberFileName: String = "" + var fileNameType = "" + let fileNameExt = (fileName as NSString).pathExtension.lowercased() + + /// Original FileName + if useFileNameOriginal && !forcedNewFileName { return fileName } + + if fileName.count > 8 { + let index = fileName.index(fileName.startIndex, offsetBy: 4) + numberFileName = String(fileName[index.. String { var resultFileName = fileName var exitLoop = false diff --git a/iOSClient/Utility/ThreadSafeDictionary.swift b/iOSClient/Utility/ThreadSafeDictionary.swift index b4103a1fc5..b7cba7ca2e 100644 --- a/iOSClient/Utility/ThreadSafeDictionary.swift +++ b/iOSClient/Utility/ThreadSafeDictionary.swift @@ -4,6 +4,8 @@ // Created by Shashank on 29/10/20. // +import Foundation + class ThreadSafeDictionary: Collection { private var dictionary: [V: T]