I am new to the react native and I am integrating the iOS framework. I want update the UI based on the call back in Swift file.
LoginContoller:
func validateLogin(userName: String, pswd: String) { HKSDKController.init(withuserName: userName, password: pswd, delegate: self)}Delegate function:func recieveMessage(result: Bool, withError message: String) {// result = true}
Input.js:
loginWithLogin = (userName, pswd) => { if (userName == '') { alert("Please enter the userName"); } else if (pswd == '') { alert("Please enter the pswd"); }else { NativeModules.LoginContoller.validateLogin(userName,pswd); } }
I saw there is a call function to update the js:
@objc func callbackMethod(callback: RCTResponseSenderBlock) -> Void { }
My question is i want to update the UI based on the “recieveMessage” callback function. I called the "validateLogin" function in input.js file. How to handle it and pass the result to the input js.
If the result is true in the "recieveMessage" delegate function, how to notify the js file.