I would suggest using a tuple with additional values, and then create code to deploy them.
Any , , String Int, , .
func someFuction(type: String) -> (String?, Int?) {
}
:
let sometuple: (string: String?, int: Int?) = ("Hi", 10)
switch sometuple {
case let (.some(s), .some(i)):
print("String: \(s), Int: \(i)")
case let (.some(s), nil):
print(s)
case let (nil, .some(i)):
print(i)
case (nil, nil):
print("Nothing")
}
//prints "String: Hi, Int: 10"
, Optional :
enum Optional<T> {
case some(x:T)
case none
}