Skip to content

Instantly share code, notes, and snippets.

@EddyVerbruggen
Last active January 25, 2017 20:29
Show Gist options
  • Save EddyVerbruggen/860d81a20b245b117f412c59c8175e44 to your computer and use it in GitHub Desktop.
Save EddyVerbruggen/860d81a20b245b117f412c59c8175e44 to your computer and use it in GitHub Desktop.
export class PinComponent implements OnInit {
// according to Apple's documentation ID 4 is the value 'numberPad' of their keyboard type enum
const IOS_KEYBOARDTYPE_NUMBERPAD: number = 4;
// assuming you have a TextField / TextView with '#pincodeField' in your view
@ViewChild("pincodeField") pincodeField: ElementRef;
ngOnInit(): void {
if (this.pincodeField.nativeElement.ios) {
this.pincodeField.nativeElement.ios.keyboardType = IOS_KEYBOARDTYPE_NUMBERPAD;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment