title: How to get items from extension context in Share extension for iOS?
body: <p>Once my share extension is loaded, not everytime and not everything is visible for user immediately. The most common is that there you can see image, number of images, and content text. However there are cases where there is a lot more informations. </p>
  
  <ul>
  <li><strong>How to get access to them?</strong></li>
  </ul>
  
  <p>I know that within <code>SLComposeServiceViewController</code> there is <code>extensionContext</code> and its <code>inputItems</code> property.</p>
  
  <p>Ok, so I stopped the debugger at time, and print out on console some things with following command:</p>
  
  <blockquote>
  <pre><code>po (extensionContext!.inputItems[0] as! NSExtensionItem).userInfo![NSExtensionItemAttachmentsKey]
  </code></pre>
  </blockquote>
  
  <ul>
  <li><strong>Is it correct way to do this?</strong></li>
  <li><strong>Is there usually one input item?</strong></li>
  </ul>
  
  <p>there was two <code>NSItemProvider</code> objects as attachments to first <code>NSExtensionItem</code></p>
  
  <p><a href="https://i.stack.imgur.com/5fK2d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5fK2d.png" alt="enter image description here"></a></p>
  
  <p>Ok, then I print out the first of attachments:</p>
  
  <p><a href="https://i.stack.imgur.com/ddHQP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddHQP.png" alt="enter image description here"></a></p>
  
  <ul>
  <li><strong>How to get that image from that <code>NSItemProvider</code> and url from the next one?</strong> Can you deliver some code?</li>
  </ul>
  
  <p>I suppose we will use </p>
  
  <pre><code>loadItemForTypeIdentifier(_:options:completionHandler:)
  </code></pre>
  
  <p>but do not know how.</p>