title: Instance member cannot be used on instance of nested type between struct swift
body: <p>I am trying to pass the variable <em>code</em> from struct <em>FormularyDetail</em> to a nested struct <em>WebView</em> but keep on receiving error of</p>
  <blockquote>
  <p>Instance member 'code' of type 'FormularyDetail' cannot be used on instance of nested type 'FormularyDetail.WebView'.</p>
  </blockquote>
  <p>My swift code is as below:</p>
  <pre><code>struct FormularyDetail: View {
      var drugmaster: DrugMaster
      var code: String  {
          get {
              return drugmaster.code
          }
      }
  
      let testHTML = Bundle.main.url(forResource: &quot;www/index&quot;, withExtension: &quot;html&quot;)
      struct WebView: UIViewRepresentable {
          
          let request: URLRequest
          static var codein: String {
              get {
                  return FormularyDetail.code //I got the error on this line
              }
          }
  ...
  </code></pre>
  <p>Any help are appreciated.</p>