Added Availability Attributes

This commit is contained in:
Yakov Manshin 2022-09-30 00:32:33 +02:00
parent fbe154665f
commit a368a02ee7
No known key found for this signature in database
GPG Key ID: DA3328AA3609559B
4 changed files with 22 additions and 0 deletions

View File

@ -6,8 +6,14 @@
// Copyright © 2022 Yakov Manshin. See the LICENSE file for license info.
//
#if swift(>=5.5)
@available(iOS 13, *)
@available(macOS 10.15, *)
public protocol AsyncFeatureFlagStoreProtocol {
func value<Value>(forKey key: String) async throws -> Value
}
#endif

View File

@ -6,6 +6,10 @@
// Copyright © 2022 Yakov Manshin. See the LICENSE file for license info.
//
#if swift(>=5.5)
@available(iOS 13, *)
@available(macOS 10.15, *)
public protocol AsyncMutableFeatureFlagStoreProtocol: AnyObject, AsyncFeatureFlagStoreProtocol {
func setValue<Value>(_ value: Value, forKey key: String) async throws
@ -18,8 +22,12 @@ public protocol AsyncMutableFeatureFlagStoreProtocol: AnyObject, AsyncFeatureFla
// MARK: - Default Implementation
@available(iOS 13, *)
@available(macOS 10.15, *)
extension AsyncMutableFeatureFlagStoreProtocol {
public func saveChanges() async throws { }
}
#endif

View File

@ -6,6 +6,8 @@
// Copyright © 2022 Yakov Manshin. See the LICENSE file for license info.
//
#if swift(>=5.5)
import YMFF
#if !COCOAPODS
import YMFFProtocols
@ -72,3 +74,5 @@ fileprivate enum AsyncMutableFeatureFlagStoreMockError: Error {
case valueNotFoundInStore
case valueTypeMismatch
}
#endif

View File

@ -6,6 +6,8 @@
// Copyright © 2022 Yakov Manshin. See the LICENSE file for license info.
//
#if swift(>=5.5)
@testable import YMFF
import XCTest
@ -26,3 +28,5 @@ final class AsyncMutableStoreTests: XCTestCase {
}
}
#endif