skedgo/uservoice-ios-sdk — pull request #1 by nighthawk (2014-05-19 05:00:36+00:00)
Title: Adding attachments

Add an attachment to a UVConfig and the next UVTicket will send them across. I am not sure if this is the best way to do this bus it's working fine in my tests.

Usage examples:

```Objective-C
UVConfig *config = ...

// attaching a JSON file
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:...
options:NSJSONWritingPrettyPrinted
error:nil];
NSString *base64EncodedString = [jsonData base64EncodedStringWithOptions:0];
[config addAttachmentNamed:@"file.json"
contentType:@"text/json"
base64encodedData:base64EncodedString];

// attaching a screenshot of a view
UIGraphicsBeginImageContextWithOptions(view.bounds.size, NO, 0);
[view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
UIImage *snapshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

NSData *pngData = UIImagePNGRepresentation(snapshotImage);
NSString *base64EncodedString = [pngData base64EncodedStringWithOptions:0];
[config addAttachmentNamed:@"screenshot.png"
contentType:@"image/png"
base64encodedData:base64EncodedString];
```