最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【基本解决】xcode 7中重命名Swift变量

Xcode crifan 3392浏览 0评论

1.xcode 7中,想要去给Swift变量重命名。

找到了右键有rename:

select variable right click refactor rename

结果竟然是不支持Swift的重构:

can not refactor swift code xcode can only refactor c and objective-c code

 

2.不过后来自己去折腾期间,发现一个算是窍门:

双击变量后,鼠标移动到变量的末尾处,变量右边会出现个下拉三角:

select variable right side show list icon

点击后,可以出现:
Edit In All Scope

click list show choose Edit In All Scope

 

然后选中后,即可去,批量的重命名变量了:

xcode batch rename variable in scope

 

【总结】

Xcode 7中暂时不支持Swift代码的重构(包括重命名)

但是暂时可以通过:

选中变量,鼠标往单词的右边处移动时,可以出现下列按钮,点击后,选中Edit In All Scope,即可更改变量名称,基本实现重命名的效果了。

转载请注明:在路上 » 【基本解决】xcode 7中重命名Swift变量

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.183 seconds, using 22.15MB memory