title: Using Swift, how do I disable the keyboard from popping up?
body: <p>I am writing an application in Swift 3.0 using xCode.</p>
  
  <p>When I press a textbox, I only want the picker view to show; so, why does the keyboard show with it?
  How can I disable it from popping up?</p>
  
  <p>Here is the iPhone without touching the textbox:
  <a href="https://i.stack.imgur.com/R0kUu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R0kUu.png" alt="picture one"></a></p>
  
  <p>Here is the iPhone when I touch the textbox:</p>
  
  <p><a href="https://i.stack.imgur.com/bVAU9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bVAU9.png" alt="picture two"></a></p>
  
  <p>Here is my code for the view controller:</p>
  
  <pre><code>//the arrays for the height textbox
  var heightInFeet = ["4\' 8\"", "4\' 9\"", "4\' 10\"", "4\' 11\"", "5\'", "5\' 1\"", "5\' 2\"", "5\' 3\"", "5\' 4\"", "5\' 5\"", "5\' 6\"", "5\' 7\"", "5\' 8\"", "5\' 9\"", "5\' 10\"", "5\' 11\"", "6\'", "6\' 1\"", "6\' 2\"", "6\' 3\"", "6\' 4\"", "6\' 5\"", "6\' 6\"", "6\' 7\"", "6\' 8\""]
  var heightInMeters = ["1.42", "1.44", "1.46", "1.48", "1.5", "1.52", "1.54", "1.56", "1.58", "1.6", "1.62", "1.64", "1.66", "1.68", "1.7", "1.72", "1.74", "1.76", "1.78", "1.8", "1.82", "1.84", "1.86", "1.88", "2.0", "2.2"]
  var pickerArray = [String]()
  
  //the array for the activity level textbox
  var activityLevel = ["None/Sedentary", "Light/Low", "Moderate/Active", "High/Very Active"]
  </code></pre>
  
  <p>...</p>
  
  <pre><code>func numberOfComponents(in pickerView: UIPickerView) -&gt; Int {
      return 1
  }
  
  func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -&gt; Int {
      var countrows : Int = pickerArray.count
  
      if pickerView == pickerViewForActivityLevel{
          countrows = self.activityLevel.count
      }
      return countrows
  }
  
  func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -&gt; String? {
      if pickerView == pickerViewForHeight{
          let titleRowForHeight = pickerArray[row]
          return titleRowForHeight
      }
      else if pickerView == pickerViewForActivityLevel{
          let titleRowForActivityLevel = activityLevel[row]
          return titleRowForActivityLevel
      }
      return ""
  }
  
  func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
      if pickerView == pickerViewForHeight{
          self.heightTextBox.text = self.pickerArray[row]
          self.pickerViewForHeight.isHidden = true
      }
      else if pickerView == pickerViewForActivityLevel{
          self.activityLevelTextBox.text = self.activityLevel[row]
          self.pickerViewForActivityLevel.isHidden = true
      }
  }
  
  func textFieldDidBeginEditing(_ textField: UITextField) {
      if (textField == self.heightTextBox){
          self.pickerViewForHeight.isHidden = false
      }
      else if (textField == self.activityLevelTextBox){
          self.pickerViewForActivityLevel.isHidden = false
      }
  }
  
  @IBAction func heightSwitchAction(_ sender: UISwitch) {
      if heightUnitsSwitch.isOn{
          heightUnits.text = "Feet (ft)"
          pickerArray = []
          pickerArray.append(contentsOf: heightInFeet)
      }
      else{
          heightUnits.text = "Meters (m)"
          pickerArray = []
          pickerArray.append(contentsOf: heightInMeters)
      }
  }
  </code></pre>
  
  <p>Thanks in advance.</p>