title: Unable to get the listing of files / objects in S3 bucket ; iOS - Swift
body: <p>I am trying to get the list of objects in an S3 bucket. Below is the code but it doesn't seems to be working , neither is it throwing an error. However, the S3 object seemed to be (0x000000000) uninitialised.
  I am not sure what's the mistake because the configuration is working for uploading a file to the bucket.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class Configuration {
      let accessKey = Constants.AWS_KEY
      let secretKey = Constants.AWS_SECRET
      let bucket = Constants.AWS_BUCKET
      
      static let instance = Configuration()
      
      private init() {
          let credentialsProvider = AWSStaticCredentialsProvider(accessKey: accessKey, secretKey: secretKey)
          let configuration = AWSServiceConfiguration(region: AWSRegionType.USEast1, credentialsProvider: credentialsProvider)
          AWSServiceManager.default().defaultServiceConfiguration = configuration
          AWSS3.register(with: configuration!, forKey: "defaultKey")
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class S3Browser {
      
      static let configuration = Configuration.instance
      static func getList(path:String) {
          
  
          let s3 = AWSS3.s3(forKey: "defaultkey")
         
          let listRequest: AWSS3ListObjectsRequest = AWSS3ListObjectsRequest()
          //listRequest.prefix = path
          listRequest.bucket = Constants.AWS_BUCKET
         
          s3.listObjects(listRequest).continueWith { (task) -&gt; AnyObject? in
  
             for object in (task.result?.contents)! {
                 
                 print("Object key = \(object.key!)")
             }
             
             return nil
          }
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>All the keys and secrets are working for upload.
  Kindly share some pointers. </p>