VRAwesome
VRAwesome

Reputation: 4803

What is other option available in swift instead of refactoring and renaming class or attribute name?

When I was truing to rename my class in swift it will show error like below.

Rename Class or Attribute

Swift-Refacoring

I just want to know that, in Objective C it allow us to rename class name, then why it not available in Swift, or any other way to do the same.

If there is any good way then please suggest me.

Thanks.

Upvotes: 9

Views: 2370

Answers (1)

Luca Angeletti
Luca Angeletti

Reputation: 59496

At present Xcode doesn't support cross-file refactoring

It can rename a method, function, variable... but only within the same file though.

To do it

  1. Put the cursor on the member you want to rename
  2. press ctrl + cmd + e
  3. change the member
  4. all the references within the same file will be updated in realtime

But it doesn't updated references from other files. For this we need to wait for a future version of Xcode.

Upvotes: 12

Related Questions