What is the equivalent value for NSRange.location in a Range object in Swift 3?

Can someone give me a hint which Range property is the equivalent property of the NSRange location property.

I'm especially interested in how I would wrap the next line of code from Swift 2.3 -> Swift 3.0

if myRange.location != NSNotFound { ... } 

myRange is still a Range property, so the compiler tells me correctly: A value of type Range does not have a member location

Is checking an empty property enough?

 if !myRange.isEmpty { ... } 

Thanks in advance

+7
swift3 range nsrange
source share

No one has answered this question yet.

See related questions:

686
What is the difference between range and xrange functions in Python 2.X?
572
How to use the decimal range step value ()?
276
What is the open keyword in Swift?
118
NSRange of Swift Range?
108
Determining if a variable is within a range?
103
Is it possible to use a range operator with an if statement in Swift?
61
How to create a range in Swift?
4
Swift 3; Out of Range
0
Potato problem: failed with exit code 128
0
Switching to Swift 3.0, creating a problem

All Articles