Check out the tutorial: https://medium.com/@cam.ilker/relay-control-from-ios-application-swift-using-nodemcu-1b0724a78a7b