Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jun 5, 2024
1 parent bfc8e2f commit 0e908a8
Show file tree
Hide file tree
Showing 20 changed files with 155 additions and 156 deletions.
2 changes: 1 addition & 1 deletion Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2690,6 +2690,7 @@
F7BFFA991A24D7BB0044ED85 /* Utility */ = {
isa = PBXGroup;
children = (
F702F2FC25EE5D2C008F8E80 /* NYMnemonic */,
F7053E3C1C639DF500741EA5 /* CCUtility.h */,
F7053E3D1C639DF500741EA5 /* CCUtility.m */,
F76D364528A4F8BF00214537 /* NCActivityIndicator.swift */,
Expand All @@ -2705,7 +2706,6 @@
F359D8662A7D03420023F405 /* NCUtility+Exif.swift */,
AF93474B27E34120002537EE /* NCUtility+Image.swift */,
F74AF3A3247FB6AE00AC767B /* NCUtilityFileSystem.swift */,
F702F2FC25EE5D2C008F8E80 /* NYMnemonic */,
AF36077027BFA4E8001A243D /* ParallelWorker.swift */,
F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */,
F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */,
Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Data/NCManageDatabase+Directory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ extension NCManageDatabase {
DispatchQueue.main.async {
let windowScenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }
for windowScene in windowScenes {
if let mainTabBarController = windowScene.keyWindow?.rootViewController as? NCMainTabBarController {
mainTabBarController.filesServerUrl.removeValue(forKey: serverUrl)
if let controller = windowScene.keyWindow?.rootViewController as? NCMainTabBarController {
controller.filesServerUrl.removeValue(forKey: serverUrl)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions iOSClient/Login/NCLogin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,13 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
if window?.rootViewController is NCMainTabBarController {
self.dismiss(animated: true)
} else {
if let mainTabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
mainTabBarController.modalPresentationStyle = .fullScreen
mainTabBarController.view.alpha = 0
window?.rootViewController = mainTabBarController
if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
controller.modalPresentationStyle = .fullScreen
controller.view.alpha = 0
window?.rootViewController = controller
window?.makeKeyAndVisible()
UIView.animate(withDuration: 0.5) {
mainTabBarController.view.alpha = 1
controller.view.alpha = 1
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions iOSClient/Login/NCLoginWeb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ extension NCLoginWeb: WKNavigationDelegate {
if window?.rootViewController is NCMainTabBarController {
self.dismiss(animated: true)
} else {
if let mainTabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
mainTabBarController.modalPresentationStyle = .fullScreen
mainTabBarController.view.alpha = 0
window?.rootViewController = mainTabBarController
if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
controller.modalPresentationStyle = .fullScreen
controller.view.alpha = 0
window?.rootViewController = controller
window?.makeKeyAndVisible()
UIView.animate(withDuration: 0.5) {
mainTabBarController.view.alpha = 1
controller.view.alpha = 1
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {

func move() {
let metadatas = getSelectedMetadatas()
NCActionCenter.shared.openSelectView(items: metadatas, mainTabBarController: self.tabBarController as? NCMainTabBarController)
NCActionCenter.shared.openSelectView(items: metadatas, controller: self.tabBarController as? NCMainTabBarController)
setEditMode(false)
}

func share() {
let metadatas = getSelectedMetadatas()
NCActionCenter.shared.openActivityViewController(selectedMetadata: metadatas, mainTabBarController: self.tabBarController as? NCMainTabBarController)
NCActionCenter.shared.openActivityViewController(selectedMetadata: metadatas, controller: self.tabBarController as? NCMainTabBarController)
setEditMode(false)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
override func viewDidLoad() {
super.viewDidLoad()

tabBarSelect = NCCollectionViewCommonSelectTabBar(tabBarController: tabBarController as? NCMainTabBarController, delegate: self)
tabBarSelect = NCCollectionViewCommonSelectTabBar(controller: tabBarController as? NCMainTabBarController, delegate: self)
self.navigationController?.presentationController?.delegate = self

// CollectionView & layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protocol NCCollectionViewCommonSelectTabBarDelegate: AnyObject {
}

class NCCollectionViewCommonSelectTabBar: ObservableObject {
var tabBarController: NCMainTabBarController?
var controller: NCMainTabBarController?
var hostingController: UIViewController?
open weak var delegate: NCCollectionViewCommonSelectTabBarDelegate?

Expand All @@ -47,27 +47,27 @@ class NCCollectionViewCommonSelectTabBar: ObservableObject {
@Published var enableLock = false
@Published var isSelectedEmpty = true

init(tabBarController: NCMainTabBarController? = nil, delegate: NCCollectionViewCommonSelectTabBarDelegate? = nil) {
init(controller: NCMainTabBarController? = nil, delegate: NCCollectionViewCommonSelectTabBarDelegate? = nil) {
let rootView = NCCollectionViewCommonSelectTabBarView(tabBarSelect: self)
hostingController = UIHostingController(rootView: rootView)

self.tabBarController = tabBarController
self.controller = controller
self.delegate = delegate

guard let tabBarController, let hostingController else { return }
guard let controller, let hostingController else { return }

tabBarController.view.addSubview(hostingController.view)
controller.view.addSubview(hostingController.view)

hostingController.view.frame = tabBarController.tabBar.frame
hostingController.view.frame = controller.tabBar.frame
hostingController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
hostingController.view.backgroundColor = .clear
hostingController.view.isHidden = true
}

func show() {
guard let tabBarController, let hostingController else { return }
guard let controller, let hostingController else { return }

tabBarController.tabBar.isHidden = true
controller.tabBar.isHidden = true
if hostingController.view.isHidden {
hostingController.view.isHidden = false
hostingController.view.transform = .init(translationX: 0, y: hostingController.view.frame.height)
Expand All @@ -78,10 +78,10 @@ class NCCollectionViewCommonSelectTabBar: ObservableObject {
}

func hide() {
guard let tabBarController, let hostingController else { return }
guard let controller, let hostingController else { return }

hostingController.view.isHidden = true
tabBarController.tabBar.isHidden = false
controller.tabBar.isHidden = false
}

func isHidden() -> Bool {
Expand Down
6 changes: 3 additions & 3 deletions iOSClient/Main/Create cloud/NCCreateFormUploadDocuments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import XLForm
var fileName = ""
var fileNameExtension = ""
var titleForm = ""
var mainTabBarController: NCMainTabBarController?
var controller: NCMainTabBarController?
var listOfTemplate: [NKEditorTemplates] = []
var selectTemplate: NKEditorTemplates?
let utilityFileSystem = NCUtilityFileSystem()
Expand Down Expand Up @@ -323,7 +323,7 @@ import XLForm

self.dismiss(animated: true, completion: {
let metadata = NCManageDatabase.shared.createMetadata(account: self.appDelegate.account, user: self.appDelegate.user, userId: self.appDelegate.userId, fileName: fileName, fileNameView: fileName, ocId: UUID, serverUrl: self.serverUrl, urlBase: self.appDelegate.urlBase, url: url, contentType: results.mimeType)
if let viewController = self.mainTabBarController?.currentViewController() {
if let viewController = self.controller?.currentViewController() {
NCViewer().view(viewController: viewController, metadata: metadata, metadatas: [metadata], imageIcon: nil)
}
})
Expand All @@ -342,7 +342,7 @@ 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: "")
if let viewController = self.mainTabBarController?.currentViewController() {
if let viewController = self.controller?.currentViewController() {
NCViewer().view(viewController: viewController, metadata: metadata, metadatas: [metadata], imageIcon: nil)
}
})
Expand Down
Loading

0 comments on commit 0e908a8

Please sign in to comment.