title: Make circular photos downloaded from google (google places, swift)
body: <p>I'm working with google places and i have a VC with a tableView where i downloaded nearby places from the user position and in each cell of the tableView i add the information of the place and the photo of it. I created a custom class to make the photo circular </p>
  
  <pre><code>import UIKit
  
  @IBDesignable
  class RoundImage: UIImageView {
  
  
  
      @IBInspectable var cornerRadius: CGFloat = 0 {
          didSet {
              self.layer.cornerRadius = cornerRadius
          }
      }
      @IBInspectable var borderWidth: CGFloat = 0 {
          didSet {
              self.layer.borderWidth = borderWidth
          }
      }
  
      @IBInspectable var borderColor: UIColor = UIColor.clear {
          didSet {
              self.layer.borderColor = borderColor.cgColor
          }
      }
  
  }
  </code></pre>
  
  <p>but the problem is that i download the photos of the places with this class</p>
  
  <pre><code>import UIKit
  
  private let widthKey = "width"
  private let heightKey = "height"
  private let photoReferenceKey = "photo_reference"
  
  
  class QPhoto: NSObject {
  
  
          var width: Int?
          var height: Int?
          var photoRef: String?
  
  
  
          init(photoInfo: [String:Any]) {
              height = photoInfo[heightKey] as? Int
              width = photoInfo[widthKey] as? Int
              photoRef = photoInfo[photoReferenceKey] as? String
          }
  
          func getPhotoURL(maxWidth:Int) -&gt; URL? {
              if let ref = self.photoRef {
                  return NearbyPlaces.googlePhotoURL(photoReference: ref, maxWidth: maxWidth)
              }
              return nil
          }
      }
  </code></pre>
  
  <p>and i would like to know how can i adjust it, because with this class the photos that i download even though i put the <code>RoundImage</code> class at the imageview in the storyboard are always square</p>