title: Swift: Declaring constant array with constant strings
body: <p>I am implementing a UITableview and I want to have an array that holds the titles for each section. </p>
  
  <pre><code>let titleOne = "Hello World"
  let titleTwo = "What's next"
  let titleThree = "Extras"
  
  let headerTitles = [titleOne, titleTwo, titleThree]
  </code></pre>
  
  <p>This is so that I can access the array in the following method:</p>
  
  <pre><code>override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -&gt; String? {
  
      return headerTitles[section]
  }
  </code></pre>
  
  <p>However when I try and declare the array as a class variable and add the static strings I get the following error:</p>
  
  <p><strong>'name.Type' does not have a member named 'titleOne'</strong></p>
  
  <p>I have read the following and understand why the above is not possible: <a href="https://stackoverflow.com/questions/24876985/class-type-does-not-have-a-member-named-variable-error-just-a-lack-of-class">&#39;Class.Type&#39; does not have a member named &#39;variable&#39; error just a lack of class variable support?</a></p>
  
  <p>Is there a way to elegantly create the array with the constant strings without using string literals in the array and also without doing it in a method? I am thinking maybe a Struct? Or is this overkill?</p>
  
  <p>Thanks.</p>