You can use an Apple Wireless Keyboard (available separately) for typing on iPhone. The Apple Wireless Keyboard connects via Bluetooth, so you must first pair it with iPhone. See Pairing Bluetooth devices.
Once the keyboard is paired, it connects whenever the keyboard is within range of iPhone—up to about 33 feet (10 meters). When a wireless keyboard is connected, the onscreen keyboard doesn’t appear when you tap a text field. To save the battery, turn off the keyboard when not in use.
Switch the language when using a wireless keyboard: Press Command–Space bar to display a list of available languages. Press the Space bar again while holding down the Command key to choose a different language.
Turn off a wireless keyboard: Hold down the On/off switch on the keyboard until the green light goes off.
iPhone disconnects the keyboard when the keyboard is turned off or out of range.
Unpair a wireless keyboard: Go to Settings > Bluetooth, tap
next to the keyboard name, then tap “Forget this Device.”