South Africa will crack down on groups behind xenophobic violence, President Cyril Ramaphosa said on Sunday, as anti-immigrant protests tarnish the country's reputation.