mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
1345e89809
Removed the usage of the OWSAES256Key (using CryptoKit and raw data instead) Removed the pre-compiled headers to speed up builds with minor changes (explicit imports instead) # Conflicts: # Session.xcodeproj/project.pbxproj # SessionMessagingKit/Database/Models/ClosedGroup.swift # SessionMessagingKit/Protos/Generated/SNProto.swift # SessionMessagingKit/Protos/Generated/SessionProtos.pb.swift # SessionMessagingKit/Protos/SessionProtos.proto # SessionMessagingKit/Sending & Receiving/MessageSender.swift # SessionMessagingKit/Sending & Receiving/Pollers/CurrentUserPoller.swift # SessionMessagingKit/Utilities/ProfileManager.swift # SessionSnodeKit/Models/DeleteAllMessagesRequest.swift # SessionSnodeKit/Models/GetMessagesRequest.swift # SessionSnodeKit/Models/SendMessageRequest.swift # SessionSnodeKit/Types/SnodeAPINamespace.swift
23 lines
655 B
Swift
23 lines
655 B
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
@objc public class Threading: NSObject {
|
|
@objc public static func dispatchMainThreadSafe(_ closure: @escaping () -> ()) {
|
|
guard Thread.isMainThread else {
|
|
DispatchQueue.main.async { dispatchMainThreadSafe(closure) }
|
|
return
|
|
}
|
|
|
|
closure()
|
|
}
|
|
|
|
@objc public static func dispatchSyncMainThreadSafe(_ closure: @escaping () -> ()) {
|
|
guard Thread.isMainThread else {
|
|
DispatchQueue.main.sync { dispatchSyncMainThreadSafe(closure) }
|
|
return
|
|
}
|
|
|
|
closure()
|
|
}
|
|
}
|