Skip to content

Commit efe0d01

Browse files
committed
update docs
1 parent f9c665a commit efe0d01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Socket.IO-client for iOS/OS X.
55

66
##Example
77
```swift
8-
let socket = SocketIOClient(socketURL: "localhost:8080", options: [.Log(true), .ForcePolling(true)])
8+
let socket = SocketIOClient(socketURL: NSURL(string: "http://localhost:8080")!, options: [.Log(true), .ForcePolling(true)])
99

1010
socket.on("connect") {data, ack in
1111
print("socket connected")
@@ -26,7 +26,8 @@ socket.connect()
2626

2727
##Objective-C Example
2828
```objective-c
29-
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:@"localhost:8080" options:@{@"log": @YES, @"forcePolling": @YES}];
29+
NSURL* url = [[NSURL alloc] initWithString:@"http://localhost:8080"];
30+
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL:url options:@{@"log": @YES, @"forcePolling": @YES}];
3031

3132
[socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
3233
NSLog(@"socket connected");
@@ -136,9 +137,9 @@ Run `seed install`.
136137
##API
137138
Constructors
138139
-----------
139-
`init(var socketURL: String, options: Set<SocketIOClientOption> = [])` - 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.
140+
`init(var socketURL: NSURL, options: Set<SocketIOClientOption> = [])` - Creates a new SocketIOClient. options is a Set of SocketIOClientOption. If your socket.io server is secure, you need to specify `https` in your socketURL.
140141

141-
`convenience init(socketURL: String, options: NSDictionary?)` - Same as above, but meant for Objective-C. See Options on how convert between SocketIOClientOptions and dictionary keys.
142+
`convenience init(socketURL: NSURL, options: NSDictionary?)` - Same as above, but meant for Objective-C. See Options on how convert between SocketIOClientOptions and dictionary keys.
142143

143144
Options
144145
-------

0 commit comments

Comments
 (0)