Fact improvements & helpers
Compare changes
- Dariusz Rybicki authored
@@ -3,14 +3,14 @@ import Foundation
@@ -46,13 +46,13 @@ extension Array where Element == Fact {
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