title: iOS Swift, is there a way to make the UIPickerView smaller? It is taking half of the page and the entire width
body: <p>I have a UIPickerView and it's gigantic by default and I'm not able to resize it.</p>
  <p>below functions only resize the part that is selected but I want to make the entire picker view smaller. I don't need to see much of what's above and below the selected item. What would be the best way to do so folks? Thank you!!</p>
  <pre><code>func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -&gt; UIView {
      let view = UIView(frame: CGRect(x: 0, y: 0, width: 50, height:30))
      let label = UILabel(frame: CGRect(x: 0, y: 0, width: 50, height:30))
      label.text = speakerCount[row]
      view.addSubview(label)
      return view
  }
  
  func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -&gt; CGFloat {
      return 30
  }
  </code></pre>