title: Swift: How to access variable element of an enum?
body: <p>For hours I've been struggeling with getting an variable element of an enum.</p>
  
  <p>The "<a href="https://github.com/ranesr/SwiftIcons" rel="nofollow noreferrer" title="SwiftIcons">Swifticons</a>" - pod provides me with the following enum:</p>
  
  <pre><code>public enum WeatherType: Int {
      static var count: Int {
          return weatherIcons.count
      }
  
      public var text: String? {
          return weatherIcons[rawValue]
      }
  
      case alien, barometer, celsius, owm300, owm301, owm302, and200moreOfTheseNames
  }
  
  private let weatherIcons = ["\u{f075}", "\u{f079}", and202moreOfTheseFontCharacters]
  </code></pre>
  
  <p>From an external API (<a href="https://openweathermap.org/forecast5" rel="nofollow noreferrer" title="openWeatherMap.org">openWeatherMap.org</a>) I just get an weather code (let's say "300") - and I want to access Icon "owm300".</p>
  
  <p>But how do I access this element of the enum without knowing the rawValue (which would be - say - 198)?</p>