South Africa’s ANC has suffered its worst-ever local elections result, securing just 30% of the vote.