title: iOS - 'val' is inaccessible due to 'internal' protection level(from my pod)
body: <p>So i have built a pod and i am trying to use it in my project.
  I have this data struct :</p>
  
  <pre><code>public struct Device {
    public init() {}
  
    var id: String = ""
    var serial: String = ""
    var account: String = ""
    var name: String = ""
    var isAttached: Bool?
    var isShared: Bool?
  }
  </code></pre>
  
  <p>I have this func in the parser:</p>
  
  <pre><code>func getDevices(json: JSON) -&gt; [Device] {
      var devices = [Device]()
  
      for device in json.arrayValue {
          var item = Device()
          item.account = device["account"].string!
          item.id = device["id"].string!
          item.isAttached = device["isAttached"].boolValue
          item.isShared = device["isShared"].boolValue
          item.name = device["name"].string!
          item.serial = device["serial"].string!
          devices.append(item)
      }
      return devices
  }
  </code></pre>
  
  <p>and this method in the api class:</p>
  
  <pre><code>func getDevices( success: @escaping ([Device]) -&gt; Void, failure: @escaping (String) -&gt; Void) {
  
      let headers: HTTPHeaders = [
          "Authorization": "Bearer \(UserDefaults.standard.string(forKey: "accessToken")!)",
          "X-Account-ID": UserDefaults.standard.string(forKey: "accountToken")!
      ]
  
      Alamofire.request(Constants.Url.PENDING_DEVICE, method: .get, parameters: nil, encoding: JSONEncoding.default, headers: headers).validate().responseJSON { response in
          if response.result.isSuccess {
              guard let data = response.data else { return }
              let json = JSON(data)
              self.devices = self.helper.getDevices(json: json)
              success(self.devices)
          }
  
          if response.result.isFailure {
              print("status code is:\(String(describing: response.response?.statusCode))")
              let error : Error = response.result.error!
              print(error.localizedDescription)
              failure(error.localizedDescription)
          }
      }
  }
  </code></pre>
  
  <p>yet when i use it in the project like so :</p>
  
  <pre><code>    self.requestManager.getDevice(success: { (devices) in
              for device in devices {
                  var item = Device()
                  item = device
                  item.name //'name' is inaccessible due to 'internal' protection level error
  
          }
      }) { (error) in
          //
      }
  </code></pre>
  
  <p>in other struct i have created this works perfect , any ideas? i thought     public init() {}
   is the one to fix this issue. </p>