title: How to use a Typealias or Closure to define a constant with a parameter for name in swift?
body: <p>In Objective C I used to define constants using #defines as a way to quickly and explicitly define strings for localization and keep the code a little more clean. </p>
  
  <p>For example:</p>
  
  <pre><code>#define DefineStringKey(x) static NSString *const x = @#x
  </code></pre>
  
  <p>This would let me define in constants that are named the same as the string 
  so <code>DefineStringKey(@"IntroTitle");</code> would create a constnat called <em>IntroTitle</em> with the value <em>IntroTitle</em> that I could refer to within my code (autocomplete and all). </p>
  
  <p>I had an idea that I might be able to do the same in Swift but I can't seem to get the syntax correct using typealias or closures.</p>
  
  <p>Type Alias </p>
  
  <pre><code>typealias DefineStringKey:(x:String) = let x:String = x 
  </code></pre>
  
  <p>Closure</p>
  
  <pre><code>let DefineStringKey:(String) = (String) -&gt; () {
     (x:String) in
     let x:(String) = x
  }
  </code></pre>
  
  <p>Clearly both examples I gave are incorrect. Is this something I can do in Swift via another method or is my syntax just off. </p>
  
  <p><em>Edited to add a use case.</em></p>