do an endo, then let the back end rise as much as you can, then when yiou stop, pull the bars up to you (to get the front wheel off the ground) and at the same time, push it forwards and infront as much as possible. This will bring the back wheel close
When you start to learn it, you probably won't get a "perfect" swap but keep practising and you will