You can use an Apple Wireless Keyboard (available separately) to enter text on your iPhone. The keyboard connects via Bluetooth, so you must first pair it with iPhone.
Pair an Apple Wireless Keyboard with iPhone. Turn on the keyboard, go to Settings > Bluetooth and turn on Bluetooth, then tap the keyboard when it appears in the Devices list.
Once it’s paired, the keyboard reconnects to iPhone whenever it’s in range—up to about 30 feet (10 meters). When it’s connected, the onscreen keyboard doesn’t appear.
Save your batteries. Turn off Bluetooth and the wireless keyboard when not in use. You can turn off Bluetooth in Control Center. To turn off the keyboard, hold down the On/off switch until the green light goes off.
Unpair a wireless keyboard. Go to Settings > Bluetooth, tap next to the keyboard name, then tap “Forget this Device.”
See Bluetooth devices.