diff --git a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj index 653762f..c02cda4 100644 --- a/Socket.IO-Client-Swift.xcodeproj/project.pbxproj +++ b/Socket.IO-Client-Swift.xcodeproj/project.pbxproj @@ -38,6 +38,10 @@ 5764DFA01B51F254004FF46E /* SwiftRegex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5764DF871B51F254004FF46E /* SwiftRegex.swift */; }; 5764DFA11B51F254004FF46E /* 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 */; }; 94242BB81B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.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 = ""; }; 5764DF871B51F254004FF46E /* SwiftRegex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftRegex.swift; path = SocketIOClientSwift/SwiftRegex.swift; sourceTree = ""; }; 5764DF881B51F254004FF46E /* WebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebSocket.swift; path = SocketIOClientSwift/WebSocket.swift; sourceTree = ""; }; + 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SocketIOClientStatus.swift; path = SocketIOClientSwift/SocketIOClientStatus.swift; sourceTree = ""; }; 941A4AB91B67A56C00C42318 /* TestKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestKind.swift; sourceTree = ""; }; 94242BB71B67B0E500AAAC9D /* SocketNamespaceAcknowledgementTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketNamespaceAcknowledgementTest.swift; sourceTree = ""; }; 945B65421B63D9DB0081E995 /* SocketEmitTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketEmitTest.swift; sourceTree = ""; }; @@ -252,6 +257,7 @@ 5764DF801B51F254004FF46E /* SocketEventHandler.swift */, 5764DF811B51F254004FF46E /* SocketFixUTF8.swift */, 5764DF821B51F254004FF46E /* SocketIOClient.swift */, + 74781D591B7E83930042CACA /* SocketIOClientStatus.swift */, 5764DF831B51F254004FF46E /* SocketLogger.swift */, 5764DF841B51F254004FF46E /* SocketPacket.swift */, 5764DF851B51F254004FF46E /* SocketParser.swift */, @@ -444,6 +450,7 @@ 5764DF951B51F254004FF46E /* SocketIOClient.swift in Sources */, 5764DF8B1B51F254004FF46E /* SocketAnyEvent.swift in Sources */, 5764DF971B51F254004FF46E /* SocketLogger.swift in Sources */, + 74781D5A1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */, 5764DFA11B51F254004FF46E /* WebSocket.swift in Sources */, 5764DF991B51F254004FF46E /* SocketPacket.swift in Sources */, 5764DF891B51F254004FF46E /* SocketAckManager.swift in Sources */, @@ -471,6 +478,7 @@ 945B65361B5FCEEA0081E995 /* SocketAnyEvent.swift in Sources */, 94ADAC4B1B6632DD00FD79AE /* SocketAcknowledgementTest.swift in Sources */, 945B653F1B5FCEEA0081E995 /* SocketTypes.swift in Sources */, + 74781D5B1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */, 945B653B1B5FCEEA0081E995 /* SocketIOClient.swift in Sources */, 94ADAC491B652D3300FD79AE /* SocketNamespaceEmitTest.swift in Sources */, 945B65411B5FCEEA0081E995 /* WebSocket.swift in Sources */, @@ -491,6 +499,7 @@ 5764DF961B51F254004FF46E /* SocketIOClient.swift in Sources */, 5764DF8C1B51F254004FF46E /* SocketAnyEvent.swift in Sources */, 5764DF981B51F254004FF46E /* SocketLogger.swift in Sources */, + 74781D5C1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */, 5764DFA21B51F254004FF46E /* WebSocket.swift in Sources */, 5764DF9A1B51F254004FF46E /* SocketPacket.swift in Sources */, 5764DF8A1B51F254004FF46E /* SocketAckManager.swift in Sources */, @@ -503,6 +512,7 @@ buildActionMask = 2147483647; files = ( 572EF24A1B51F18A00EEBB58 /* SocketIO_MacTests.swift in Sources */, + 74781D5D1B7E83930042CACA /* SocketIOClientStatus.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SocketIOClientSwift/SocketAckManager.swift b/SocketIOClientSwift/SocketAckManager.swift index c206109..c707a23 100644 --- a/SocketIOClientSwift/SocketAckManager.swift +++ b/SocketIOClientSwift/SocketAckManager.swift @@ -1,6 +1,6 @@ // // SocketAckManager.swift -// SocketIO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 4/3/15. // diff --git a/SocketIOClientSwift/SocketAnyEvent.swift b/SocketIOClientSwift/SocketAnyEvent.swift index 9e951fd..fdaa315 100644 --- a/SocketIOClientSwift/SocketAnyEvent.swift +++ b/SocketIOClientSwift/SocketAnyEvent.swift @@ -1,6 +1,6 @@ // // SocketAnyEvent.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 3/28/15. // diff --git a/SocketIOClientSwift/SocketEngine.swift b/SocketIOClientSwift/SocketEngine.swift index fd58a7e..1c6a465 100644 --- a/SocketIOClientSwift/SocketEngine.swift +++ b/SocketIOClientSwift/SocketEngine.swift @@ -1,6 +1,6 @@ // // SocketEngine.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 3/3/15. // diff --git a/SocketIOClientSwift/SocketEngineClient.swift b/SocketIOClientSwift/SocketEngineClient.swift index fe16367..bf22886 100644 --- a/SocketIOClientSwift/SocketEngineClient.swift +++ b/SocketIOClientSwift/SocketEngineClient.swift @@ -1,6 +1,6 @@ // // SocketEngineClient.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 3/19/15. // diff --git a/SocketIOClientSwift/SocketEventHandler.swift b/SocketIOClientSwift/SocketEventHandler.swift index ef4ede3..307d6b6 100644 --- a/SocketIOClientSwift/SocketEventHandler.swift +++ b/SocketIOClientSwift/SocketEventHandler.swift @@ -1,6 +1,6 @@ // // EventHandler.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 1/18/15. // diff --git a/SocketIOClientSwift/SocketFixUTF8.swift b/SocketIOClientSwift/SocketFixUTF8.swift index 4061303..0cffd86 100644 --- a/SocketIOClientSwift/SocketFixUTF8.swift +++ b/SocketIOClientSwift/SocketFixUTF8.swift @@ -1,6 +1,6 @@ // // SocketFixUTF8.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 3/16/15. // diff --git a/SocketIOClientSwift/SocketIOClient.swift b/SocketIOClientSwift/SocketIOClient.swift index fc95d73..4c240a0 100644 --- a/SocketIOClientSwift/SocketIOClient.swift +++ b/SocketIOClientSwift/SocketIOClient.swift @@ -1,6 +1,6 @@ // // SocketIOClient.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 11/23/14. // diff --git a/SocketIOClientSwift/SocketIOClientStatus.swift b/SocketIOClientSwift/SocketIOClientStatus.swift new file mode 100644 index 0000000..7ca333c --- /dev/null +++ b/SocketIOClientSwift/SocketIOClientStatus.swift @@ -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 + +} \ No newline at end of file diff --git a/SocketIOClientSwift/SocketLogger.swift b/SocketIOClientSwift/SocketLogger.swift index 65f1156..abef5d2 100644 --- a/SocketIOClientSwift/SocketLogger.swift +++ b/SocketIOClientSwift/SocketLogger.swift @@ -1,6 +1,6 @@ // // SocketLogger.swift -// SocketIO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 4/11/15. // diff --git a/SocketIOClientSwift/SocketPacket.swift b/SocketIOClientSwift/SocketPacket.swift index 27c4674..6d57787 100644 --- a/SocketIOClientSwift/SocketPacket.swift +++ b/SocketIOClientSwift/SocketPacket.swift @@ -1,6 +1,6 @@ // // SocketPacket.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Created by Erik Little on 1/18/15. // diff --git a/SocketIOClientSwift/SocketParser.swift b/SocketIOClientSwift/SocketParser.swift index 933413f..c56282a 100644 --- a/SocketIOClientSwift/SocketParser.swift +++ b/SocketIOClientSwift/SocketParser.swift @@ -1,6 +1,6 @@ // // SocketParser.swift -// Socket.IO-Swift +// Socket.IO-Client-Swift // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/SocketIOClientSwift/SocketTypes.swift b/SocketIOClientSwift/SocketTypes.swift index d47e5b8..e27bbe3 100644 --- a/SocketIOClientSwift/SocketTypes.swift +++ b/SocketIOClientSwift/SocketTypes.swift @@ -1,6 +1,6 @@ // // SocketTypes.swift -// SocketIO-Swift +// Socket.IO-Client-Swift // // 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 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 - -}