Re-indent selected code in Xcode
Xcode provides support for a lot of useful keyboard shortcuts to speed up our development process.
Often when we copy code from somewhere, it comes with the wrong indentation.
We can re-indent selected code in Xcode by pressing Ctrl
+ I
.
To re-indent the whole file: Command
+ A
then Ctrl
+ I
.
If you're an experienced Swift developer looking to learn advanced techniques, check out my latest book Swift Gems. It’s packed with tips and tricks focused solely on the Swift language and Swift Standard Library. From optimizing collections and handling strings to mastering asynchronous programming and debugging, "Swift Gems" provides practical advice that will elevate your Swift development skills to the next level. Grab your copy and let's explore these advanced techniques together.