From ca4ba881f80d69a01235b93083d48b29b74b8657 Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 22 Oct 2025 18:04:24 +0200 Subject: [PATCH 1/3] Remove tip Signed-off-by: Milen Pivchev --- .../AutoUpload/NCAutoUploadModel.swift | 43 ------------------- 1 file changed, 43 deletions(-) diff --git a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift index 4503fd0349..5d5fd3d632 100644 --- a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift +++ b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift @@ -99,8 +99,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { requestAuthorization() if !autoUploadImage && !autoUploadVideo { autoUploadImage = true } - - showTip() } func onViewDisappear() { @@ -271,47 +269,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { } } -extension NCAutoUploadModel: EasyTipViewDelegate { - func showTip() { - guard !session.account.isEmpty, - !database.tipExists(NCGlobal.shared.tipAutoUploadButton) - else { - return - } - - var preferences = EasyTipView.Preferences() - - preferences.drawing.foregroundColor = .white - preferences.drawing.backgroundColor = .lightGray - preferences.drawing.textAlignment = .left - preferences.drawing.arrowPosition = .any - preferences.drawing.cornerRadius = 10 - - preferences.animating.dismissTransform = CGAffineTransform(translationX: 0, y: 100) - preferences.animating.showInitialTransform = CGAffineTransform(translationX: 0, y: -100) - preferences.animating.showInitialAlpha = 0 - preferences.animating.showDuration = 0.5 - preferences.animating.dismissDuration = 0.5 - - if tip == nil { - tip = EasyTipView(text: NSLocalizedString("_tip_autoupload_button_", comment: ""), preferences: preferences, delegate: self, tip: NCGlobal.shared.tipAutoUploadButton) - DispatchQueue.main.asyncAfter(deadline: .now() + 1) { - if let view = self.controller?.tabBar { - self.tip?.show(forView: view) - } - } - } - } - - func easyTipViewDidTap(_ tipView: EasyTipView) { - database.addTip(NCGlobal.shared.tipAutoUploadButton) - } - - func easyTipViewDidDismiss(_ tipView: EasyTipView) { - tip = nil - } -} - /// An enum that represents the granularity of the subfolders for auto upload enum Granularity: Int { /// Daily granularity, meaning the subfolders are named by day From 3da69b9b494fb18bad61f2e6021de9986430072f Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 22 Oct 2025 18:07:02 +0200 Subject: [PATCH 2/3] Refactor Signed-off-by: Milen Pivchev --- .../AutoUpload/NCAutoUploadModel.swift | 21 ------------------- .../AutoUpload/NCAutoUploadView.swift | 3 --- 2 files changed, 24 deletions(-) diff --git a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift index 5d5fd3d632..6b6db808bf 100644 --- a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift +++ b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift @@ -7,7 +7,6 @@ import Foundation import UIKit import Photos import NextcloudKit -import EasyTipView import SwiftUI enum AutoUploadTimespan: String, CaseIterable, Identifiable { @@ -51,8 +50,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { private var observerToken: NSObjectProtocol? - // Tip - var tip: EasyTipView? // Root View Controller var controller: NCMainTabBarController? // A variable user for change the auto upload directory @@ -65,19 +62,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { /// Initialization code to set up the ViewModel with the active account init(controller: NCMainTabBarController?) { self.controller = controller - - observerToken = NotificationCenter.default.addObserver(forName: UIDevice.orientationDidChangeNotification, - object: nil, - queue: .main) { _ in - self.tip?.dismiss() - self.tip = nil - } - } - - deinit { - if let token = observerToken { - NotificationCenter.default.removeObserver(token) - } } /// Triggered when the view appears. @@ -101,11 +85,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { if !autoUploadImage && !autoUploadVideo { autoUploadImage = true } } - func onViewDisappear() { - tip?.dismiss() - tip = nil - } - // MARK: - All functions func requestAuthorization() { diff --git a/iOSClient/Settings/AutoUpload/NCAutoUploadView.swift b/iOSClient/Settings/AutoUpload/NCAutoUploadView.swift index 727e1ff615..e652a724c0 100644 --- a/iOSClient/Settings/AutoUpload/NCAutoUploadView.swift +++ b/iOSClient/Settings/AutoUpload/NCAutoUploadView.swift @@ -30,9 +30,6 @@ struct NCAutoUploadView: View { .onAppear { model.onViewAppear() } - .onDisappear { - model.onViewDisappear() - } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in model.checkPermission() } From 6e7da914c78da0987d0b67f57d0883a47d7854b9 Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Wed, 22 Oct 2025 18:07:46 +0200 Subject: [PATCH 3/3] More refactoring Signed-off-by: Milen Pivchev --- iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift index 6b6db808bf..d72ad6fa5d 100644 --- a/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift +++ b/iOSClient/Settings/AutoUpload/NCAutoUploadModel.swift @@ -48,8 +48,6 @@ class NCAutoUploadModel: ObservableObject, ViewOnAppearHandling { @Published var error: String = "" let database = NCManageDatabase.shared - private var observerToken: NSObjectProtocol? - // Root View Controller var controller: NCMainTabBarController? // A variable user for change the auto upload directory