clean up readme

This commit is contained in:
Erik 2015-03-12 10:27:37 -04:00
parent abbd8e6a67
commit 58362f6352

View File

@ -12,14 +12,8 @@ Manually (iOS 7+)
----------------- -----------------
1. Copy the SwiftIO folder into your Xcode project! 1. Copy the SwiftIO folder into your Xcode project!
CocoaPods (iOS 8+) CocoaPods 0.36.0 or later (iOS 8+)
------------------ ------------------
Install cocoapods 0.36.0 or later:
```
$ gem install cocoapods
```
Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`: Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
```ruby ```ruby
@ -42,7 +36,6 @@ Import in your swift file:
import Socket_IO_Client_Swift import Socket_IO_Client_Swift
``` ```
API API
=== ===
Constructor Constructor
@ -105,6 +98,11 @@ socket.on("ackEvent") {data, ack in
println("Got ackEvent") println("Got ackEvent")
} }
// data is an array
if let int = data?[1] as? Int {
println("Got int")
}
socket.emitWithAck("ackTest", "test").onAck {data in socket.emitWithAck("ackTest", "test").onAck {data in
println(data?[0]) println(data?[0])
} }
@ -118,25 +116,6 @@ socket.on("jsonTest") {data, ack in
} }
} }
// Event items are passed by an array
socket.on("multipleItems") {data, ack in
if data == nil {
return
}
if let str = data![0] as? String {
println(str)
}
if let arr = data![1] as? [Int] {
println(arr)
}
if let obj = data![4] as? NSDictionary {
println(obj["test"])
}
}
// Connecting // Connecting
socket.connect() socket.connect()
``` ```