title: iOS: Detect or disable multiple image selection
body: <p>We have a UIWebview with an image attachment control.</p>
  
  <p><a href="https://i.stack.imgur.com/wJhGw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wJhGw.png" alt="enter image description here"></a></p>
  
  <p>We the user taps the control an iOS action sheet pops up.</p>
  
  <p><a href="https://i.stack.imgur.com/M9JRV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M9JRV.png" alt="enter image description here"></a></p>
  
  <p>When the user taps 'Browse' or 'Photo Library' the user can select multiple images.</p>
  
  <p><a href="https://i.stack.imgur.com/ZRq4b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZRq4b.png" alt="enter image description here"></a></p>
  
  <p>I then intercept the </p>
  
  <p><code>- (void)imagePickerController: didFinishPickingMediaWithInfo:</code> call with my own ImagePickerViewController that has been swizzled in.</p>
  
  <p>So, my question: In <code>didFinishPickingMediaWithInfo</code>, is it possible to detect that multiple images have been selected? If not, is there a way to force the image selection on the iOS side to only allow one image?</p>
  
  <p>If possible I would like to detect that multiple images have been selected, and then fall back to normal functionality (i.e. I won't swizzle).</p>
  
  <p>I did examine the picker and info that is sent to <code>didFinishPickingMediaWithInfo</code> as arguments, but even though multiple images are selected, the info parameter only has info on one image. It keeps the first selection and discards the second, and the method is not called a second time.</p>
  
  <p>Edit:
  I'm not using a 3rd party image picker.</p>