Xcode has tools for refactoring code, including renaming properties and methods. See how these refactoring tools work in this short video.
- [Instructor] Often when developing an application,…you'll need to refactor your code…by taking some code and putting it into another method,…or by changing the name of a variable.…Let's take a look at how Xcode can help you…accomplish these tasks.…If you want to refactor code into its own method,…select the code you want to refactor.…Right-click and choose Refactor, Extract Method.…Once you do that,…Xcode will actually take the code you highlighted,…and in this case, that comment,…so we get some additional code there,…so keep an eye on out that,…if you grab some extra code you didn't want to grab.…
And then you just type out the name…of the method you want to create.…Once you've done that, press Return,…and we have a call to it in the previous area,…and then we have this newly-created method.…Note that Xcode automatically puts…the fileprivate accessor for the method…so you can change that should you need to.…Let's take a look at refactoring a variable.…I'll create a variable called exampleVar…and set it equal to a string.…
- Installing Xcode
- Creating your first project
- Editing code
- Creating snippets
- Prototyping in playgrounds
- Implementing version control with Git
- Building and connecting the interface
- Compiling and debugging apps in Xcode
- Creating workspaces for sharing resources and code
Skill Level Beginner
1. Getting Started
2. Edit Code
3. Source Control
4. Interface Builder Basics
5. Compile and Debug
Create a workspace2m 51s
Next steps1m 5s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.