I'm developing custom iOS keyboard for a language that iPhone doesn't support yet. I want to replicate default L&F as much as possible. I've found that default ios keyboard could be treated as the static image with additional image drawing when the user touches the keyboard.
I want my keyboard to consume as low resources as possible. There will be 40 buttons displayed simultaneously. What the correct approach should be? I can see the following different approaches:
Draw entire keyboard to UIImage (or CGImage) at application startup (or even just store it in the application bundle) and display it in the view controller. When user touches keyboard, it adds CALayer and positions it in the right place.
Use hierarchy of CALayers. Each button is treated as separate CALayer. The button is just a rounded rectangle with shadow and text in the center.
Use hierarchy of UIButtons.
3-rd variant seems to be the most natural approach, but it introduces 40 UIButtons with corresponding internal structures. 1-st variant seems to me like the lightest one, but not very versatile, if I decide to change something. I don't know how much memory do CALayers consume, so I'm not sure about 2-nd variant.