I try to parse UUID from string but it's always nil. I write it like this.
UUID(uuidString: "my UUID")
I even try it like this in xcode expression watcher but it's also nil
UUID(uuidString: UUID().uuidString)
But when I try NSUUID on the same string, It's working fine.
NSUUID(uuidString: "my UUID")
Did anyone know what should I check? or is there anyway to convert from NSUUID to UUID?
Thank you very much in advance.
I try to parse UUID from string but it's always nil. I write it like this.
UUID(uuidString: "my UUID") ->
reason
The standard format for UUIDs represented in ASCII is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067.
Returns
nilfor invalid strings.
I even try it like this in Xcode expression watcher but it's also nil
UUID(uuidString: UUID().uuidString) -> it is returning a UUID like (7AFD7082-7A14-44F8-B839-5C4D98842798), working fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With