use struct

This commit is contained in:
Erik 2015-06-11 11:50:30 -04:00
parent a15b57e900
commit 11d8430537

View File

@ -29,8 +29,8 @@ private func emitAckCallback(socket:SocketIOClient?, num:Int?)
socket?.emitAck(num ?? -1, withData: items) socket?.emitAck(num ?? -1, withData: items)
} }
final class SocketEventHandler { struct SocketEventHandler {
let event:String! let event:String
let callback:NormalCallback let callback:NormalCallback
init(event:String, callback:NormalCallback) { init(event:String, callback:NormalCallback) {
@ -40,8 +40,8 @@ final class SocketEventHandler {
func executeCallback(items:NSArray? = nil, withAck ack:Int? = nil, withAckType type:Int? = nil, func executeCallback(items:NSArray? = nil, withAck ack:Int? = nil, withAckType type:Int? = nil,
withSocket socket:SocketIOClient? = nil) { withSocket socket:SocketIOClient? = nil) {
dispatch_async(dispatch_get_main_queue()) {[weak self] in dispatch_async(dispatch_get_main_queue()) {
self?.callback(items, emitAckCallback(socket, num: ack)) self.callback(items, emitAckCallback(socket, num: ack))
} }
} }
} }