title: set properties on rectangle request. iOS, Swift
body: <p>Im trying to set properties on a rectangle request.
  Im trying to set minimum size, aspect ratio and others but get the error below.</p>
  
  <blockquote>
    <p>Fatal error: Attempted to read an unowned reference but the object was already deallocated2018-08-13 16:08:09.081049+0100 app[4000:1277980] Fatal error: Attempted to read an unowned reference but the object was already deallocated</p>
  </blockquote>
  
  <pre><code>func performVisionRequest(image: CGImage, orientation: CGImagePropertyOrientation) {
  
      DispatchQueue.global(qos: .userInitiated).async {
          do {
              let imageRequestHandler = VNImageRequestHandler(cgImage: image, orientation: orientation, options: [:])
              try imageRequestHandler.perform(
                  [VNDetectRectanglesRequest(completionHandler:{ req, err in
                      self.rectanglesRequest(request:req, error:err)
  
                  })]
              )
          } catch let error as NSError {
              self.sliceCompletion([UIImage]())
              print("Failed to perform vision request: \(error)")
  
          }
      }
  }
  
  func rectanglesRequest(request: VNRequest, error: Error?) {
      if let err = error as NSError? {
          noRect = true
          var slices = [imageNo]
          self.sliceCompletion(slices as! [UIImage])
          slices = []
          print("Failed during detection: \(err.localizedDescription)")
          return
      }
      unowned let rectanglesRequestSet = VNDetectRectanglesRequest()
  
      rectanglesRequestSet.minimumSize = 0.07
      rectanglesRequestSet.minimumAspectRatio = 0.2
      rectanglesRequestSet.maximumAspectRatio = 0.3
      rectanglesRequestSet.quadratureTolerance = 22.0
  </code></pre>