I want to make an external keyboard for my iphone and ipad. Is the arduino leonardo is the right choice for my project?
If they have a USB port and you can plug in a USB keyborad and have it work then Yes.
I don't think you can use a USB keyboard on an IOS device. Usually you would use a Bluetooth keyboard. I don't know of a way to make an Arduino act as a Bluetooth keyboard. I would be tempted to take the electronics from a Bluetooth keyboard and connecting your keyboard to the electronics in place of the keyboard matrix I discarded. The Arduino can emulate a keyboard matrix using some 4051 or 4052 8-way analog multiplexer/selectors.