ChimpKit3
ChimpKit3 copied to clipboard
Swift subscription with completion block
Can you please provide a sample for subscribing an email address with a block in Swift?
I'm also looking for a swift sample
This is a functional sample :
ChimpKit.sharedKit().apiKey = "your api key"
let params:[NSObject : AnyObject] = ["id": "your list id", "email": ["email": "[email protected]"]]
ChimpKit.sharedKit().callApiMethod("lists/subscribe", withParams: params, andCompletionHandler: {(response, data, error) -> Void in
if let httpResponse = response as? NSHTTPURLResponse {
NSLog("Reponse status code: %d", httpResponse.statusCode)
}
})