diff --git a/README.md b/README.md index 7c6f2ba..37055ae 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,23 @@ import Socket_IO_Client_Swift ``` Objective-C: + ```Objective-C #import ``` +CocoaSeeds +----------------- + +Add this line to your `Seedfile`: + +``` +github "socketio/socket.io-client-swift", "v3.1.4", :files => "SocketIOClientSwift/*.swift" # Or latest version +``` + +Run `seed install`. + + ##API Constructors ----------- diff --git a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj index 515bc45..cf9cf09 100644 --- a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj +++ b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj @@ -605,7 +605,9 @@ 572EF2121B51F12F00EEBB58 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BITCODE_GENERATION_MODE = bitcode; CODE_SIGN_IDENTITY = "Developer ID Application"; + ENABLE_BITCODE = YES; GCC_OPTIMIZATION_LEVEL = 0; PRODUCT_NAME = SocketIO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -615,7 +617,9 @@ 572EF2131B51F12F00EEBB58 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BITCODE_GENERATION_MODE = bitcode; CODE_SIGN_IDENTITY = "Developer ID Application"; + ENABLE_BITCODE = YES; PRODUCT_NAME = SocketIO; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; }; diff --git a/SocketIOClientSwift/SocketEngine.swift b/SocketIOClientSwift/SocketEngine.swift index 03d3706..eb7cf9f 100644 --- a/SocketIOClientSwift/SocketEngine.swift +++ b/SocketIOClientSwift/SocketEngine.swift @@ -518,15 +518,15 @@ public final class SocketEngine: NSObject, SocketEngineSpec, WebSocketDelegate { private func parseEngineMessage(var message: String, fromPolling: Bool) { Logger.log("Got message: %@", type: logType, args: message) - if fromPolling { - fixDoubleUTF8(&message) - } - let type = SocketEnginePacketType(str: (message["^(\\d)"].groups()?[1]) ?? "") ?? { self.checkIfMessageIsBase64Binary(message) return .Noop }() + if fromPolling && type != .Noop { + fixDoubleUTF8(&message) + } + switch type { case .Message: message.removeAtIndex(message.startIndex) diff --git a/SocketIOClientSwift/SocketPacket.swift b/SocketIOClientSwift/SocketPacket.swift index 46bf483..1994cde 100644 --- a/SocketIOClientSwift/SocketPacket.swift +++ b/SocketIOClientSwift/SocketPacket.swift @@ -117,7 +117,7 @@ struct SocketPacket { message += jsonString! as String + "," } catch { - Logger.error("Error creating JSON object in SocketPacket.completeMessage", type: SocketPacket.logType) + Logger.error("Error creating JSON object in SocketPacket.completeMessage", type: SocketPacket.logType) } } else if var str = arg as? String { str = str["\n"] ~= "\\\\n"