External display with custom delegate

I’m making an iOS app with a custom delegate which connects to a projector. But when I want to return from the projected view back to viewing on the device screen, the view remains on the projector. This only happens when using a custom delegate.

Any ideas on where to start looking to get this working?