session-ios/SessionMessagingKit/Configuration.swift

19 lines
548 B
Swift
Raw Normal View History

2020-11-06 01:41:01 +01:00
2020-12-02 06:25:16 +01:00
@objc
public final class SNMessagingKitConfiguration : NSObject {
2020-11-06 01:41:01 +01:00
public let storage: SessionMessagingKitStorageProtocol
2020-12-02 06:25:16 +01:00
@objc public static var shared: SNMessagingKitConfiguration!
2020-12-01 07:40:18 +01:00
2021-01-04 01:18:04 +01:00
fileprivate init(storage: SessionMessagingKitStorageProtocol) {
2020-12-01 07:40:18 +01:00
self.storage = storage
}
2020-11-06 01:41:01 +01:00
}
2020-11-12 22:41:54 +01:00
public enum SNMessagingKit { // Just to make the external API nice
2020-11-06 01:41:01 +01:00
2021-01-04 01:18:04 +01:00
public static func configure(storage: SessionMessagingKitStorageProtocol) {
SNMessagingKitConfiguration.shared = SNMessagingKitConfiguration(storage: storage)
2020-11-06 01:41:01 +01:00
}
}