From Barbara Marie Brannan on the Mac and iPad app Duet, which turns an iPad into an external display for a MacBook. Very clever. But there’s more:
Duet brings Touch Bar from MacBook Pro to an iPad’s screen (haven’t tried it on an iPhone; sorry). It works much like it works on the MacBook Pro, so whatever Mac application you’re using on the iPad’s screen– that also has a comparable Touch Bar Function key setup– also works on the iPad’s screen.
I tried it on my MacBook Pro and iPad and it works great. It’s just built-in to both Duet and the Mac with macOS Sierra.