There is an old post, from 2011, that is regularly visited (I assume it is linked on a forum somewhere) and so it is probably time to do an updated version expanded into several posts covering all the options available today.
To connect using a WiFi network:
Open Audio MIDI Setup which you will find in the Utilities folder within the Applications folder – or hit the Command and Space keys and type Audio MIDI into the Spotlight search box.
From the Window menu select Show MIDI Studio.
This will open the MIDI Studio window from where you can select Open MIDI Network Setup from the MIDI Studio menu.
You need to create a new session by clicking the + button
The default name is Session 1. Tick the box to select that as the network session you wish to use
With an app sending MIDI signals your device will be available. Click the Connect button for it to join the network session.
Your device will be listed as a Participant in the right hand panel – from where it can be disconnected if required.
In the iPad’s/iPhone’s app you will see the Session 1 option within the MIDI settings – sometimes shown as a Settings button or three dots …
or a cog wheel icon
Once connected to the Network Session it is all happening in GarageBand…