VEX-5682: iOS Swift Conversion (#11)

Converts ios implementation from objective-c to swift.
This commit is contained in:
Nick Fujita
2021-10-27 10:35:07 +09:00
committed by GitHub
parent 3bcf2c6061
commit 8b75438148
34 changed files with 2661 additions and 2313 deletions

View File

@@ -0,0 +1,31 @@
struct VideoSource {
let type: String?
let uri: String?
let isNetwork: Bool
let isAsset: Bool
let shouldCache: Bool
let requestHeaders: Dictionary<String,Any>?
let json: NSDictionary?
init(_ json: NSDictionary!) {
guard json != nil else {
self.json = nil
self.type = nil
self.uri = nil
self.isNetwork = false
self.isAsset = false
self.shouldCache = false
self.requestHeaders = nil
return
}
self.json = json
self.type = json["type"] as? String
self.uri = json["uri"] as? String
self.isNetwork = json["isNetwork"] as? Bool ?? false
self.isAsset = json["isAsset"] as? Bool ?? false
self.shouldCache = json["shouldCache"] as? Bool ?? false
self.requestHeaders = json["requestHeaders"] as? Dictionary<String,Any>
}
}