title: About .h and .m files (how to manage)
body: <p>Hey experienced programmers!</p>
  
  <p>Id like to ask you something about clean code :)</p>
  
  <p>Id like to keep my code clean and make it nice, so thats my questions:</p>
  
  <p>1)Where should I put #imports?
  My principles: (and i dont think that they are good)</p>
  
  <ul>
  <li>#import Frameworks should be always in .h</li>
  <li>#import .h files should be always in .m</li>
  <li>.h files should have only @class, not imports (excluding frameworks like UIKit, etc)</li>
  <li><p>Delegates should be in .m </p>
  
  <pre><code>@interface ViewController() &lt;UIAlertViewDelegate&gt; 
  @end
  </code></pre></li>
  </ul>
  
  <p>2)Where should I put my instance variables?</p>
  
  <ul>
  <li>Private and Protected variables must be in .m</li>
  <li>Public must be in .h</li>
  </ul>
  
  <p>3)Where should I put my methods?</p>
  
  <ul>
  <li>Public in .h</li>
  <li>Private in .m
  (And yeah I know that my "Private methods" are not really private, just hidden)</li>
  </ul>
  
  <p>(btw thats pretty obvious)</p>
  
  <p>4)What about #defines?</p>
  
  <ul>
  <li>Global - always in .h </li>
  <li>Used only in that class - always in .m</li>
  </ul>
  
  <p>5)Where should I put NSNotification global identifiers and how to organize them</p>
  
  <ul>
  <li>#define NSNotificationDataSourceDidLoadData @"NSNotificationDataSourceDidLoadData" in .h file in the class that will send this notification</li>
  </ul>
  
  <p>But ....</p>
  
  <ul>
  <li>Apple has a lot of private things in .h file</li>
  <li>In most cases my .h files are just.. EMPTY :)</li>
  </ul>
  
  <p>A year ago I had another situation - <strong>everything</strong> was in .h, but I think it is bad also</p>
  
  <p>What to do? What principles are you using?
  Thank you!</p>
  
  <p>Thats a questions about coding style, not about "how to make it compilable"</p>