I am trying to implement Socket.IO-Client-Swift using this socket.io library. But due to this error Unable to resolve identifier socketmanager I am unable to implement this library. I am using xcode 9 and swift 3.2.2.
let manager = SocketManager(socketURL: URL(string: "http://localhost:8080")!, config: [.log(true), .compress])
let socket = manager.defaultSocket
socket.on(clientEvent: .connect) {data, ack in
print("socket connected")
}
socket.on("client balance change") {data, ack in
guard let cur = data[0] as? Double else { return }
socket.emitWithAck("canUpdate", cur).timingOut(after: 0) {data in
socket.emit("update", ["amount": cur + 2.50])
}
ack.with("Got your currentAmount", "dude")
}
socket.connect()
Replace SocketManager with this