What is the origin of the phrase 'a sight for sore eyes'?

The origin of the phrase 'a sight for sore eyes' is from Jonathon Swift. It was said in 'A complete collection of genteel and ingenious conversation' in 1738.