Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename storyboard and have links from other storyboards preserved

Tags:

xcode

ios

I have two storyboards in Xcode project.

First named Main and second Settings. Main storyboard has storyboard reference to Settings.

I want to rename Settings storyboard to AppSettings. But when I rename it through Xcode Project Navigator, Main storyboard reference to Settings is not automatically updated and project fails to compile.

enter image description here

Of course, I can manually update broken reference, but I wonder is there another way of renaming storyboard in Xcode that would automatically update existing storyboard references?

like image 219
Dalija Prasnikar Avatar asked Jul 28 '16 15:07

Dalija Prasnikar


1 Answers

Yes, Xcode's Find navigator can perform a find & replace operation that includes references inside storyboards. Search for "Settings" and replace it with "AppSettings". Then click "Preview" so you can choose only the relevant instances of "Settings" to replace (I'm assuming that word will appear in unrelated places, since it's rather common.) Afterwards, you will still have to rename the file itself as usual.

Find navigator

like image 120
andyvn22 Avatar answered Oct 21 '22 03:10

andyvn22