From b97574e28a26837f7c406e20f95f11aec56c56ca Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 18 Oct 2015 16:55:33 -0400 Subject: [PATCH] don't typealias --- README.md | 2 +- SocketIOClientSwift/SocketIOClient.swift | 4 ++-- SocketIOClientSwift/SocketIOClientOption.swift | 6 +++--- SocketIOClientSwift/SocketTypes.swift | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e9f3ea3..87e60d6 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ Run `seed install`. ##API Constructors ----------- -`init(var socketURL: String, options: SocketOptionsSet? = nil)` - Creates a new SocketIOClient. opts is a Set of SocketIOClientOption. If your socket.io server is secure, you need to specify `https` in your socketURL. +`init(var socketURL: String, options: Set? = nil)` - Creates a new SocketIOClient. opts is a Set of SocketIOClientOption. If your socket.io server is secure, you need to specify `https` in your socketURL. `convenience init(socketURL: String, options: NSDictionary?)` - Same as above, but meant for Objective-C. See Options on how convert between SocketIOClientOptions and dictionary keys. Options diff --git a/SocketIOClientSwift/SocketIOClient.swift b/SocketIOClientSwift/SocketIOClient.swift index 2a9cf7d..2a2bada 100644 --- a/SocketIOClientSwift/SocketIOClient.swift +++ b/SocketIOClientSwift/SocketIOClient.swift @@ -32,7 +32,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient { public private(set) var status = SocketIOClientStatus.NotConnected public var nsp = "/" - public var options: SocketOptionsSet? + public var options: Set? public var reconnects = true public var reconnectWait = 10 public var sid: String? { @@ -57,7 +57,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient { /** Type safe way to create a new SocketIOClient. opts can be omitted */ - public init(var socketURL: String, options: SocketOptionsSet? = nil) { + public init(var socketURL: String, options: Set? = nil) { if socketURL["https://"].matches().count != 0 { self.secure = true } diff --git a/SocketIOClientSwift/SocketIOClientOption.swift b/SocketIOClientSwift/SocketIOClientOption.swift index cc3a16d..11a5b01 100644 --- a/SocketIOClientSwift/SocketIOClientOption.swift +++ b/SocketIOClientSwift/SocketIOClientOption.swift @@ -91,8 +91,8 @@ public enum SocketIOClientOption: CustomStringConvertible, Hashable { return Mirror(reflecting: self).children.first?.value as? AnyObject } - static func NSDictionaryToSocketOptionsSet(dict: NSDictionary) -> SocketOptionsSet { - var options = SocketOptionsSet() + static func NSDictionaryToSocketOptionsSet(dict: NSDictionary) -> Set { + var options = Set() for (rawKey, value) in dict { if let key = rawKey as? String, opt = keyValueToSocketIOClientOption(key, value: value) { @@ -103,7 +103,7 @@ public enum SocketIOClientOption: CustomStringConvertible, Hashable { return options } - static func SocketOptionsSetToNSDictionary(set: SocketOptionsSet) -> NSDictionary { + static func SocketOptionsSetToNSDictionary(set: Set) -> NSDictionary { let options = NSMutableDictionary() for option in set { diff --git a/SocketIOClientSwift/SocketTypes.swift b/SocketIOClientSwift/SocketTypes.swift index aa07698..86bdeee 100644 --- a/SocketIOClientSwift/SocketTypes.swift +++ b/SocketIOClientSwift/SocketTypes.swift @@ -27,7 +27,6 @@ import Foundation public typealias AckCallback = ([AnyObject]) -> Void public typealias NormalCallback = ([AnyObject], SocketAckEmitter?) -> Void public typealias OnAckCallback = (timeoutAfter: UInt64, callback: AckCallback) -> Void -public typealias SocketOptionsSet = Set enum Either { case Left(E)