Skip to content

Commit

Permalink
coding
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Feb 1, 2025
1 parent faf2866 commit d503c4a
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions iOSClient/Networking/NCNetworking.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ import Queuer
func didAskForClientCertificate()
}

@objcMembers
final class NCNetworking: NSObject, NextcloudKitDelegate {
public static let shared: NCNetworking = {
let instance = NCNetworking()
NotificationCenter.default.addObserver(instance, selector: #selector(applicationDidEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
return instance
}()
class NCNetworking: AnyObject, @unchecked Sendable, NextcloudKitDelegate {

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'

Check failure on line 39 in iOSClient/Networking/NCNetworking.swift

View workflow job for this annotation

GitHub Actions / Build and Test

only protocols can inherit from 'AnyObject'
static let shared = NCNetworking()

struct FileNameServerUrl: Hashable {
var fileName: String
var serverUrl: String

}

let sessionDownload = NextcloudKit.shared.nkCommonInstance.identifierSessionDownload
Expand Down Expand Up @@ -89,26 +83,22 @@ final class NCNetworking: NSObject, NextcloudKitDelegate {

// MARK: - init

override init() {
super.init()

init() {
if let account = database.getActiveTableAccount()?.account {
getActiveAccountCertificate(account: account)
}

NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: global.notificationCenterChangeUser), object: nil, queue: nil) { notification in
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: global.notificationCenterChangeUser), object: nil, queue: .main) { notification in
if let userInfo = notification.userInfo {
if let account = userInfo["account"] as? String {
self.getActiveAccountCertificate(account: account)
}
}
}
}

// MARK: - NotificationCenter

func applicationDidEnterBackground() {
NCTransferProgress.shared.clearAllCountError()
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) { _ in
NCTransferProgress.shared.clearAllCountError()
}
}

// MARK: - Communication Delegate
Expand Down

0 comments on commit d503c4a

Please sign in to comment.