In my video on how to record external audio for DSLR video I use the GuitarJack Model 2 for iOS, RODE VideoMic. Of course you can use any interface such as the iRig, AmpKit Link, Apogee JAM. I chose to use the GuitarJack Model 2 because it's the highest quality interface I own. The app I used was FourTrack by SonomaWireWorks but you can use Garageband as well.
Step 1: Plug your interface into the iPhone.
Step 2: Plug your Mic into the interface.
Step 3: Launch FourTrack and select a track to record on, adjust the track level to prevent peaking, and slide the bottom red slider to record. In GarageBand for iOS create a new track by tapping the "+" button on the bottom left corner of the track view and hit record.
Step 4: (Exporting), in FourTrack simply open iTunes on your computer and click on your iPhone as if you were going to sync it. Navigate to the "Apps" page, scroll down to the "File Sharing" section, find FourTrack, and you will see a folder called "Sessions", click on that once to select it and click the "Add To" button, select the location you would like to save your recordings to and click save.