Socket.IO的开源iOS客户端,使用swift编写。
演示视频:https://fat.gfycat.com/EssentialBlueElectriceel.webm
使用示例:
import Foundationlet socket = SocketIOClient(socketURL: "localhost:8880")socket.on("important message") {data, ack in println("Message for you! \(data?[0])") ack?("I got your message, and I'll send my response") socket.emit("response", "Hello!")}socket.connect()
评论