Xcode 9: Swift Refactoring
·1 min
Xcode 9 adds Swift refactoring support, something Swift developers have been asking for since Swift’s introduction. Choose Editor > Refactor to access the refactoring options. Xcode 9 has the following refactoring options:
- Rename
- Extract function
- Extract method
- Extract variable
- Extract all occurrences
- Add missing abstract class overrides
- Add missing protocol requirements
- Add missing switch cases
- Convert to switch statement
- Expand default
- Generate missing function definitions
- Wrap in NSLocalizedString
I haven’t had the chance to use the refactoring tools much so I can’t provide more detailed information on the Swift refactoring options. You can find more information on Swift refactoring in the following article on the Swift language website: