react-native-video/ios/Video/DataStructures/TextTrack.swift
Nick Fujita 8b75438148
VEX-5682: iOS Swift Conversion (#11)
Converts ios implementation from objective-c to swift.
2021-10-27 10:35:07 +09:00

26 lines
623 B
Swift

struct TextTrack {
let type: String
let language: String
let title: String
let uri: String
let json: NSDictionary?
init(_ json: NSDictionary!) {
guard json != nil else {
self.json = nil
self.type = ""
self.language = ""
self.title = ""
self.uri = ""
return
}
self.json = json
self.type = json["type"] as? String ?? ""
self.language = json["language"] as? String ?? ""
self.title = json["title"] as? String ?? ""
self.uri = json["uri"] as? String ?? ""
}
}