Pep Guardiola's Manchester City come back to beat Swansea after the hosts raced to a 2-0 first-half lead at the Liberty Stadium in Wales.