Search code examples
iosobjective-cswiftsdkfactual

Convert code from Objective C to Swift for FactualSDK


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"];

Solution

  • Try this:

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

    I tested it and its working fine.