move enum, better description

This commit is contained in:
Erik 2015-08-14 16:20:43 -04:00
parent 7ebcd7439f
commit 2cafec6f12
13 changed files with 72 additions and 20 deletions

View File

@ -38,6 +38,10 @@
5764DFA01B51F254004FF46E /* SwiftRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF871B51F254004FF46E /* SwiftRegex.swift */; }; 5764DFA01B51F254004FF46E /* SwiftRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF871B51F254004FF46E /* SwiftRegex.swift */; };
5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; }; 5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; };
5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; }; 5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF881B51F254004FF46E /* WebSocket.swift */; };
74781D5A1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */; };
74781D5B1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */; };
74781D5C1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */; };
74781D5D1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */; };
941A4ABA1B67A56C00C42318 /* TestKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941A4AB91B67A56C00C42318 /* TestKind.swift */; }; 941A4ABA1B67A56C00C42318 /* TestKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 941A4AB91B67A56C00C42318 /* TestKind.swift */; };
94242BB81B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift */; }; 94242BB81B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift */; };
945B65351B5FCEEA0081E995 /* SocketAckManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7C1B51F254004FF46E /* SocketAckManager.swift */; }; 945B65351B5FCEEA0081E995 /* SocketAckManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF7C1B51F254004FF46E /* SocketAckManager.swift */; };
@ -102,6 +106,7 @@
5764DF861B51F254004FF46E /* SocketTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketTypes.swift; path = SocketIOClientSwift/SocketTypes.swift; sourceTree = "<group>"; }; 5764DF861B51F254004FF46E /* SocketTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketTypes.swift; path = SocketIOClientSwift/SocketTypes.swift; sourceTree = "<group>"; };
5764DF871B51F254004FF46E /* SwiftRegex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftRegex.swift; path = SocketIOClientSwift/SwiftRegex.swift; sourceTree = "<group>"; }; 5764DF871B51F254004FF46E /* SwiftRegex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftRegex.swift; path = SocketIOClientSwift/SwiftRegex.swift; sourceTree = "<group>"; };
5764DF881B51F254004FF46E /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebSocket.swift; path = SocketIOClientSwift/WebSocket.swift; sourceTree = "<group>"; }; 5764DF881B51F254004FF46E /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebSocket.swift; path = SocketIOClientSwift/WebSocket.swift; sourceTree = "<group>"; };
74781D591B7E83930042CACA /* SocketIOClientStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketIOClientStatus.swift; path = SocketIOClientSwift/SocketIOClientStatus.swift; sourceTree = "<group>"; };
941A4AB91B67A56C00C42318 /* TestKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestKind.swift; sourceTree = "<group>"; }; 941A4AB91B67A56C00C42318 /* TestKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestKind.swift; sourceTree = "<group>"; };
94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketNamespaceAcknowledgementTest.swift; sourceTree = "<group>"; }; 94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketNamespaceAcknowledgementTest.swift; sourceTree = "<group>"; };
945B65421B63D9DB0081E995 /* SocketEmitTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketEmitTest.swift; sourceTree = "<group>"; }; 945B65421B63D9DB0081E995 /* SocketEmitTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketEmitTest.swift; sourceTree = "<group>"; };
@ -252,6 +257,7 @@
5764DF801B51F254004FF46E /* SocketEventHandler.swift */, 5764DF801B51F254004FF46E /* SocketEventHandler.swift */,
5764DF811B51F254004FF46E /* SocketFixUTF8.swift */, 5764DF811B51F254004FF46E /* SocketFixUTF8.swift */,
5764DF821B51F254004FF46E /* SocketIOClient.swift */, 5764DF821B51F254004FF46E /* SocketIOClient.swift */,
74781D591B7E83930042CACA /* SocketIOClientStatus.swift */,
5764DF831B51F254004FF46E /* SocketLogger.swift */, 5764DF831B51F254004FF46E /* SocketLogger.swift */,
5764DF841B51F254004FF46E /* SocketPacket.swift */, 5764DF841B51F254004FF46E /* SocketPacket.swift */,
5764DF851B51F254004FF46E /* SocketParser.swift */, 5764DF851B51F254004FF46E /* SocketParser.swift */,
@ -444,6 +450,7 @@
5764DF951B51F254004FF46E /* SocketIOClient.swift in Sources */, 5764DF951B51F254004FF46E /* SocketIOClient.swift in Sources */,
5764DF8B1B51F254004FF46E /* SocketAnyEvent.swift in Sources */, 5764DF8B1B51F254004FF46E /* SocketAnyEvent.swift in Sources */,
5764DF971B51F254004FF46E /* SocketLogger.swift in Sources */, 5764DF971B51F254004FF46E /* SocketLogger.swift in Sources */,
74781D5A1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */,
5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */, 5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */,
5764DF991B51F254004FF46E /* SocketPacket.swift in Sources */, 5764DF991B51F254004FF46E /* SocketPacket.swift in Sources */,
5764DF891B51F254004FF46E /* SocketAckManager.swift in Sources */, 5764DF891B51F254004FF46E /* SocketAckManager.swift in Sources */,
@ -471,6 +478,7 @@
945B65361B5FCEEA0081E995 /* SocketAnyEvent.swift in Sources */, 945B65361B5FCEEA0081E995 /* SocketAnyEvent.swift in Sources */,
94ADAC4B1B6632DD00FD79AE /* SocketAcknowledgementTest.swift in Sources */, 94ADAC4B1B6632DD00FD79AE /* SocketAcknowledgementTest.swift in Sources */,
945B653F1B5FCEEA0081E995 /* SocketTypes.swift in Sources */, 945B653F1B5FCEEA0081E995 /* SocketTypes.swift in Sources */,
74781D5B1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */,
945B653B1B5FCEEA0081E995 /* SocketIOClient.swift in Sources */, 945B653B1B5FCEEA0081E995 /* SocketIOClient.swift in Sources */,
94ADAC491B652D3300FD79AE /* SocketNamespaceEmitTest.swift in Sources */, 94ADAC491B652D3300FD79AE /* SocketNamespaceEmitTest.swift in Sources */,
945B65411B5FCEEA0081E995 /* WebSocket.swift in Sources */, 945B65411B5FCEEA0081E995 /* WebSocket.swift in Sources */,
@ -491,6 +499,7 @@
5764DF961B51F254004FF46E /* SocketIOClient.swift in Sources */, 5764DF961B51F254004FF46E /* SocketIOClient.swift in Sources */,
5764DF8C1B51F254004FF46E /* SocketAnyEvent.swift in Sources */, 5764DF8C1B51F254004FF46E /* SocketAnyEvent.swift in Sources */,
5764DF981B51F254004FF46E /* SocketLogger.swift in Sources */, 5764DF981B51F254004FF46E /* SocketLogger.swift in Sources */,
74781D5C1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */,
5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */, 5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */,
5764DF9A1B51F254004FF46E /* SocketPacket.swift in Sources */, 5764DF9A1B51F254004FF46E /* SocketPacket.swift in Sources */,
5764DF8A1B51F254004FF46E /* SocketAckManager.swift in Sources */, 5764DF8A1B51F254004FF46E /* SocketAckManager.swift in Sources */,
@ -503,6 +512,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
572EF24A1B51F18A00EEBB58 /* SocketIO_MacTests.swift in Sources */, 572EF24A1B51F18A00EEBB58 /* SocketIO_MacTests.swift in Sources */,
74781D5D1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -1,6 +1,6 @@
// //
// SocketAckManager.swift // SocketAckManager.swift
// SocketIO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 4/3/15. // Created by Erik Little on 4/3/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketAnyEvent.swift // SocketAnyEvent.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 3/28/15. // Created by Erik Little on 3/28/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketEngine.swift // SocketEngine.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 3/3/15. // Created by Erik Little on 3/3/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketEngineClient.swift // SocketEngineClient.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 3/19/15. // Created by Erik Little on 3/19/15.
// //

