Convert code from Objective C to Swift for FactualSDK

237 Views Asked by At

This is my first question on Stack Overflow, I was integrating the Factual SDK in my app using swift. I successfully created a bridgeheader for the framework but could not figure out how to convert this line of code in order to set the authKey and ID in swift. Thanks in advance!!

FactualAPI* _apiObject = [[FactualAPI alloc] initWithAPIKey:@"yourkey" secret:@"yoursecret"];
1

There are 1 best solutions below

0
On BEST ANSWER

Try this:

let _apiObject = FactualAPI(APIKey:"yourkey" secret:"yoursecret")

I tested it and its working fine.