title: How can I calculate the size of a folder?
body: <p>I'm creating a folder to cache images inside Documents with my iPhone App.  I want to be able to keep the size of this folder down to 1MB, so I need to to check the size in bytes of my folder.</p>
  
  <p>I have code to calculate the <a href="https://developer.apple.com/documentation/foundation/fileattributekey/1416548-size" rel="noreferrer">size of file</a>, but I need the size of the folder.</p>
  
  <p>What would be the best way to do this?</p>