This commit is contained in:
Erik 2015-09-18 11:52:35 -04:00
parent 0e791176bd
commit f464eba995
3 changed files with 17 additions and 17 deletions

View File

@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
@ -62,15 +62,18 @@
ReferencedContainer = "container:Socket.IO-Client-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
@ -85,10 +88,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference

View File

@ -27,22 +27,18 @@ import Foundation
public class SocketAckEmitter: NSObject {
unowned let socket: SocketIOClient
var ackNum: Int
public subscript(items: AnyObject...) -> Bool {
socket.emitAck(ackNum, withItems: items)
return true
}
public subscript(items: [AnyObject]) -> NSString {
socket.emitAck(ackNum, withItems: items)
return "Done"
}
let ackNum: Int
init(socket: SocketIOClient, ackNum: Int) {
self.socket = socket
self.ackNum = ackNum
}
public func ackWith(items: [AnyObject]) {
socket.emitAck(ackNum, withItems: items)
}
}
public func <-(lhs: SocketAckEmitter?, rhs: [AnyObject]) {
lhs?.ackWith(rhs)
}

View File

@ -24,6 +24,7 @@
import Foundation
infix operator <- {}
public typealias AckCallback = ([AnyObject]) -> Void
public typealias NormalCallback = ([AnyObject], SocketAckEmitter?) -> Void
public typealias OnAckCallback = (timeoutAfter: UInt64, callback: AckCallback) -> Void