Alex Cheng
Alex Cheng

Reputation: 829

How to use "distanceTo", "advancedBy" to handle String in Xcode7 beta6

I have an extension on String, it works fine on Xcode7 beta5. However, I upgraded to beta 6 yesterday. It seems Swift syntax has some changes. There are some errors while compiling my code.

enter image description here

==================================================

Yes. it shows which methods I should use and also finds some information on apple website. https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS81APIDiffs/modules/Swift.html

When I change the "distance" => "distanceTo". I got the error "Use of unresolved identifier 'distance to'". Does anyone know how to use "distanceTo", "advancedBy" exactly ?? enter image description here

Upvotes: 3

Views: 4418

Answers (2)

matt
matt

Reputation: 535325

What's happened is that the global functions distance and advance have been replaced by instance methods distanceTo and advancedBy.

Upvotes: 7

Alex Cheng
Alex Cheng

Reputation: 829

OK, I figure out how to use these.

enter image description here

Upvotes: 4

Related Questions