title: How to parse json when collectionView is tap
body: <p>Hello I'm just wondering if there is another way to parse json data when a collection view is click and pass it to another view. This is the <a href="https://overwatch-api.net//api/v1/hero/" rel="nofollow noreferrer">API</a> im using. This is how I do it at the moment. This is how my class looks. First I create a closure. Then I created my hero class. Then I have my json parse function.  </p>
  
  <p><a href="https://i.stack.imgur.com/zK6W9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zK6W9.png" alt="enter image description here"></a></p>
  
  <p>This is how my collectionView didSelectItemAt func looks. This is where im trying to put my json parse function, or is it better to put it in the hero class. Im new to this so I don't really know.</p>
  
  <p><a href="https://i.stack.imgur.com/wY1EZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wY1EZ.png" alt="enter image description here"></a></p>
  
  <p>Not sure if I explained it well. So I'll include my viewcontroller code if needed. Would appreciate any help :)</p>