Sydney Swans coach John Longmire will quit the AFL club and hand the reins to long-time assistant Dean Cox.