ModelFieldProtocol
public protocol ModelFieldProtocol : Decodable
A protocol to abstract Internet Archive properties to native Swift types
This protocol allows converting different field types to more specific, native Swift types.
For example, the Internet Archive metadata length field can be represented as a TimeInterval
so an IATimeInterval knows how to convert 323.4
(seconds) or 5:23
(hh:mm:ss) to a TimeInterval
A ModelFieldProtocol class is instantiated with a String and its value accessed through the value property.
Example Usage
let intField: IAInt = IAInt(string: "3")
intField.value => 3
-
Declaration
Swift
associatedtype FieldType : Decodable -
Declaration
Swift
init?(fromString string: String) -
Declaration
Swift
var value: FieldType? { get }
View on GitHub
ModelFieldProtocol Protocol Reference