Pinterest-iOS 2.3 and Swift: call createPinWithImageURL results in EXC_BAD_ACCESS
Using Pinterest-IOS SDK (2.3) I get EXC_BAD_ACCESS error when instantiating SDK via Swift Bridge and then call createPinWithImageURL. When converting the same code back to objective-c and then calling the wrapper method from Swift works as expected. The root cause is passing appID and suffix strings from Swift to Objective-C.
This code doesn't work:
self.pinterest = Pinterest(clientId:"your_app_id", urlSchemeSuffix:"prod")!
if(pinterest.canPinWithSDK()) {
pinterest.createPinWithImageURL(NSURL(string: imageUrl)!, sourceURL:NSURL(string: sourceUrl)!, description:pinDescription)
}
This succeeds when setting the appId on the objective-c side:
self.bainterest = PinterestWrapper.sharedInstance()
baPinterest.pinRecipe(imageUrl, sourceURL:sourceUrl, description:pinDescription)
I created a project that demonstrates this:
+3
source to share