View File

@ -1,6 +1,6 @@
// //
// EventHandler.swift // EventHandler.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 1/18/15. // Created by Erik Little on 1/18/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketFixUTF8.swift // SocketFixUTF8.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 3/16/15. // Created by Erik Little on 3/16/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketIOClient.swift // SocketIOClient.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 11/23/14. // Created by Erik Little on 11/23/14.
// //

View File

@ -0,0 +1,51 @@
//
// SocketIOClientStatus.swift
// Socket.IO-Client-Swift
//
// Created by Erik Little on 8/14/15.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import Foundation
@objc public enum SocketIOClientStatus: Int, CustomStringConvertible {
public var description: String {
let des: String
switch self.rawValue {
case 0:
des = "Not Connected"
case 1:
des = "Closed"
case 2:
des = "Connecting"
case 3:
des = "Connected"
case 4:
des = "Reconnecting"
default:
des = "Unknown State"
}
return des
}
case NotConnected, Closed, Connecting, Connected, Reconnecting
}

View File

@ -1,6 +1,6 @@
// //
// SocketLogger.swift // SocketLogger.swift
// SocketIO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 4/11/15. // Created by Erik Little on 4/11/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketPacket.swift // SocketPacket.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 1/18/15. // Created by Erik Little on 1/18/15.
// //

View File

@ -1,6 +1,6 @@
// //
// SocketParser.swift // SocketParser.swift
// Socket.IO-Swift // Socket.IO-Client-Swift
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal // of this software and associated documentation files (the "Software"), to deal

View File

@ -1,6 +1,6 @@
// //
// SocketTypes.swift // SocketTypes.swift
// SocketIO-Swift // Socket.IO-Client-Swift
// //
// Created by Erik Little on 4/8/15. // Created by Erik Little on 4/8/15.
// //
@ -31,12 +31,3 @@ public typealias NormalCallback = (NSArray?, AckEmitter?) -> Void
public typealias NormalCallbackObjectiveC = (NSArray?, AckEmitterObjectiveC?) -> Void public typealias NormalCallbackObjectiveC = (NSArray?, AckEmitterObjectiveC?) -> Void
public typealias OnAckCallback = (timeoutAfter:UInt64, callback:AckCallback) -> Void public typealias OnAckCallback = (timeoutAfter:UInt64, callback:AckCallback) -> Void
@objc public enum SocketIOClientStatus: Int, CustomStringConvertible {
public var description: String {
return String(self.rawValue)
}
case NotConnected, Closed, Connecting, Connected, Reconnecting
}