marinofaggiana 4 жил өмнө
parent
commit
c9197b65ef

+ 2 - 2
iOSClient/Account Request/NCAccountRequest.swift

@@ -159,7 +159,7 @@ extension NCAccountRequest: UITableViewDataSource {
         let urlLabel = cell.viewWithTag(30) as? UILabel
         let activeImage = cell.viewWithTag(40) as? UIImageView
         
-        avatarImage?.image = NCCollectionCommon.shared.loadImage(named: "person.crop.circle")
+        avatarImage?.image = NCUtility.shared.loadImage(named: "person.crop.circle")
     
         let fileNamePath = String(CCUtility.getDirectoryUserData()) + "/" + String(CCUtility.getStringUser(account.user, urlBase: account.urlBase)) + "-" + account.user + ".png"
         
@@ -172,7 +172,7 @@ extension NCAccountRequest: UITableViewDataSource {
         urlLabel?.text = (URL(string: account.urlBase)?.host ?? "")
 
         if account.active {
-            activeImage?.image = NCCollectionCommon.shared.loadImage(named: "checkmark")
+            activeImage?.image = NCUtility.shared.loadImage(named: "checkmark")
         } else {
             activeImage?.image = nil
         }

+ 1 - 1
iOSClient/Diagnostics/NCCapabilitiesViewController.swift

@@ -144,7 +144,7 @@ class NCCapabilitiesViewController: UIViewController, UIDocumentInteractionContr
         imageExternalSite.image = UIImage.init(named: "externalsites")!.image(color: .gray, size: 50)
         imageEndToEndEncryption.image = UIImage.init(named: "lock")!.image(color: .gray, size: 50)
         imageActivity.image = UIImage.init(named: "bolt")!.image(color: .gray, size: 50)
-        imageNotification.image = NCCollectionCommon.shared.loadImage(named: "bell", color: .gray)
+        imageNotification.image = NCUtility.shared.loadImage(named: "bell", color: .gray)
         imageDeletedFiles.image = UIImage.init(named: "delete")!.image(color: .gray, size: 50)
         imageText.image = UIImage.init(named: "text")!.image(color: .gray, size: 50)
         imageCollabora.image = UIImage.init(named: "collabora")!.image(color: .gray, size: 50)

+ 2 - 27
iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

@@ -63,7 +63,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
     
     // MARK: -
     
-    @objc func createImagesThemingColor() {
+    func createImagesThemingColor() {
         
         images.file = UIImage.init(named: "file")!
         
@@ -73,7 +73,7 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
         
         images.favorite = UIImage(named: "favorite")!.image(color: NCBrandColor.shared.yellowFavorite, size: 50)
         images.comment = UIImage(named: "comment")!.image(color: NCBrandColor.shared.graySoft, size: 50)
-        images.livePhoto = UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.textView, size: 50)
+        images.livePhoto = NCUtility.shared.loadImage(named: "livephoto", color: NCBrandColor.shared.textView)
         images.offlineFlag = UIImage.init(named: "offlineFlag")!
         images.local = UIImage.init(named: "local")!
             
@@ -93,31 +93,6 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
         images.buttonStop = UIImage(named: "stop")!.image(color: NCBrandColor.shared.graySoft, size: 50)
     }
     
-    @objc func loadImage(named: String, color: UIColor = NCBrandColor.shared.icon, size: CGFloat = 50, forcedResizeSF: Bool = false) -> UIImage {
-        
-        var image: UIImage?
-        
-        if #available(iOS 13.0, *) {
-            if forcedResizeSF {
-                let configuration = UIImage.SymbolConfiguration(pointSize: size)
-                image = UIImage(systemName: named, withConfiguration: configuration)?.imageColor(color)
-            } else {
-                image = UIImage(systemName: named)?.imageColor(color)
-            }
-            if image == nil {
-                image = UIImage(named: named)?.image(color: color, size: size)
-            }
-        } else {
-            image = UIImage(named: named)?.image(color: color, size: size)
-        }
-        
-        if image != nil {
-            return image!
-        }
-        
-        return  UIImage(named: "file")!.image(color: color, size: size)
-    }
-    
     // MARK: - NCSelect + Delegate
     
     func dismissSelect(serverUrl: String?, metadata: tableMetadata?, type: String, items: [Any], buttonType: String, overwrite: Bool) {

+ 1 - 1
iOSClient/Media/NCMedia.swift

@@ -234,7 +234,7 @@ class NCMedia: UIViewController, NCEmptyDataSetDelegate, NCSelectDelegate {
         collectionView.backgroundColor = NCBrandColor.shared.backgroundView
         collectionView.reloadData()
         
-        cacheImages.cellLivePhotoImage = UIImage.init(named: "livePhoto")!.image(color: .white, size: 50)
+        cacheImages.cellLivePhotoImage = NCUtility.shared.loadImage(named: "livephoto", color: .white)
         cacheImages.cellPlayImage = UIImage.init(named: "play")!.image(color: .white, size: 50)
     }
 

+ 1 - 1
iOSClient/Menu/AppDelegate+Menu.swift

@@ -87,7 +87,7 @@ extension AppDelegate {
         if #available(iOS 13.0, *) {
             actions.append(
                 NCMenuAction(
-                    title: NSLocalizedString("_scans_document_", comment: ""), icon: NCCollectionCommon.shared.loadImage(named: "doc.text.viewfinder"), action: { menuAction in
+                    title: NSLocalizedString("_scans_document_", comment: ""), icon: NCUtility.shared.loadImage(named: "doc.text.viewfinder"), action: { menuAction in
                         if let viewController = appDelegate.window?.rootViewController {
                             NCCreateScanDocument.shared.openScannerDocument(viewController: viewController)
                         }

+ 15 - 15
iOSClient/Menu/NCCollectionViewCommon+Menu.swift

@@ -110,7 +110,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_details_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "info"),
+                    icon: NCUtility.shared.loadImage(named: "info"),
                     action: { menuAction in
                         NCNetworkingNotificationCenter.shared.openShare(ViewController: self, metadata: metadata, indexPage: 0)
                     }
@@ -125,7 +125,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") :  NSLocalizedString("_set_available_offline_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "tray.and.arrow.down"),
+                    icon: NCUtility.shared.loadImage(named: "tray.and.arrow.down"),
                     action: { menuAction in
                         if isOffline {
                             if metadata.directory {
@@ -157,7 +157,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_open_in_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "square.and.arrow.up"),
+                    icon: NCUtility.shared.loadImage(named: "square.and.arrow.up"),
                     action: { menuAction in
                         NCNetworkingNotificationCenter.shared.downloadOpen(metadata: metadata, selector: NCGlobal.shared.selectorOpenIn)
                     }
@@ -172,7 +172,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_print_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "printer"),
+                    icon: NCUtility.shared.loadImage(named: "printer"),
                     action: { menuAction in
                         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                             NCCollectionCommon.shared.printDocument(metadata: metadata)
@@ -189,11 +189,11 @@ extension NCCollectionViewCommon {
         //
         if metadata.typeFile == NCGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCGlobal.shared.metadataTypeFileVideo {
             var title: String = NSLocalizedString("_save_selected_files_", comment: "")
-            var icon = NCCollectionCommon.shared.loadImage(named: "square.and.arrow.down")
+            var icon = NCUtility.shared.loadImage(named: "square.and.arrow.down")
             let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata)
             if metadataMOV != nil {
                 title = NSLocalizedString("_livephoto_save_", comment: "")
-                icon = UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.icon, size: 50)
+                icon = NCUtility.shared.loadImage(named: "livephoto")
             }
             
             actions.append(
@@ -222,7 +222,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_rename_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "pencil"),
+                    icon: NCUtility.shared.loadImage(named: "pencil"),
                     action: { menuAction in
                         
                         if let vcRename = UIStoryboard(name: "NCRenameFile", bundle: nil).instantiateInitialViewController() as? NCRenameFile {
@@ -246,7 +246,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_move_or_copy_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "arrow.up.right.square"),
+                    icon: NCUtility.shared.loadImage(named: "arrow.up.right.square"),
                     action: { menuAction in
                         NCCollectionCommon.shared.openSelectView(items: [metadata], viewController: self)
                     }
@@ -261,7 +261,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_copy_file_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "doc.on.doc"),
+                    icon: NCUtility.shared.loadImage(named: "doc.on.doc"),
                     action: { menuAction in
                         self.appDelegate.pasteboardOcIds = [metadata.ocId];
                         NCCollectionCommon.shared.copyPasteboard()
@@ -277,7 +277,7 @@ extension NCCollectionViewCommon {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_view_in_folder_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "arrow.up.forward.app"),
+                    icon: NCUtility.shared.loadImage(named: "arrow.up.forward.app"),
                     action: { menuAction in
                         NCCollectionCommon.shared.openFileViewInFolder(serverUrl: metadata.serverUrl, fileName: metadata.fileName)
                     }
@@ -291,7 +291,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: titleDelete,
-                icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                icon: NCUtility.shared.loadImage(named: "trash"),
                 action: { menuAction in
                     let alertController = UIAlertController(title: "", message: NSLocalizedString("_want_delete_", comment: ""), preferredStyle: .alert)
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_delete_", comment: ""), style: .default) { (action:UIAlertAction) in
@@ -391,7 +391,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_save_selected_files_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "square.and.arrow.down"),
+                icon: NCUtility.shared.loadImage(named: "square.and.arrow.down"),
                 action: { menuAction in
                     for ocId in selectOcId {
                         if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
@@ -419,7 +419,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_move_or_copy_selected_files_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "arrow.up.right.square"),
+                icon: NCUtility.shared.loadImage(named: "arrow.up.right.square"),
                 action: { menuAction in
                     var meradatasSelect = [tableMetadata]()
                     for ocId in selectOcId {
@@ -441,7 +441,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_copy_file_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "doc.on.doc"),
+                icon: NCUtility.shared.loadImage(named: "doc.on.doc"),
                 action: { menuAction in
                     self.appDelegate.pasteboardOcIds.removeAll()
                     for ocId in selectOcId {
@@ -459,7 +459,7 @@ extension NCCollectionViewCommon {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_delete_selected_files_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                icon: NCUtility.shared.loadImage(named: "trash"),
                 action: { menuAction in
                     let alertController = UIAlertController(title: "", message: NSLocalizedString("_want_delete_", comment: ""), preferredStyle: .alert)
                     alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_delete_", comment: ""), style: .default) { (action:UIAlertAction) in

+ 1 - 1
iOSClient/Menu/NCLoginWeb+Menu.swift

@@ -31,7 +31,7 @@ extension NCLoginWeb {
         var actions = [NCMenuAction]()
         
         let accounts = NCManageDatabase.shared.getAllAccount()
-        var avatar = NCCollectionCommon.shared.loadImage(named: "person.crop.circle")
+        var avatar = NCUtility.shared.loadImage(named: "person.crop.circle")
         
         for account in accounts {
             

+ 2 - 2
iOSClient/Menu/NCMedia+Menu.swift

@@ -148,7 +148,7 @@ extension NCMedia {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_move_or_copy_selected_files_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "arrow.up.right.square"),
+                    icon: NCUtility.shared.loadImage(named: "arrow.up.right.square"),
                     action: { menuAction in
                         self.isEditMode = false
                         var meradatasSelect = [tableMetadata]()
@@ -171,7 +171,7 @@ extension NCMedia {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_delete_selected_files_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                    icon: NCUtility.shared.loadImage(named: "trash"),
                     action: { menuAction in
                         self.isEditMode = false
                         for ocId in self.selectOcId {

+ 1 - 1
iOSClient/Menu/NCShareComments+Menu.swift

@@ -68,7 +68,7 @@ extension NCShareComments {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_delete_comment_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                icon: NCUtility.shared.loadImage(named: "trash"),
                 action: { menuAction in
                     guard let metadata = self.metadata else { return }
                     guard let tableComments = tableComments else { return }

+ 4 - 4
iOSClient/Menu/NCTrash+Menu.swift

@@ -35,7 +35,7 @@ extension NCTrash {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_trash_delete_selected_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                    icon: NCUtility.shared.loadImage(named: "trash"),
                     action: { menuAction in
                         let alert = UIAlertController(title: NSLocalizedString("_trash_delete_selected_", comment: ""), message: "", preferredStyle: .alert)
                         alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .destructive, handler: { _ in
@@ -56,7 +56,7 @@ extension NCTrash {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_trash_delete_all_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                    icon: NCUtility.shared.loadImage(named: "trash"),
                     action: { menuAction in
                         let alert = UIAlertController(title: NSLocalizedString("_trash_delete_all_", comment: ""), message: "", preferredStyle: .alert)
                         alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .destructive, handler: { _ in
@@ -112,7 +112,7 @@ extension NCTrash {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_delete_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                icon: NCUtility.shared.loadImage(named: "trash"),
                 action: { menuAction in
                     self.deleteItem(with: objectId)
                 }
@@ -171,7 +171,7 @@ extension NCTrash {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_delete_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                icon: NCUtility.shared.loadImage(named: "trash"),
                 action: { menuAction in
                     self.deleteItem(with: objectId)
                 }

+ 12 - 12
iOSClient/Menu/NCViewer+Menu.swift

@@ -75,7 +75,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_details_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "info"),
+                    icon: NCUtility.shared.loadImage(named: "info"),
                     action: { menuAction in
                         NCNetworkingNotificationCenter.shared.openShare(ViewController: viewController, metadata: metadata, indexPage: 0)
                     }
@@ -90,7 +90,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: titleOffline,
-                    icon: NCCollectionCommon.shared.loadImage(named: "tray.and.arrow.down"),
+                    icon: NCUtility.shared.loadImage(named: "tray.and.arrow.down"),
                     action: { menuAction in
                         if ((localFile == nil || !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView)) && metadata.session == "") {
                             
@@ -110,7 +110,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_open_in_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "square.and.arrow.up"),
+                    icon: NCUtility.shared.loadImage(named: "square.and.arrow.up"),
                     action: { menuAction in
                         NCNetworkingNotificationCenter.shared.downloadOpen(metadata: metadata, selector: NCGlobal.shared.selectorOpenIn)
                     }
@@ -125,7 +125,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_print_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "printer"),
+                    icon: NCUtility.shared.loadImage(named: "printer"),
                     action: { menuAction in
                         if CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView) {
                             NCCollectionCommon.shared.printDocument(metadata: metadata)
@@ -143,11 +143,11 @@ extension NCViewer {
         if metadata.typeFile == NCGlobal.shared.metadataTypeFileImage || metadata.typeFile == NCGlobal.shared.metadataTypeFileVideo {
             
             var title: String = NSLocalizedString("_save_selected_files_", comment: "")
-            var icon = NCCollectionCommon.shared.loadImage(named: "square.and.arrow.down")
+            var icon = NCUtility.shared.loadImage(named: "square.and.arrow.down")
             let metadataMOV = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata)
             if metadataMOV != nil {
                 title = NSLocalizedString("_livephoto_save_", comment: "")
-                icon = UIImage(named: "livePhoto")!.image(color: NCBrandColor.shared.icon, size: 50)
+                icon = NCUtility.shared.loadImage(named: "livephoto")
             }
             
             actions.append(
@@ -172,7 +172,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_rename_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "pencil"),
+                    icon: NCUtility.shared.loadImage(named: "pencil"),
                     action: { menuAction in
                         
                         if let vcRename = UIStoryboard(name: "NCRenameFile", bundle: nil).instantiateInitialViewController() as? NCRenameFile {
@@ -196,7 +196,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: NSLocalizedString("_move_or_copy_", comment: ""),
-                    icon: NCCollectionCommon.shared.loadImage(named: "arrow.up.right.square"),
+                    icon: NCUtility.shared.loadImage(named: "arrow.up.right.square"),
                     action: { menuAction in
                         
                         let storyboard = UIStoryboard(name: "NCSelect", bundle: nil)
@@ -228,7 +228,7 @@ extension NCViewer {
         actions.append(
             NCMenuAction(
                 title: NSLocalizedString("_copy_file_", comment: ""),
-                icon: NCCollectionCommon.shared.loadImage(named: "doc.on.doc"),
+                icon: NCUtility.shared.loadImage(named: "doc.on.doc"),
                 action: { menuAction in
                     self.appDelegate.pasteboardOcIds = [metadata.ocId];
                     NCCollectionCommon.shared.copyPasteboard()
@@ -244,7 +244,7 @@ extension NCViewer {
                 actions.append(
                     NCMenuAction(
                         title: NSLocalizedString("_view_in_folder_", comment: ""),
-                        icon: NCCollectionCommon.shared.loadImage(named: "folder-search-outline"),
+                        icon: NCUtility.shared.loadImage(named: "folder-search-outline"),
                         action: { menuAction in
                             NCCollectionCommon.shared.openFileViewInFolder(serverUrl: metadata.serverUrl, fileName: metadata.fileName)
                         }
@@ -261,7 +261,7 @@ extension NCViewer {
                 actions.append(
                     NCMenuAction(
                         title: NSLocalizedString("_download_image_max_", comment: ""),
-                        icon: NCCollectionCommon.shared.loadImage(named: "square.and.arrow.down"),
+                        icon: NCUtility.shared.loadImage(named: "square.and.arrow.down"),
                         action: { menuAction in
                             NCNetworking.shared.download(metadata: metadata, selector: "") { (_) in }
                         }
@@ -292,7 +292,7 @@ extension NCViewer {
             actions.append(
                 NCMenuAction(
                     title: titleDelete,
-                    icon: NCCollectionCommon.shared.loadImage(named: "trash"),
+                    icon: NCUtility.shared.loadImage(named: "trash"),
                     action: { menuAction in
                         
                         let alertController = UIAlertController(title: "", message: NSLocalizedString("_want_delete_", comment: ""), preferredStyle: .alert)

+ 1 - 1
iOSClient/More/NCMore.swift

@@ -374,7 +374,7 @@ class NCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
                 item = settingsMenu[indexPath.row]
             }
 
-            cell.imageIcon?.image = NCCollectionCommon.shared.loadImage(named: item.icon)
+            cell.imageIcon?.image = NCUtility.shared.loadImage(named: item.icon)
             cell.labelText?.text = NSLocalizedString(item.name, comment: "")
             cell.labelText.textColor = NCBrandColor.shared.textView
             

+ 1 - 1
iOSClient/Notification/NCNotification.swift

@@ -107,7 +107,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate, NCEmpty
         if let image = image {
             cell.icon.image = image.image(color:  NCBrandColor.shared.brandElement, size: 25)
         } else {
-            cell.icon.image = NCCollectionCommon.shared.loadImage(named: "bell", color: NCBrandColor.shared.brandElement)
+            cell.icon.image = NCUtility.shared.loadImage(named: "bell", color: NCBrandColor.shared.brandElement)
         }
         
         // Avatar

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

@@ -225,7 +225,7 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
     [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
-    [row.cellConfig setObject:[[NCCollectionCommon shared] loadImageWithNamed:@"trash" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
+    [row.cellConfig setObject:[[NCUtility shared] loadImageWithNamed:@"trash" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
     row.action.formSelector = @selector(clearCacheRequest:);
     [section addFormRow:row];
 

+ 3 - 3
iOSClient/Settings/CCManageAccount.m

@@ -72,7 +72,7 @@
             
         } else {
             
-            avatar = [[NCCollectionCommon shared] loadImageWithNamed:@"avatar" color:NCBrandColor.shared.icon size:35 forcedResizeSF:false];
+            avatar = [[NCUtility shared] loadImageWithNamed:@"avatar" color:NCBrandColor.shared.icon size:35 forcedResizeSF:false];
         }
         
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.backgroundView;
@@ -127,7 +127,7 @@
         row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.backgroundView;
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
-        [row.cellConfig setObject:[[NCCollectionCommon shared] loadImageWithNamed:@"trash" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
+        [row.cellConfig setObject:[[NCUtility shared] loadImageWithNamed:@"trash" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
         [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
         row.action.formSelector = @selector(deleteAccount:);
         if (accounts.count == 0) row.disabled = @YES;
@@ -240,7 +240,7 @@
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
         [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"detailTextLabel.font"];
         [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
-        [row.cellConfig setObject:[[NCCollectionCommon shared] loadImageWithNamed:@"network" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
+        [row.cellConfig setObject:[[NCUtility shared] loadImageWithNamed:@"network" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
         row.value = accountActive.webpage;
         [section addFormRow:row];
     }

+ 1 - 1
iOSClient/Settings/NCSettings.m

@@ -149,7 +149,7 @@
     row.cellConfigAtConfigure[@"backgroundColor"] = NCBrandColor.shared.backgroundView;
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
     [row.cellConfig setObject:NCBrandColor.shared.textView forKey:@"textLabel.textColor"];
-    [row.cellConfig setObject:[[NCCollectionCommon shared] loadImageWithNamed:@"gear" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
+    [row.cellConfig setObject:[[NCUtility shared] loadImageWithNamed:@"gear" color:NCBrandColor.shared.icon size:25 forcedResizeSF:false] forKey:@"imageView.image"];
     row.action.viewControllerClass = [CCAdvanced class];
     [section addFormRow:row];
 

+ 1 - 1
iOSClient/Share/NCShareLinkMenuView.swift

@@ -123,7 +123,7 @@ class NCShareLinkMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         fieldSetExpirationDate.inputView = UIView()
         
         imageNoteToRecipient.image = UIImage.init(named: "file_txt")!.image(color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
-        imageDeleteShareLink.image = NCCollectionCommon.shared.loadImage(named: "trash", color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
+        imageDeleteShareLink.image = NCUtility.shared.loadImage(named: "trash", color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
         imageAddAnotherLink.image = UIImage.init(named: "add")!.image(color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50) 
     }
     

+ 1 - 1
iOSClient/Share/NCShareUserMenuView.swift

@@ -102,7 +102,7 @@ class NCShareUserMenuView: UIView, UIGestureRecognizerDelegate, NCShareNetworkin
         fieldSetExpirationDate.inputView = UIView()
         
         imageNoteToRecipient.image = UIImage.init(named: "file_txt")!.image(color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
-        imageUnshare.image = NCCollectionCommon.shared.loadImage(named: "trash", color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
+        imageUnshare.image = NCUtility.shared.loadImage(named: "trash", color: UIColor(red: 76/255, green: 76/255, blue: 76/255, alpha: 1), size: 50)
     }
     
     override func willMove(toWindow newWindow: UIWindow?) {

+ 25 - 0
iOSClient/Utility/NCUtility.swift

@@ -470,6 +470,31 @@ class NCUtility: NSObject {
         }
         return ""
     }
+    
+    @objc func loadImage(named: String, color: UIColor = NCBrandColor.shared.icon, size: CGFloat = 50, forcedResizeSF: Bool = false) -> UIImage {
+        
+        var image: UIImage?
+        
+        if #available(iOS 13.0, *) {
+            if forcedResizeSF {
+                let configuration = UIImage.SymbolConfiguration(pointSize: size)
+                image = UIImage(systemName: named, withConfiguration: configuration)?.imageColor(color)
+            } else {
+                image = UIImage(systemName: named)?.imageColor(color)
+            }
+            if image == nil {
+                image = UIImage(named: named)?.image(color: color, size: size)
+            }
+        } else {
+            image = UIImage(named: named)?.image(color: color, size: size)
+        }
+        
+        if image != nil {
+            return image!
+        }
+        
+        return  UIImage(named: "file")!.image(color: color, size: size)
+    }
 }
 
 // MARK: -

+ 1 - 1
iOSClient/Viewer/NCViewerImage/NCViewerImageZoom.swift

@@ -88,7 +88,7 @@ class NCViewerImageZoom: UIViewController {
         }
         
         if NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) != nil {
-            statusViewImage.image = UIImage.init(named: "livePhoto")!.image(color: .gray, size: 50)
+            statusViewImage.image = NCUtility.shared.loadImage(named: "livephoto", color: .gray)
             statusLabel.text = "LIVE"
         }  else {
             statusViewImage.image = nil