title: Getting the URL in SLComposeServiceViewController in a Share Extension for Safari on iOS
body: <p>This question may have been asked previously in a different form, but I am attempting a slightly deeper attempt at understanding Share extensions and therefore, this question has more detail than the previously asked version of this question.</p>
  
  <p>When writing a Share Extension, we can subclass SLComposeServiceViewController and get the viewDidLoad() and didSelectPost() events among others, but the only properties on the VC are contentText and textView and placeholder properties according to Apple documentation </p>
  
  <p><a href="https://developer.apple.com/library/prerelease/ios/documentation/Social/Reference/SLComposeServiceViewController_Class/" rel="noreferrer">https://developer.apple.com/library/prerelease/ios/documentation/Social/Reference/SLComposeServiceViewController_Class/</a></p>
  
  <p>Given that this is the case, what is the best way of doing the following :</p>
  
  <p>Firstly, populating the VC that appears with the URL of the website </p>
  
  <p>Secondly, Accessing the URL to pass to the sharedDefaults as follows </p>
  
  <pre><code>let shareDefaults = NSUserDefaults(suiteName: "groupName")
  shareDefaults?.setObject(self.contentText, forKey: "stringKey")
  shareDefaults?.synchronize() 
  </code></pre>
  
  <p>so as to be able to save it for later access from the app.</p>
  
  <p>Any help regarding getting the URL would be greatly appreciated.</p>