Skip to content

Commit 665cfef

Browse files
committed
document SocketPacket.PacketType
1 parent 43907a4 commit 665cfef

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

Source/SocketIO/Parse/SocketPacket.swift

+30-7
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ import Foundation
2727

2828
/// A struct that represents a socket.io packet.
2929
public struct SocketPacket : CustomStringConvertible {
30-
// MARK: PacketType enum
31-
32-
/// The type of packets.
33-
public enum PacketType: Int {
34-
case connect, disconnect, event, ack, error, binaryEvent, binaryAck
35-
}
36-
3730
// MARK: Properties
3831

3932
private static let logType = "SocketPacket"
@@ -165,6 +158,36 @@ public struct SocketPacket : CustomStringConvertible {
165158
}
166159
}
167160

161+
public extension SocketPacket {
162+
// MARK: PacketType enum
163+
164+
/// The type of packets.
165+
public enum PacketType: Int {
166+
// MARK: Cases
167+
168+
/// Connect: 0
169+
case connect
170+
171+
/// Disconnect: 1
172+
case disconnect
173+
174+
/// Event: 2
175+
case event
176+
177+
/// Ack: 3
178+
case ack
179+
180+
/// Error: 4
181+
case error
182+
183+
/// Binary Event: 5
184+
case binaryEvent
185+
186+
/// Binary Ack: 6
187+
case binaryAck
188+
}
189+
}
190+
168191
extension SocketPacket {
169192
private static func findType(_ binCount: Int, ack: Bool) -> PacketType {
170193
switch binCount {

0 commit comments

Comments
 (0)