title: How to get image file size in Swift?
body: <p>I am using </p>
  
  <pre><code>UIImagePickerControllerDelegate,
  UINavigationControllerDelegate,
  UIPopoverControllerDelegate
  </code></pre>
  
  <p>these delegates for choosing image from my gallery or my camera. So, how can I get image file size after choosing an image?</p>
  
  <p>I want to use this:</p>
  
  <pre><code>let filePath = "your path here"
      var fileSize : UInt64 = 0
  
      do {
          let attr : NSDictionary? = try NSFileManager.defaultManager().attributesOfItemAtPath(filePath)
  
          if let _attr = attr {
              fileSize = _attr.fileSize();
              print(fileSize)
          }
      } catch {
      }
  </code></pre>
  
  <p>but here I need a path, but how can I get without a path, just by image file?</p>