title: Parse email from LinkedIn v2 api
body: <p>LinkedIn’s v2 API has a separate url to get email address. The JSON response is a single object array. Can someone help me parse that object to get email address? 
  LinkedIn URL: <a href="https://api.linkedin.com/v2/emailAddress?q=members&amp;projection=(elements" rel="nofollow noreferrer">https://api.linkedin.com/v2/emailAddress?q=members&amp;projection=(elements</a>*(handle~)) returns this JSON</p>
  
  <pre><code>["elements": &lt;__NSSingleObjectArrayI 0x600000e8e760&gt;(
  {
      handle = "urn:li:emailAddress:123456789";
      "handle~" =     {
          emailAddress = "john123@gmail.com";
      };
  }
  )
  ]
  </code></pre>
  
  <p>JSON response is put into String:Any object.</p>
  
  <pre><code>if let emailOnly = response.jsonObject as? [String: Any] {
  let emailAddress = (emailOnly["elements"]
                      as? [String:Any])?["handle~"] as? String ?? ""
  print("emailaddress is -&gt;", emailAddress)
  </code></pre>
  
  <p>emailAddress is blank after the last statement.</p>
  
  <p>Here is the complete code:</p>
  
  <pre><code>linkedinHelper.requestURL("https://api.linkedin.com/v2/emailAddress?q=members&amp;projection=(elements*(handle~))", requestType: LinkedinSwiftRequestGet, success: {(response) -&gt; Void in
          if let emailOnly = response.jsonObject as? [String: AnyObject {
              let emailAddress = (emailOnly["elements"]
                  as? [String: Any])?["handle~"] as? String ?? ""
              print("emailaddress is -&gt;", emailAddress)
          }
      })
  </code></pre>