While writing code in Objective-C, I always like to divide my code into sections using #pragma mark <Section title>, This divides my code into several section with each section containing methods relevant to that section itself.
This will make your code more organised. It will make searching in the code very easy because now you know in which section you have to search. It also adds Section Title entry in the top jump bar so with its use, your jumpbar becomes very handy.
One very useful use case:
Whenever I write a class which implements many delegates and dataSources, then what I do is that I divide each dataSources' and delegates' methods into separate section with section title to be the name of the delegate/dataSource. Now whenever I want to go to some delegate method, I can directly jump to that section.
Jumping to a section also becomes easy because Section Title you mention in #pragma mark is also searched when you search top jumpbar.
Example:
I will give example from one of the most popular networking library: AFNetworking. This library uses pragma marks and thus whenever I have to look into their code, it becomes very easy to search through the methods or to go to a particular method.
So if you look at this file, you will find #pragma marks in this. Because of this, you will get titles in jumpbar as shown in following image:
This will make your code more organised. It will make searching in the code very easy because now you know in which section you have to search. It also adds Section Title entry in the top jump bar so with its use, your jumpbar becomes very handy.
One very useful use case:
Whenever I write a class which implements many delegates and dataSources, then what I do is that I divide each dataSources' and delegates' methods into separate section with section title to be the name of the delegate/dataSource. Now whenever I want to go to some delegate method, I can directly jump to that section.
Jumping to a section also becomes easy because Section Title you mention in #pragma mark is also searched when you search top jumpbar.
Example:
I will give example from one of the most popular networking library: AFNetworking. This library uses pragma marks and thus whenever I have to look into their code, it becomes very easy to search through the methods or to go to a particular method.
So if you look at this file, you will find #pragma marks in this. Because of this, you will get titles in jumpbar as shown in following image:
In this image, you can check that it has shown all the mark mark titles in the jump bar which make jumping to a particular method very easily.
So, if you are looking for the implementation of the methods of NSSecureCoding protocol, you can simply search for secure in the jump bar and it will show you NSSecureCoding mark on which you can click to go to that section directly.