FactType
enum model with known (.username
, .email
, .phone
) and unknown (.other(Int)
) types of facts.Fact
model properties:
type: Int
→ type: FactType
fact: String
→ value: String
[Fact]
array:
func get(_ type: FactType) -> Fact?
func set(_ type: FactType, _ value: String?)
Contact
model:
func getFact(_ type: FactType) throws -> Fact?
mutating func setFact(_ type: FactType, _ value: String?) throws