don't typealias

This commit is contained in:
Erik 2015-10-18 16:55:33 -04:00
parent ab56b58b2d
commit b97574e28a
4 changed files with 6 additions and 7 deletions

View File

@ -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<SocketIOClientOption>? = 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

View File

@ -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<SocketIOClientOption>?
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<SocketIOClientOption>? = nil) {
if socketURL["https://"].matches().count != 0 {
self.secure = true
}

View File

@ -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<SocketIOClientOption> {
var options = Set<SocketIOClientOption>()
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<SocketIOClientOption>) -> NSDictionary {
let options = NSMutableDictionary()
for option in set {

View File

@ -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<SocketIOClientOption>
enum Either<E, V> {
case Left(E)