title: In Swift, what is the difference between the Access modifiers internal and public?
body: <p>Swift offers 5 access modifiers: <code>open</code>, <code>public</code>, <code>internal</code>, <code>fileprivate</code> and <code>private</code>.</p>
  
  <p>Of what I know about these specifiers, (mainly from <a href="https://stackoverflow.com/questions/24003918/does-swift-have-access-modifiers">link</a> &amp; <a href="https://medium.com/@ryuichi/swift-3-access-control-e8035ce8569e#.s00co3sp5" rel="noreferrer">link_2</a>)</p>
  
  <p><strong><code>open</code></strong> means classes and class members can be subclassed and overridden both within and outside the defining module (target).</p>
  
  <p><strong><code>fileprivate</code></strong> restricts the use of an entity to its defining source file. Basically accessible by multiple classes within a single file.</p>
  
  <p><strong><code>private</code></strong> restricts the use of an entity to its enclosing declaration. </p>
  
  <p>Now, public and internal seems pretty much the same to me :-</p>
  
  <p><strong><code>public</code></strong> means classes and class members can only be subclassed and overridden <em>within the defining module</em> (target).</p>
  
  <p><strong><code>internal</code></strong> enables an entity to be <em>used within the defining module</em> (target). Also, this happens to be the default specifier if nothing else is mentioned. We would typically use internal access when defining an app’s or a framework’s internal structure.</p>
  
  <p>So basically how do public and internal differ?</p>
  
  <p>This is my first Question here, so if I have missed out any details, please let me know. Thanks in advance.</p>