iOSAlert customization

I am working with the sample iOSAlert project and am trying to figure out if I can customize it in 2 ways:

  1. Include some default text in text field
  2. display the numeric keyboard instead of the default.

I will continue to dig around but would appreciate anyone can point me in the right direction.

It’s easy: you have to modify the addUsernameField and addPasswordField methods
There you can change the placeholder text and / or add a declare like:
declare sub setKeyboardType lib UIKit selector “setKeyboardType:”(o as Ptr, k as integer)
setKeyboardType(tf,4) //for a numeric keyboard

Thanks Antonio… I will try that.

Antonio…

The keyboard works great… thanks again…

But I have not been able to get the ‘placeholder’ to work… and if I understand it correctly, it does not work in the iOSAlerts sample project. In that project should the first field say “Username”? It does not when I run it.

Good catch
the selector for the placeholder must be changed in “setPlaceholder:”

Antonio…

I am not sure what you mean… the addUsernameField method it says:

declare sub setPlaceHolder lib UIKit selector “placeholder” (o as Ptr,txt as CFStringRef)
setPlaceHolder(tf,“Username”)

… but “Username” does not appear in the alert text field.

declare sub setPlaceHolder lib UIKit selector “setPlaceholder:” (o as Ptr,txt as CFStringRef)

I see… Now I understand… thanks again.