Swift 4: Copy a UILabel in iOS

By default a UILabel doesn’t get any copy & paste commands in iOS. After all, it’s a label, why would you want to copy a label? It turns out, you might want to do that, if you are “abusing” a label to show something useful and in that case you probably want the entire label to be copied in one go, no “select”, just a simple copy.

This problem was beautifully solved on stackoverflow and you can see the solution here. For anyone else, the class is below.