session-ios/SessionUtilitiesKit/Utilities/Threading.swift
Morgan Pretty 1345e89809 Further config util logic
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
2022-12-07 15:06:15 +11:00

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()
}
}