Releases: davidstump/SwiftPhoenixClient
Releases · davidstump/SwiftPhoenixClient
0.9.3
0.9.2
0.9.1
0.9.0
0.8.1
0.8.0
SwiftPhoenixClient now closely mirrors the API and behavior of the Phoenix.js
Please reference the Usage Guides for how to use the client.
This release contains breaking changes from 0.7.0-rc1
0.7.0-rc1
This release introduces breaking changes from 0.6.0
The Wiki for more details
Initialization
- The init method no longer requires breaking up an endpoint.
init(domainAndPort:, path:, transport:, prot:, params)
as been removed in favor ofinit(url:, params:) where
url:can be a String or a URL and params is an optional
[String:Any]` - The socket no longer opens automatically upon initialization. You must call
.open()
in order to open the socket connection to the endpoint..open()
can be called before or after channels are joined
Channels
- the
.join()
method signature has changed. It now accepts an optionalPayload
parameters to send when joining a channel. - The closure passed to the socket when joining a channel now returns a
Channel
instead ofAny
so you no longer need to force castlet channel = channel as! Channel
- Listening to an event on a channel has changes slightly. The handler now returns the
payload
of a phoenix message so you can access values as such:
let status = payload["status"]
print(status) // "ok"
Sending Messages
You can now send a message through the socket or to a topic through a channel. You can receive events on a successful or failed send. See the wiki for more details
Removed
- The
Message
object has been removed and replaced withPayload
which is just atypealias
of[String:Any