ios – Cursor does not appear on initial click in UITextField – Swift


I have a custom cell with 3 UITextFields. They are all set up the same way just with different ways. 2/3 work perfectly, the cursor shows on initial click and the keyboard pops up. The tricky one (weightTextField) does not work as expected. The cursor does not show on initial click, but the keyboard does pop up, and the cursor appears as soon as the user types the first character.
[Storyboard Setup for Custom Cell]

 
   var currentWorkoutSet: WorkoutSet!
   
   @IBOutlet weak var setNumLabel: UILabel!
   @IBOutlet weak var repsTextField: UITextField!
   @IBOutlet weak var weightTextField: UITextField!
   @IBOutlet weak var rpeTextField: UITextField!
   
   static let identifier = "WorkoutViewCell"
   
   static func nib() -> UINib {
      return UINib(nibName: "WorkoutViewCell", bundle: nil)
   }
   
   
   override func awakeFromNib() {
      super.awakeFromNib()
      
      // Initialization code
      if let item = currentWorkoutSet {
         item.reps = 0
         item.weight = 0.0
         item.rpe = 0.0
      }
      initTextFields()
   }
   
   func initTextFields() {
      repsTextField.keyboardType = UIKeyboardType.decimalPad
      weightTextField.keyboardType = UIKeyboardType.decimalPad
      rpeTextField.keyboardType = UIKeyboardType.decimalPad
      
   }

I have tried resetting the connection between the text fields, checking the setup between the 3, checking the settings in the storyboard for the text fields, and reading the docs for textFields and cursor.
I would like a couple more things to try or a way to manually show the cursor when the user clicks on the textField.
Any help is appreciated.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img