LoginSignup
36
37

More than 5 years have passed since last update.

Xcodeのリファクタリング機能を使ってファイル名変更

Last updated at Posted at 2014-08-04

『ファイル名、変えたい時が変えどきよー。』っていうことで。

実際にやってみる

変更したいファイル開く

ViewController.h 開く

クラス名選択し右クリック


#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@end

ViewControllerを選択して右クリック

Refactor > Rename

リネームのフォームが出てくるので StartViewController に変更。 Reviewクリック
影響ファイルの一覧を表示してくれるので確認して Saveクリック
戻せるようにスナップショット取るか確認されるので Enableクリック

ファイル名が変わっていることを確認

ViewController.h → StartViewController.h
ViewController.m → StartViewController.m

ビルドして問題ないことを確認。

意外に簡単。

36
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
36
37