3

In iOS 10.0 beta 4 for iPhone (XCode 8 beta 5), when the user taps a number pad text field or a decimal pad text field, the system's number or decimal pad is presented, instead of the one belonging to the keyboard extension. At least that's true with my keyboard extension, and with the skeleton custom keyboard extension provided by Xcode.

Also, when the user taps the Number Pad text field or the Decimal Pad text field in my test program, the console displays this message (this is the version for the number pad, which is type 4):

2016-08-11 21:58:43.007 TestNumberPad[34090:1780242] Can't find keyplane that supports type 4 for keyboard iPhone-PortraitChoco-NumberPad; using 1144316255_PortraitChoco_iPhone-Simple-Pad_Default

Here are the results of my test program. The default keyboard extension should appear in all 3 cases.

enter image description here enter image description here

enter image description here


Here are the the top part of the attribute inspector entries for my 3 text fields

enter image description here enter image description here

enter image description here

Here's ViewController.swift

import UIKit

class ViewController: UIViewController, UITextFieldDelegate {

  @IBOutlet weak var defaultField: UITextField!  // 'tag' property = 3
  @IBOutlet weak var numberField: UITextField!   // 'tag' property = 4
  @IBOutlet weak var decimalField: UITextField!  // 'tag' property = 5
  
  override func viewDidLoad() {
    super.viewDidLoad()
    defaultField.delegate = self
    numberField.delegate = self
    decimalField.delegate = self
    
    // I TRIED AN ALTERNATE TEST, WHERE I SPECIFY THE KEYBOARD TYPE PROGRAMMATICALLY, NOT IN THE IB:
    //
    // 1. IN THE INTERFACE BUILDER, SET ALL 3 KEYBOARD TYPES TO 'DEFAULT'.
    // 2. UNCOMMENT THE CODE BELOW
    //
    // UNFORTUNATELY, THE RESULTS ARE THE SAME
    //
//    defaultField.keyboardType = UIKeyboardType.default
//    numberField.keyboardType = UIKeyboardType.numberPad
//    decimalField.keyboardType = UIKeyboardType.decimalPad
  }

  func textFieldDidBeginEditing(_ textField: UITextField) {
    switch textField.tag {
    case 3: print("Tapped default field")
    case 4: print("Tapped number pad")
    case 5: print("Tapped decimal pad")
    default:
      print("Text field doesn't have a tag!!")
    }
  }
}

Finally, here's the console output when tapping, in order, the default field, the number pad field, and the decimal pad field.

Tapped default field 2016-08-12 11:13:08.561083

TestNumberPad[2201:221335] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles

2016-08-12 11:13:08.563097 TestNumberPad[2201:221335] [MC] Reading from public effective user settings.

2016-08-12 11:13:08.799888 TestNumberPad[2201:221335] [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

Tapped number pad

2016-08-12 11:13:15.070750 TestNumberPad[2201:221335] Can't find keyplane that supports type 4 for keyboard iPhone-Portrait-NumberPad; using 160517473_Portrait_iPhone-Simple-Pad_Default

Tapped decimal pad

2016-08-12 11:13:17.627520 TestNumberPad[2201:221335] Can't find keyplane that supports type 8 for keyboard iPhone-Portrait-DecimalPad; using 405786210_Portrait_iPhone-Simple-Pad_Default

The App Store Review Guidelines still require custom keyboards to furnish number pads and decimal pads, so this seems an important issue.

Community
  • 1
  • 1

1 Answers1

0

I guess you were testing on the simulator so when the keyboard is not there it gives this error in logs.

So just toggle keyboard, or use the device.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Nikhil Manapure
  • 3,748
  • 2
  • 30
  • 55
  • Alas, I was indeed testing on both simulator and devices. In fact I wound up testing only on devices in order to avoid this problem. But thanks for your input and have a good week. – LarryTheSoftwareGuy Dec 05 '16 at 16:40