Searching for and Replacing Text

In any kind of text editing—code or otherwise—you often need to find certain strings, or to search for and replace some or all occurrences of a string. And of course, Xcode supports this.

Within a given source file, use Find > Find (F) to bring up a search bar at the top of the content pane, as seen in the following figure. You can use the pop-up menu on the left side to switch between finding and replacing, or look at your recent search terms. There are also buttons for setting case sensitivity and type of match to perform (contains the term, matches a word, etc.). Pretty much the same as any other text editor.

Using the Find Navigator

There’s a much more powerful search feature over in the left pane. Use ...

Get Xcode Treasures now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.