Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 906
VRAwesome Avatar asked Jul 15 '16 13:07

VRAwesome


1 Answers

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.

like image 188
Luca Angeletti Avatar answered Nov 07 '22 06:11

Luca Angeletti