title: Resize image in Swift 4 for Webview
body: <p>I have a very simple iPhone app written in Swift 4 which basically just loads a WebView fullscreen.  All the important stuff happens via HTTP and works fine.  One part of my web pages allows users to upload photos.  After about 3 months of trying to figure out why that quit working on the latest iOS I have finally been able to get it fixed.  But now I'd like to have the images resized before they are uploaded.  I cannot figure out where to add the code to do that, as it doesn't seem like my photo is ever passing through the code.  ImagePicker runs only once when it loads and then I don't know how to get the photo itself.  Hope you can help!  Here is what runs when I select the HTTP link to choose images.</p>
  
  <pre><code>override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -&gt; Void)? = nil) {
      imagePicker.dismiss(animated: true, completion: nil)
  
      if viewControllerToPresent is UIImagePickerController {
          viewControllerToPresent.modalPresentationStyle = .overFullScreen
      }
      super.present(viewControllerToPresent, animated: flag, completion: completion)
  }
  </code></pre>
  
  <p>After choosing the images in picker it should resize them and upload the smaller photos.</p>