Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd21ca00d3 | ||
|
|
f818d64405 | ||
|
|
55289d69a3 | ||
|
|
5dc0dfa9aa |
No files matched your search
@@ -1,4 +1,4 @@
|
||||
[](https://travis-ci.org/socketio/socket.io-client-swift)
|
||||
[](https://travis-ci.org/socketio/socket.io-client-swift)
|
||||
|
||||
#Socket.IO-Client-Swift
|
||||
Socket.IO-client for iOS/OS X.
|
||||
@@ -57,13 +57,14 @@ SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:@"localhost:8
|
||||
Requires Swift 2/Xcode 7
|
||||
|
||||
If you need Swift 1.2/Xcode 6.3/4 use v2.4.5 (Pre-Swift 2 support is no longer maintained)
|
||||
|
||||
If you need Swift 1.1/Xcode 6.2 use v1.5.2. (Pre-Swift 1.2 support is no longer maintained)
|
||||
|
||||
Carthage
|
||||
-----------------
|
||||
Add this line to your `Cartfile`:
|
||||
```
|
||||
github "socketio/socket.io-client-swift" ~> 3.0.0 # Or latest version
|
||||
github "socketio/socket.io-client-swift" ~> 3.0.1 # Or latest version
|
||||
```
|
||||
|
||||
Run `carthage update`.
|
||||
@@ -82,7 +83,7 @@ source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
use_frameworks!
|
||||
|
||||
pod 'Socket.IO-Client-Swift', '~> 3.0.0' # Or latest version
|
||||
pod 'Socket.IO-Client-Swift', '~> 3.0.1' # Or latest version
|
||||
```
|
||||
|
||||
Install pods:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "Socket.IO-Client-Swift"
|
||||
s.version = "3.0.0"
|
||||
s.version = "3.0.1"
|
||||
s.summary = "Socket.IO-client for iOS and OS X"
|
||||
s.description = <<-DESC
|
||||
Socket.IO-client for iOS and OS X.
|
||||
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
|
||||
s.author = { "Erik" => "nuclear.ace@gmail.com" }
|
||||
s.ios.deployment_target = '8.0'
|
||||
s.osx.deployment_target = '10.10'
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.0.0' }
|
||||
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.0.1' }
|
||||
s.source_files = "SocketIOClientSwift/**/*.swift"
|
||||
s.requires_arc = true
|
||||
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
|
||||
|
||||
@@ -502,6 +502,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate {
|
||||
}
|
||||
|
||||
private func parseEngineData(data: NSData) {
|
||||
Logger.log("Got binary data: %@", type: "SocketEngine", args: data)
|
||||
client?.parseBinaryData(data.subdataWithRange(NSMakeRange(1, data.length - 1)))
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
|
||||
private var ackHandlers = SocketAckManager()
|
||||
private var currentAck = -1
|
||||
|
||||
internal var waitingData = [SocketPacket]()
|
||||
var waitingData = [SocketPacket]()
|
||||
|
||||
/**
|
||||
Create a new SocketIOClient. opts can be omitted
|
||||
|
||||
@@ -156,10 +156,13 @@ class SocketParser {
|
||||
return
|
||||
}
|
||||
|
||||
let shouldExecute = socket.waitingData[0].addData(data)
|
||||
guard shouldExecute else { return }
|
||||
let shouldExecute = socket.waitingData[socket.waitingData.count - 1].addData(data)
|
||||
|
||||
var packet = socket.waitingData.removeAtIndex(0)
|
||||
guard shouldExecute else {
|
||||
return
|
||||
}
|
||||
|
||||
var packet = socket.waitingData.removeLast()
|
||||
packet.fillInPlaceholders()
|
||||
|
||||
if packet.type != .BinaryAck {
|
||||
|
||||
Reference in new issue
Block a user