Using Bing Translator Api in Xcode using Swift

I am using FGTranslator ( https://github.com/gpolak/FGTranslator ) to access the api bing translator with fast but the problem is FGTranslator is written in lens c and I am using fast, but according to Apple we can do it. I have successfully added these classes to my header bridged project and I also installed AFNetworking with Pod Setup. Now I can successfully compile my program without errors.

    override func viewDidLoad() {
    super.viewDidLoad()
    let BING_CLIENT_ID = "some ID"
    let  BING_CLIENT_SECRET = "some Secret";
    let inputText = "Bonjour"
    var fr = "fr"
    var to = "en"
    var translator :FGTranslator = FGTranslator(bingAzureClientId: BING_CLIENT_ID, secret:  BING_CLIENT_SECRET)
    translator.translateText(inputText, completion:nil)

}

      

The last line, where translation.translateText is called completion, requires that I give nil. Can someone help me translate. I am a newbie programmer

+3


source to share





All Articles