title: How can I create a static computed property that computes only once?
body: <p>I've created a computed static property for which I'd like to have it computed once and whenever accessed after then will just return the original computed value. <code>lazy</code> properties appear to be what I want but after a bit of searching it appears static properties are <code>lazy</code> by default.</p>
  
  <p>When I run the following code it comes out fine the first time it is accessed/ if I run each unit test individually. However when I access this a 2nd time I'm given an empty array.</p>
  
  <pre><code>static var att: [ConferenceNumber] = {
      let list = buildDirectory(for: .att, from: jsonArray)
      return list
  }()
  
  private static let jsonArray: [Any]? = {
      let numbersFilePath = Bundle.main.path(forResource: "numbers", ofType:"json")
      let data = try! Data(contentsOf: URL(fileURLWithPath:numbersFilePath!), options: .uncached)
  
      return try! JSONSerialization.jsonObject(with: data) as? [Any]
  }()
  </code></pre>
  
  <p><strong>Code where this is called a 2nd time and returns an empty array</strong></p>
  
  <pre><code>private static func isAttMeeting(meetingText: String, parsedPhoneNumbers: [String]) -&gt; Bool {
      let attPhoneNumbers = ConferenceNumberDirectory.att.map{$0.number}
      let attNumberWasParsed = parsedPhoneNumbers.intersects(with: attPhoneNumbers)
      if attNumberWasParsed {
          return true
      }
      return meetingText.contains(pattern: attURLRegex) || meetingText.contains(pattern: attURLRegex2)
  }
  </code></pre>