title: swift - how to access public constants without having to instanciate class, as in C#
body: <p>Should not be needed create an instance of a class to access a public constant. I recently started working in Swift, so I must be missing something here.</p>
  
  <p>In this simple example:</p>
  
  <pre><code>public class MyConstants{
      public let constX=1;
  }
  public class Consumer{
       func foo(){
            var x = MyConstants.constX;// Compiler error: MyConstants don't have constX
       }
  }
  </code></pre>
  
  <p>This foo code gives an compile error. To work, I need to create an instance of the MyConstants like this:</p>
  
  <pre><code>public class Consumer{
       func foo(){
         var dummy = MyConstants();
         var x = dummy.constX;
      }
  }
  </code></pre>
  
  <p>Adding static to constX is not allowed.</p>