Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert String to NSUUID in Swift?

Tags:

swift

nsuuid

I am developing iOS Swift.

I have convert the NSUUID to String like the following:

var bdAddr: NSUUID?
var text: String = bdAddr!.UUIDString

But how to convert String to NSUUID in Swift?

like image 863
Wun Avatar asked Oct 19 '25 14:10

Wun


1 Answers

If you look at Apple's NSUUID documentation You'll see a method -initWithUUIDString: that initializes the NSUUID object with the string representation of a UUID.

like image 99
Paul Avatar answered Oct 22 '25 02:10

Paul



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!