Wun
Wun

Reputation: 6381

How to convert String to NSUUID in Swift?

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?

Upvotes: 4

Views: 4618

Answers (1)

Paul
Paul

Reputation: 2738

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.

Upvotes: 9

Related Questions