Xcode只能重构C和Objective-C代码。如何在Xcode 6中重命名swift类名? [英] Xcode can only refactor C and Objective-C code. How to rename swift class name in Xcode 6?

查看:275
本文介绍了Xcode只能重构C和Objective-C代码。如何在Xcode 6中重命名swift类名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode 6 beta版中创建了一个新的单视图应用程序项目。我想将swift类从 ViewController.swift 重命名为其他名称。但是当我选择Refactor - > Rename时,它会给出错误 Xcode只能重构C和Objective-C代码

I have created a new Single View Application Project in Xcode 6 beta version. I want to rename swift class from ViewController.swift to some other name. But when I select Refactor -> Rename, it gives error Xcode can only refactor C and Objective-C code.

任何想法如何在Xcode 6中重命名swift类?

Any idea how to rename swift class in Xcode 6?

更新:

最后Xcode 9是支持Swift的重构。 Apple花了3年时间才添加这个基本功能。 重构

Finally Xcode 9 is supporting Refactoring for Swift. It took Apple 3 years to add this basic feature. Refactoring

推荐答案

您可以在Xcode6右侧的File Inspector中更改类的名称。

You can change name of a class in File Inspector at the right side of Xcode6.


  • 打开你的课程

  • 转到文件检查器>识别并输入部分

  • 在name字段中重命名现有的类。

这就是全部!以前我手动重命名类文件中的类名。

That's all! Previously I manually rename the class name in the class file.

这篇关于Xcode只能重构C和Objective-C代码。如何在Xcode 6中重命名swift类名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