title: Cannot convert value of type NSSet? to expected argument type Set<HKSampleType>
body: <p>I just started learning swift 2 days ago so I apologise in advance if this may sound like a dumb question.</p>
  
  <p>I'm working on getting the basic user data from HealthKit following this tutorial: <a href="https://www.natashatherobot.com/healthkit-getting-fitness-data/" rel="nofollow">https://www.natashatherobot.com/healthkit-getting-fitness-data/</a>
  but when I compile it, I get the following error:</p>
  
  <blockquote>
    <p>Cannot convert value of type NSSet? to expected argument type
    Set &lt;'HKSampleType></p>
  </blockquote>
  
  <pre><code>func requestHealthKitAuthorization(dataTypesToWrite: NSSet?, dataTypesToRead: NSSet?) {
      healthStore?.requestAuthorizationToShareTypes(dataTypesToWrite, readTypes: dataTypesToRead, completion: { (success, error) -&gt; Void in
          if success {
              println("success")
          } else {
              println(error.description)
          }
      })
  }
  </code></pre>
  
  <p>I have tried various answers that I found online but without success.</p>
  
  <p>Any tip/idea would be greatly appreciated!</p>