title: layer rounded corners on a Swift
body: <p>I tried to get a rounded corner with layer.cornerRadius  for my segmented control but it does not work for me  actually I want to get cornerRadius depending on the frame</p>
  
  <p>here is my code </p>
  
  <pre><code>func setupView(){
      layer.masksToBounds = true
  
      // here my corner radius 
      layer.cornerRadius = frame.height / 2.0
      layer.borderColor = UIColor.walkthroughOrangeAccent.cgColor
      layer.borderWidth = 2
  
      backgroundColor = UIColor.clear
  
      setupImageView()
  
      addIndividualItemConstraints(items: imageViewList, mainView: self, padding: 0)
  
      insertSubview(thumbView, at: 0)
  
  }
  </code></pre>