-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from fumito-ito/update/firebase
update [email protected]
- Loading branch information
Showing
6 changed files
with
198 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" ~> 9.0.0 | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json" ~> 9.0.0 | ||
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" ~> 9.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
Tests/SwiftyRemoteConfigTests/Helpers/SwiftyRemoteConfig+Workaround.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// | ||
// SwiftyRemoteConfig+Workaround.swift | ||
// | ||
// | ||
// Created by Fumito Ito on 2022/05/14. | ||
// | ||
|
||
import Foundation | ||
import SwiftyRemoteConfig | ||
|
||
extension RemoteConfigSerializable { | ||
public static var _remoteConfigArray: RemoteConfigArrayBridge<[T]> { RemoteConfigArrayBridge() } | ||
} | ||
|
||
extension Date: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigObjectBridge<Date> { RemoteConfigObjectBridge() } | ||
} | ||
|
||
extension String: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigStringBridge { RemoteConfigStringBridge() } | ||
} | ||
|
||
extension Int: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigIntBridge { RemoteConfigIntBridge() } | ||
} | ||
|
||
extension Double: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigDoubleBridge { return RemoteConfigDoubleBridge() } | ||
} | ||
|
||
extension Bool: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigBoolBridge { RemoteConfigBoolBridge() } | ||
} | ||
|
||
extension Data: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigDataBridge { RemoteConfigDataBridge() } | ||
} | ||
|
||
extension URL: RemoteConfigSerializable { | ||
public static var _remoteConfig: RemoteConfigUrlBridge { RemoteConfigUrlBridge() } | ||
public static var _remoteConfigArray: RemoteConfigCodableBridge<[URL]> { RemoteConfigCodableBridge() } | ||
} | ||
|
||
extension RemoteConfigSerializable where Self: Codable { | ||
public static var _remoteConfig: RemoteConfigCodableBridge<Self> { RemoteConfigCodableBridge() } | ||
public static var _remoteConfigArray: RemoteConfigCodableBridge<[Self]> { RemoteConfigCodableBridge() } | ||
} | ||
|
||
extension RemoteConfigSerializable where Self: RawRepresentable { | ||
public static var _remoteConfig: RemoteConfigRawRepresentableBridge<Self> { RemoteConfigRawRepresentableBridge() } | ||
public static var _remoteConfigArray: RemoteConfigRawRepresentableArrayBridge<[Self]> { RemoteConfigRawRepresentableArrayBridge() } | ||
} | ||
|
||
extension RemoteConfigSerializable where Self: NSCoding { | ||
public static var _remoteConfig: RemoteConfigKeyedArchiverBridge<Self> { RemoteConfigKeyedArchiverBridge() } | ||
public static var _remoteConfigArray: RemoteConfigKeyedArchiverArrayBridge<[Self]> { RemoteConfigKeyedArchiverArrayBridge() } | ||
} | ||
|
||
extension Dictionary: RemoteConfigSerializable where Key == String { | ||
public typealias T = [Key: Value] | ||
public typealias Bridge = RemoteConfigObjectBridge<T> | ||
public typealias ArrayBridge = RemoteConfigArrayBridge<[T]> | ||
|
||
public static var _remoteConfig: Bridge { Bridge() } | ||
public static var _remoteConfigArray: ArrayBridge { ArrayBridge() } | ||
} | ||
|
||
extension Array: RemoteConfigSerializable where Element: RemoteConfigSerializable { | ||
public typealias T = [Element.T] | ||
public typealias Bridge = Element.ArrayBridge | ||
public typealias ArrayBridge = RemoteConfigObjectBridge<[T]> | ||
|
||
public static var _remoteConfig: Bridge { Element._remoteConfigArray } | ||
public static var _remoteConfigArray: ArrayBridge { | ||
fatalError("Multidimensional arrays are not supported yet") | ||
} | ||
} | ||
|
||
extension Optional: RemoteConfigSerializable where Wrapped: RemoteConfigSerializable { | ||
public typealias Bridge = RemoteConfigOptionalBridge<Wrapped.Bridge> | ||
public typealias ArrayBridge = RemoteConfigOptionalBridge<Wrapped.ArrayBridge> | ||
|
||
public static var _remoteConfig: Bridge { RemoteConfigOptionalBridge(bridge: Wrapped._remoteConfig) } | ||
public static var _remoteConfigArray: ArrayBridge { RemoteConfigOptionalBridge(bridge: Wrapped._remoteConfigArray) } | ||
} |