Using the mainScreen's scale for image contexts
Using the mainScreen's scale for image contexts

There are two image contexts created with UIGraphicsBeginImageContext. From the docs:

"This function is equivalent to calling the UIGraphicsBeginImageContextWithOptions function with the opaque parameter set to false and a scale factor of 1.0."

This means that on retina displays, the signature appears pixelated. I have therefore replaced UIGraphicsBeginImageContext with UIGraphicsBeginImageContextWithOptions, using false for opaque, and UIScreen.mainScreen().scale for the scale factor, so the image is always the same scale factor as the device it is being used on.
alankarmisra/SwiftSignatureView,alankarmisra/SwiftSignatureView