The rear wheel pivot approach will set you back a bike's length, whereas the front wheel pivot will require some landing spot in front of you. Now if you are balancing onto sharp edges and there is nothing around, your only option is a clean and sharp U-turn on the spot assisted by a brief pedal kick. In all these techniques, body weight shifting is key, with both brakes locked at all times except during the brief pedal kick.
1° From a balanced position, lean over the bars, turned in the opposite direction to the move, ready to push away on your front wheel.
2° Push yourself away from the bars and turn them to the other side to build momentum with your shoulders, while moving your waist backwards.
3° Carry on the move by staying well balanced over the rear hub, so that you can spin on site without being dragged sideways.
See this move in a video
The initial body weight shifting and swirling with the shoulders will define the move entirely. On a smooth or slippery surface, you can keep your rear brake into a full stop and spin nicely. If you shift your body correctly, this moves comes quite effortlessly. You can stop the rotation with precision by leaning forward and pushing the front wheel downwards. After some practise, you'll be able to go full-turn or add some nice street-cred to your portfolio. On gripping surfaces, the rear tyre friction will tend to stop you half-way through, but you can finish the turn by a slight pedal pressure (not a kick) while releasing the rear brake to let the tyre roll and re-adjust to the new direction.
Variations of the 180° spin
This backward turn also works on rails, though it is very tricky. On a rail or on any edge, you must absolutely hop the rear wheel off the edge so as to be able to turn in the air without the rear tyre getting stuck on one side of the edge. Then you can land again perpendicular for maximum support and grip. If you don't hop while turning backwards, the tyre could slip off and the bike could get stuck behind the rail while your momentum brings you into a crash onto the other side (yes I tried this ;-). You must also dose very well the initial momentum depending on the friction of the edge you are spinning on, in order to turn only by 180° and find yourself ready for a pedal kick forward. If you over-do it, you risk to spin too much and end up being dragged out of balance and off the edge.
180° across an edge
Now, you can push the trick into turning 180° directly from a rear wheel position without initial push-up on the front wheel. Without support from the front wheel, you have to launch a spiraling extension, trying to look back as your shoulders build up the spin momentum (give the handlebar a good swing). At the end of your extension, lift the bike into a hop and try to realign it with your shoulders, pulling it as much as you can in front of you. It helps if you actually swing your bum on the opposite side. This is definitely not easy, and probably not useful, but a class move. Try this first on a kerb or a line on the ground. You must use as much bouncing effect as you can from tyre compression.
1° Start in balance with the bars pointing in the opposite direction to the turn, so that you can flick them and build momentum.
2° While turning the bars in one swift move, shift your weight forward, right above the stem, following the rotation with your shoulders.
3° Once the rear wheel is lifted, keep your weight well above the front hub, so that you don't get dragged sideways during the rotation.
When the front wheel stops spinning (because of friction), try to push the rear wheel further by swinging the frame
with your legs while twisting your hips to follow the move.
See this move in a video
Controlling the turn
You can stop the motion at any time and with precision by moving your body back over the rear wheel and nailing the rear tyre down. Now, there is a subtlety. Even with the brakes locked, the front wheel will still roll slightly (as you lift the rear wheel) and you need to take your marks for that (especially on narrow edges). At the beginning, it helps to learn the move riding at a slow pace instead of starting from a trackstand, but you will never get as much control, as the bike ends up dragging you, instead of you controlling the move. For a full turn (no use in biketrials but "street-cred through the roof", according to Wing), you'll need to launch this move in a light slope, going upwards (180° then facing the slope down) to finish with the rear wheel going down into the slope (you compensate your lack of momentum by using gravity pulling your rear wheel back after the 180°).
1° If you are bridging over a gap, make sure your rear hub is positioned over or has passed the rear edge on which your rear tyre is gripping (to avoid an OTB when kicking). Lean forward to pre-load the move.
2° With a quick push-up from the arms, eject yourself away from the front edge and spin the bars in the direction of your turn. Follow up by lifting the front wheel, give a slight pedal kick while extending in a spiral.
3° The kick sends you off the rear edge, but not over the gap. Keep your rotation momentum going, and readjust the bike in the opposite direction, past your body alignment, with a maximum twist of the waist.
Try both directions, as you may find that one is easier than the other.
See this move in a video
The pedal kick must just compensate for the backwards motion you would get when pivoting on the rear wheel, not send you over the gap to back wheel. Depending on the final position you aim for, you can increase or decrease the power you put into this kick. If you over-do it, you'll end up jumping over the bridging-gap with a 180° to back-wheel. If you don't kick enough, you'll end up a little bit offset backwards from your initial position like when pivoting on the rear wheel.
Turning right on the same spot is a bit more delicate since you must find the right kick pressure, and this will vary depending on the surface/edges gripping characteristics. If you are bridging over two edges, then you can still use that technique, but make sure you pull up the bike a lot more to overcome the height of the edges. The pedal kick must take place at the last moment, after extension, to avoid being stuck on the up-slope of any edge. Make sure you hop mainly with body momentum to avoid too much displacement.