⬆️ ⬇️

We do our job in Xcode a little more efficiently.

Software development is a very interesting process that we all really like, but there are some things that are too monotonous. Today I would like to talk about how I simplified my workflow in Xcode with the help of various third-party plug-ins.



Integration :)



I ask interested under kat



')

Where do we start?





I advise you to start by installing the package manager for Xcode - Alcatraz . You can install it by executing just one command in Terminal.app:

curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh 




So, restart Xcode, click Window-> Package Manager. Now we got a UI to manage our plugins. Already well (terminal lovers can continue to do everything through the console).



Alcatraz window



Imports?





Importing files into Objective-C is a pretty tedious operation. Imagine the situation: you are knee-deep in code, and here you need to import another class. You scroll to the very top of the * .m file or go to * .h. After that, write # import ... and come back.



To solve this problem - just install the plug-in Auto-Importer . Restart Xcode, start typing a class that has not yet been imported, press Ctrl + Cmd + H, voila:

image



And now just press Return and the class is imported. In my opinion, this is very cool.



Tired of black color?





The console is a powerful debugging tool, but there is always a lack of the ability to somehow highlight very important messages. With this, the XcodeColors plugin will help us, which will add color to the output:

image



As you can see in the screenshot, I highlighted the requests sent from the application in blue (implemented via the NSURLProtocol. If you are interested in how to implement this, write, I will make a separate post), and the red-processed SSE events are highlighted in red.



To do this, it is enough to install the plugin and add the line to your * .pch file:

 #define LogRed(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg255,0,0;" frmt XCODE_COLORS_RESET), ##__VA_ARGS__) 




As can be seen from the code:

255,0,0 - RGB colors (you can even draw a rainbow in the console, if you try)

LogRed - just defyne, to continue to make red logs



As a result, we have:

 LogRed(@"My string: %@", string); 




For a snack





A very handy was a set of extensions for Quick Look , which allow you to immediately format JSON, display the size of images, add syntax highlighting, and more.



I hope that the post was useful and I did not waste your valuable time. We are happy to answer any questions in the comments.

Source: https://habr.com/ru/post/253827/



All Articles