[
  {
    "path": ".gitignore",
    "content": "# OS X\n.DS_Store\n\n# Xcode\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\nprofile\n*.moved-aside\nDerivedData\n*.hmap\n*.xccheckout\n# AppCode\n.idea/\n\nCarthage\n\nDemo/Pods\n.ruby-version\n.ruby-gemset\n# Swift Package Manager\n.build\n.swiftpm\nPackages\nPackage.pins\n"
  },
  {
    "path": ".slather.yml",
    "content": "# .slather.yml\n# CodeCov\n\ncoverage_service: cobertura_xml\nxcodeproj: SwiftPhoenixClient.xcodeproj\nscheme: SwiftPhoenixClient\nworkspace: SwiftPhoenixClient.xcworkspace\nsource_directory: SwiftPhoenixClient\noutput_directory: fastlane/test_output\nignore:\n  - ../*\n  - Pods/*"
  },
  {
    "path": ".sourcery.yml",
    "content": "sources:\n  - Sources/\ntemplates:\n  - sourcery/\noutput:\n  Tests/Mocks/\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: swift\n\nos: osx\nosx_image: xcode11.4\ncache:\n  bundler: true\n  directories:\n    - Carthage\n\nbefore_install:\n  - brew update\n  - brew outdated carthage || brew upgrade carthage\n  - carthage bootstrap --use-xcframeworks --platform iOS --no-use-binaries --cache-builds\n\nscript:\n  - bundle exec fastlane test\n\n# after_success:\n#   - bash <(curl -s https://codecov.io/bash)\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# CHANGELOG\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/)\n\nThis product uses [Semantic Versioning](https://semver.org/).\n\n### 5.3.5\n\n- Fix `objc_loadWeakRetained` on iOS 18 in the `Transport` layer\n\n### 5.3.4\n\n- Added various weak self checks\n\n### 5.3.3\n\n- Added weak self references in heartbeat timer\n- Added guards against weak self in PhoenixTransport\n\n### 5.3.3\n\n- Additional thread related crashes\n\n### 5.3.2\n\n- Fixed various thread-related crashes\n\n### 5.3.1\n\n- Added `socket.headers` which will be added to the `URLRequest` when opening a WebSocket connection\n- Using thread-safe array for Socket callback bindings, fixing a crash when creating a channel\n- Breaking a retain cycle in socket\n\n### 5.3.0\n\n- Fix retain cycles in `URLSessionTransport` and using default operation queue\n- Adding an optional `leeway` to the `HeartbeatTimer`\n- Added additional `open` methods in `URLSessionTransport` for further customization\n- Using a thread-safe array for Channel bindings\n\n## 5.2.2\n\n- Changed `URLSessionTransport` to `open` to provide for custom behavior, such as SSL Pinning\n\n## 5.2.1\n\n- Added `connectionState` to `Socket` which exposes the Socket's ready state\n\n## 5.2.0\n\n- [#226](https://github.com/davidstump/SwiftPhoenixClient/pull/226) Adds `URLResponse` as an optional value in `socket.onError` callbacks to allow for checking status codes from the server when the Socket connection errors out. See Examples in PR for more details\n\n## 5.1.0\n\n- Improves reconnection logic around a heartbeat timeout\n\n## 5.0.0\n\n- Removes RxSwift dependency\n- Removes Starscream dependency\n- Creating new repos to host these extensions\n\n## 4.0.0\n\n- Updates RxSwift version to 6.x\n\n## 3.0.0\n\nThis ia a **BREAKING** release. The following has changed to properly matched the phoenix.js library\n\n- `message.payload.response` is now automatically unwrapped and returned as `message.payload` for `phx_reply` events.\n- The client now, be default, uses the JSON V2 Serializer which was added in phoenix 1.3. If you are still running 1.2 or earlier, then you will need to\n  continue using SwiftPhoenixClient 2.1.0, or provide your own custom `vsn`, `encoder` and `decoder` to the `Socket` class.\n\n## 2.1.1\n\n- Fixed HeartbeatTimer to add thread safety and fix crash reported in #188\n\n## 2.1.0\n\n- Updated Presence.Options init method to be public\n- Updated URLSessionWebsocketTask init method to accept a custom configuration\n\n## 2.0.0\n\n- Restructured project\n- Added support for URLSession's Websocket Task\n- Split Starscream and RxSwift into optional modules\n\n## [1.3.0]\n\n- Fixed Cartfile declaration of Starscream\n- Added `HeartbeatTimer` class which allows running Timers to run on their own thread\n- Made `Socket` init public to allow customization of the transport methhod\n\n## [1.2.1]\n\n- Pinned back Starscream version to fix Carthage build issue\n\n## [1.2.0](https://github.com/davidstump/SwiftPhoenixClient/compare/1.1.2...1.2.0)\n\n- [#153](https://github.com/davidstump/SwiftPhoenixClient/pull/153): Added ability to pass a closure when initializing a `Socket` to dynamically change `params` when reconnecting\n- Fixed Package.swift and updated it to use latest Starscream\n\n## [1.1.2](https://github.com/davidstump/SwiftPhoenixClient/compare/1.1.1...1.1.2)\n\n- [#151](https://github.com/davidstump/SwiftPhoenixClient/pull/151): Made isJoined, isJoining, etc methods on Channel public\n\n## [1.1.1](https://github.com/davidstump/SwiftPhoenixClient/compare/1.1.0...1.1.1)\n\n- [#141](https://github.com/davidstump/SwiftPhoenixClient/pull/141): tvOS support\n- [#145](https://github.com/davidstump/SwiftPhoenixClient/pull/145): Refactored Socket reconnect strategy\n- [#146](https://github.com/davidstump/SwiftPhoenixClient/pull/146): Refactored Channel rejoin strategy\n\n## [1.1.0]\n\n- Swift 5\n\n## [1.0.1]\n\n- Fixed issue with Carthage installs\n\n## [1.0.0]\n\n- Rewrite of large parts of the Socket and Channel classes\n- Optional API for automatic retain cycle handling\n- Presence support\n\n## [0.9.3]\n\n## Added\n\n- [#119](https://github.com/davidstump/SwiftPhoenixClient/pull/119): A working implementation of Presence\n\n## Changed\n\n- [#120](https://github.com/davidstump/SwiftPhoenixClient/pull/120): Xcode 10 and Swift 4.2\n\n## [0.9.2]\n\n## Fixed\n\n- [#111](https://github.com/davidstump/SwiftPhoenixClient/pull/111): Strong memory cycles between Socket, Channel and Timers\n- [#112](https://github.com/davidstump/SwiftPhoenixClient/pull/112): Leak when Socket disconnects and properly call `onClose()`\n- [#114](https://github.com/davidstump/SwiftPhoenixClient/pull/114): Carthage failing on builds and app store uploads\n\n## Changed\n\n- [#116](https://github.com/davidstump/SwiftPhoenixClient/pull/116): A Channel's `topic` is now exposed as `public`\n\n## [0.9.1]\n\n### Added\n\n- Added security configuration to the underlying WebSocket.\n\n## [0.9.0]\n\nContinue to improve the API and behavior of the library to behave similar to the JS library. This release introduces\nsome breaking changes in the API that will require updates to your code. See the [usage guide] for help.\n\n### Updated\n\n- Swift 4.1\n\n### Changed\n\n- All callbacks now receive a `Message` object. The `Payload` can be accessed using `message.payload`\n\n### Added\n\n- `channel.join()` can now take optional params to override the ones set while creating the Channel\n- Timeouts when sending messages\n- Rejoin timer which can be configured to attempt to rejoin given a function. Defaults to 1s, 2s, 5s, 10s and then retries every 10s\n- Socket and Channel `on` callbacks are able to hold more than just a single callback\n\nThanks to @murphb52 and @ALucasVanDongen for helping with some of the development and testing of this release!\n\n## [0.8.1]\n\n### Fixed\n\n- Initial params are not sent through when opening a channel\n\n## [0.8.0]\n\n### Updated\n\n- Starscream to 3.0.4\n- Swift 4\n- Mirror [Phoenix.js](https://hexdocs.pm/phoenix/js/) more closely\n\n[Unreleased]: https://github.com/davidstump/SwiftPhoenixClient/compare/1.3.0...HEAD\n[1.3.0]: https://github.com/davidstump/SwiftPhoenixClient/compare/1.2.1...1.3.0\n[1.2.1]: https://github.com/davidstump/SwiftPhoenixClient/compare/1.2.0...1.2.1\n[0.9.3]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.9.2...0.9.3\n[0.9.2]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.9.1...0.9.2\n[0.9.1]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.9.0...0.9.1\n[0.9.0]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.8.1...0.9.0\n[0.8.1]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.8.0...0.8.1\n[0.8.0]: https://github.com/davidstump/SwiftPhoenixClient/compare/0.6.0...0.8.0\n[migration guide]: https://github.com/davidstump/SwiftPhoenixClient/wiki/Usage-Guide\n"
  },
  {
    "path": "Cartfile.private",
    "content": "github \"Quick/Quick\" ~> 4.0.0\ngithub \"Quick/Nimble\" ~> 9.0.0\n"
  },
  {
    "path": "Cartfile.resolved",
    "content": "github \"Quick/Nimble\" \"v9.2.1\"\ngithub \"Quick/Quick\" \"v4.0.0\"\n"
  },
  {
    "path": "Examples/Basic/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  Basic\n//\n//  Created by Daniel Rees on 10/23/20.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n  func application(_ application: UIApplication,\n                   didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n    return true\n  }\n\n}\n\n"
  },
  {
    "path": "Examples/Basic/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"83.5x83.5\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Examples/Basic/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Examples/Basic/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"13122.16\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"13104.12\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <color key=\"backgroundColor\" xcode11CocoaTouchSystemColor=\"systemBackgroundColor\" cocoaTouchSystemColor=\"whiteColor\"/>\n                        <viewLayoutGuide key=\"safeArea\" id=\"6Tk-OE-BBY\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "Examples/Basic/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"19529\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"Zsx-Hf-BVQ\">\n    <device id=\"retina6_1\" orientation=\"portrait\" appearance=\"light\"/>\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"19519\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"System colors in document resources\" minToolsVersion=\"11.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--Navigation Controller-->\n        <scene sceneID=\"hbi-sE-0YT\">\n            <objects>\n                <navigationController navigationBarHidden=\"YES\" id=\"Zsx-Hf-BVQ\" sceneMemberID=\"viewController\">\n                    <navigationBar key=\"navigationBar\" contentMode=\"scaleToFill\" insetsLayoutMarginsFromSafeArea=\"NO\" id=\"T9Y-2W-aAw\">\n                        <autoresizingMask key=\"autoresizingMask\"/>\n                    </navigationBar>\n                    <connections>\n                        <segue destination=\"BYZ-38-t0r\" kind=\"relationship\" relationship=\"rootViewController\" id=\"lvb-Xw-qkE\"/>\n                    </connections>\n                </navigationController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"QOY-EI-0Lu\" userLabel=\"First Responder\" customClass=\"UIResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"-658\" y=\"139\"/>\n        </scene>\n        <!--View Controller-->\n        <scene sceneID=\"tne-QT-ifu\">\n            <objects>\n                <viewController storyboardIdentifier=\"vc.intro.basic\" id=\"BYZ-38-t0r\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"896\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Basic\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"BEe-vt-MEe\">\n                                <rect key=\"frame\" x=\"20\" y=\"64\" width=\"102.5\" height=\"53\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"44\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Basic serves as a playground for testing various use cases of the Client. For a more robust usage, see the Chat Example app.\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"h5t-Lj-irh\">\n                                <rect key=\"frame\" x=\"20\" y=\"133\" width=\"374\" height=\"61\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Chat Room\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"F6P-j3-jMr\">\n                                <rect key=\"frame\" x=\"20\" y=\"375\" width=\"210\" height=\"53\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"44\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Chat Room is a fully functional chat room that targets dwyl/phoenix-chat-example. It is a more complete implementation\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" numberOfLines=\"0\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"1ld-X6-Yo3\">\n                                <rect key=\"frame\" x=\"20\" y=\"444\" width=\"374\" height=\"61\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"UIR-BI-BRU\">\n                                <rect key=\"frame\" x=\"91\" y=\"254\" width=\"232\" height=\"41\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"24\"/>\n                                <state key=\"normal\" title=\"Launch Basic Example\"/>\n                                <connections>\n                                    <segue destination=\"kvj-CR-pCE\" kind=\"show\" id=\"E54-7t-Dj4\"/>\n                                </connections>\n                            </button>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"b0l-Xq-l0D\">\n                                <rect key=\"frame\" x=\"61\" y=\"565\" width=\"292\" height=\"41\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"24\"/>\n                                <state key=\"normal\" title=\"Launch Chat Room Example\"/>\n                                <connections>\n                                    <segue destination=\"RJS-iX-oRo\" kind=\"show\" id=\"g9S-Mr-CAq\"/>\n                                </connections>\n                            </button>\n                        </subviews>\n                        <viewLayoutGuide key=\"safeArea\" id=\"6Tk-OE-BBY\"/>\n                        <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n                        <constraints>\n                            <constraint firstAttribute=\"trailing\" secondItem=\"h5t-Lj-irh\" secondAttribute=\"trailing\" constant=\"20\" id=\"6RQ-YM-Fyw\"/>\n                            <constraint firstItem=\"h5t-Lj-irh\" firstAttribute=\"leading\" secondItem=\"6Tk-OE-BBY\" secondAttribute=\"leading\" constant=\"20\" id=\"Fjb-7q-bZP\"/>\n                            <constraint firstItem=\"F6P-j3-jMr\" firstAttribute=\"top\" secondItem=\"UIR-BI-BRU\" secondAttribute=\"bottom\" constant=\"80\" id=\"Fn6-hq-Sdx\"/>\n                            <constraint firstItem=\"UIR-BI-BRU\" firstAttribute=\"centerX\" secondItem=\"8bC-Xf-vdC\" secondAttribute=\"centerX\" id=\"H2Q-7g-Vi4\"/>\n                            <constraint firstItem=\"F6P-j3-jMr\" firstAttribute=\"leading\" secondItem=\"BEe-vt-MEe\" secondAttribute=\"leading\" id=\"HeP-E4-rIE\"/>\n                            <constraint firstItem=\"1ld-X6-Yo3\" firstAttribute=\"trailing\" secondItem=\"h5t-Lj-irh\" secondAttribute=\"trailing\" id=\"ItY-dT-IhA\"/>\n                            <constraint firstItem=\"h5t-Lj-irh\" firstAttribute=\"top\" secondItem=\"BEe-vt-MEe\" secondAttribute=\"bottom\" constant=\"16\" id=\"OgN-X9-efj\"/>\n                            <constraint firstItem=\"b0l-Xq-l0D\" firstAttribute=\"top\" secondItem=\"1ld-X6-Yo3\" secondAttribute=\"bottom\" constant=\"60\" id=\"ZL6-ca-iFm\"/>\n                            <constraint firstItem=\"1ld-X6-Yo3\" firstAttribute=\"top\" secondItem=\"F6P-j3-jMr\" secondAttribute=\"bottom\" constant=\"16\" id=\"dco-DZ-iog\"/>\n                            <constraint firstItem=\"b0l-Xq-l0D\" firstAttribute=\"centerX\" secondItem=\"8bC-Xf-vdC\" secondAttribute=\"centerX\" id=\"fln-MG-sWG\"/>\n                            <constraint firstItem=\"1ld-X6-Yo3\" firstAttribute=\"leading\" secondItem=\"h5t-Lj-irh\" secondAttribute=\"leading\" id=\"ib5-mu-7cV\"/>\n                            <constraint firstItem=\"UIR-BI-BRU\" firstAttribute=\"top\" secondItem=\"h5t-Lj-irh\" secondAttribute=\"bottom\" constant=\"60\" id=\"u1I-Bv-Dki\"/>\n                            <constraint firstItem=\"BEe-vt-MEe\" firstAttribute=\"leading\" secondItem=\"6Tk-OE-BBY\" secondAttribute=\"leading\" constant=\"20\" id=\"xZp-Ju-TpI\"/>\n                            <constraint firstItem=\"BEe-vt-MEe\" firstAttribute=\"top\" secondItem=\"6Tk-OE-BBY\" secondAttribute=\"top\" constant=\"20\" id=\"yRM-vL-Fnf\"/>\n                        </constraints>\n                    </view>\n                    <navigationItem key=\"navigationItem\" id=\"vrV-LP-NAa\"/>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"131.8840579710145\" y=\"138.61607142857142\"/>\n        </scene>\n        <!--Basic Chat View Controller-->\n        <scene sceneID=\"fHJ-wR-6Fv\">\n            <objects>\n                <viewController id=\"kvj-CR-pCE\" customClass=\"BasicChatViewController\" customModule=\"Basic\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"r7Y-Xw-V91\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"896\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Basic\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"bzZ-eQ-71I\">\n                                <rect key=\"frame\" x=\"20\" y=\"64\" width=\"103\" height=\"53\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"44\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <textField opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Message...\" textAlignment=\"natural\" minimumFontSize=\"17\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"8vj-8R-JAk\">\n                                <rect key=\"frame\" x=\"20\" y=\"814\" width=\"306\" height=\"40\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                <textInputTraits key=\"textInputTraits\"/>\n                            </textField>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"aCb-6h-kVE\">\n                                <rect key=\"frame\" x=\"334\" y=\"814\" width=\"60\" height=\"40\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"40\" id=\"5Hw-T3-ZT0\"/>\n                                    <constraint firstAttribute=\"width\" constant=\"60\" id=\"b7Q-yS-ZZE\"/>\n                                </constraints>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <state key=\"normal\" title=\"Send\"/>\n                                <connections>\n                                    <action selector=\"sendMessage:\" destination=\"kvj-CR-pCE\" eventType=\"touchUpInside\" id=\"mVm-qe-579\"/>\n                                </connections>\n                            </button>\n                            <textView clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"scaleToFill\" editable=\"NO\" textAlignment=\"natural\" selectable=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"KF5-Gt-2Qg\">\n                                <rect key=\"frame\" x=\"20\" y=\"125\" width=\"374\" height=\"681\"/>\n                                <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n                                <string key=\"text\">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>\n                                <color key=\"textColor\" systemColor=\"labelColor\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"15\"/>\n                                <textInputTraits key=\"textInputTraits\" autocapitalizationType=\"sentences\"/>\n                            </textView>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"slt-ax-j8X\">\n                                <rect key=\"frame\" x=\"319\" y=\"72.5\" width=\"75\" height=\"36\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"20\"/>\n                                <state key=\"normal\" title=\"Connect\"/>\n                                <connections>\n                                    <action selector=\"onConnectButtonPressed:\" destination=\"kvj-CR-pCE\" eventType=\"touchUpInside\" id=\"01e-UK-Kon\"/>\n                                </connections>\n                            </button>\n                        </subviews>\n                        <viewLayoutGuide key=\"safeArea\" id=\"aNG-mQ-eOn\"/>\n                        <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n                        <constraints>\n                            <constraint firstItem=\"aCb-6h-kVE\" firstAttribute=\"top\" secondItem=\"8vj-8R-JAk\" secondAttribute=\"top\" id=\"0jQ-EO-UqX\"/>\n                            <constraint firstItem=\"8vj-8R-JAk\" firstAttribute=\"top\" secondItem=\"KF5-Gt-2Qg\" secondAttribute=\"bottom\" constant=\"8\" id=\"1L9-aq-gIU\"/>\n                            <constraint firstItem=\"slt-ax-j8X\" firstAttribute=\"centerY\" secondItem=\"bzZ-eQ-71I\" secondAttribute=\"centerY\" id=\"FJQ-4m-Tbw\"/>\n                            <constraint firstItem=\"bzZ-eQ-71I\" firstAttribute=\"top\" secondItem=\"aNG-mQ-eOn\" secondAttribute=\"top\" constant=\"20\" id=\"IUb-ZL-Q3S\"/>\n                            <constraint firstItem=\"aNG-mQ-eOn\" firstAttribute=\"trailing\" secondItem=\"aCb-6h-kVE\" secondAttribute=\"trailing\" constant=\"20\" id=\"JxZ-Gw-Sf5\"/>\n                            <constraint firstItem=\"8vj-8R-JAk\" firstAttribute=\"leading\" secondItem=\"aNG-mQ-eOn\" secondAttribute=\"leading\" constant=\"20\" id=\"Kcw-3w-5CD\"/>\n                            <constraint firstItem=\"aNG-mQ-eOn\" firstAttribute=\"bottom\" secondItem=\"aCb-6h-kVE\" secondAttribute=\"bottom\" constant=\"8\" id=\"LoR-eB-PPJ\"/>\n                            <constraint firstItem=\"bzZ-eQ-71I\" firstAttribute=\"leading\" secondItem=\"aNG-mQ-eOn\" secondAttribute=\"leading\" constant=\"20\" id=\"UC4-bp-6Uz\"/>\n                            <constraint firstItem=\"aNG-mQ-eOn\" firstAttribute=\"trailing\" secondItem=\"slt-ax-j8X\" secondAttribute=\"trailing\" constant=\"20\" id=\"XVS-iI-8CF\"/>\n                            <constraint firstItem=\"aCb-6h-kVE\" firstAttribute=\"bottom\" secondItem=\"8vj-8R-JAk\" secondAttribute=\"bottom\" id=\"jsR-RR-Ngx\"/>\n                            <constraint firstItem=\"aCb-6h-kVE\" firstAttribute=\"leading\" secondItem=\"8vj-8R-JAk\" secondAttribute=\"trailing\" constant=\"8\" id=\"nBm-Zz-oW2\"/>\n                            <constraint firstItem=\"KF5-Gt-2Qg\" firstAttribute=\"leading\" secondItem=\"aNG-mQ-eOn\" secondAttribute=\"leading\" constant=\"20\" id=\"oxs-ll-OVi\"/>\n                            <constraint firstItem=\"aNG-mQ-eOn\" firstAttribute=\"trailing\" secondItem=\"KF5-Gt-2Qg\" secondAttribute=\"trailing\" constant=\"20\" id=\"rBf-m4-fTZ\"/>\n                            <constraint firstItem=\"KF5-Gt-2Qg\" firstAttribute=\"top\" secondItem=\"bzZ-eQ-71I\" secondAttribute=\"bottom\" constant=\"8\" id=\"yiO-mz-wj6\"/>\n                        </constraints>\n                    </view>\n                    <navigationItem key=\"navigationItem\" id=\"nZS-Fg-Mad\"/>\n                    <connections>\n                        <outlet property=\"chatWindow\" destination=\"KF5-Gt-2Qg\" id=\"t4M-l4-Mww\"/>\n                        <outlet property=\"connectButton\" destination=\"slt-ax-j8X\" id=\"z5A-IX-s74\"/>\n                        <outlet property=\"messageField\" destination=\"8vj-8R-JAk\" id=\"QU5-Ub-eek\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"l8U-lP-vWR\" userLabel=\"First Responder\" customClass=\"UIResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"936\" y=\"-92\"/>\n        </scene>\n        <!--Chat Room View Controller-->\n        <scene sceneID=\"1Zq-kN-hM5\">\n            <objects>\n                <viewController id=\"RJS-iX-oRo\" customClass=\"ChatRoomViewController\" customModule=\"Basic\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"yzJ-nT-Ptm\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"896\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <label opaque=\"NO\" userInteractionEnabled=\"NO\" contentMode=\"left\" horizontalHuggingPriority=\"251\" verticalHuggingPriority=\"251\" text=\"Chat Room\" textAlignment=\"natural\" lineBreakMode=\"tailTruncation\" baselineAdjustment=\"alignBaselines\" adjustsFontSizeToFit=\"NO\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"AeE-bA-VFh\">\n                                <rect key=\"frame\" x=\"20\" y=\"64\" width=\"210\" height=\"53\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"44\"/>\n                                <nil key=\"textColor\"/>\n                                <nil key=\"highlightedColor\"/>\n                            </label>\n                            <textField opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"left\" contentVerticalAlignment=\"center\" borderStyle=\"roundedRect\" placeholder=\"Message...\" textAlignment=\"natural\" minimumFontSize=\"17\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"98Q-7Z-8K2\">\n                                <rect key=\"frame\" x=\"20\" y=\"814\" width=\"306\" height=\"40\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"14\"/>\n                                <textInputTraits key=\"textInputTraits\"/>\n                            </textField>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"zEg-l5-c0O\">\n                                <rect key=\"frame\" x=\"334\" y=\"814\" width=\"60\" height=\"40\"/>\n                                <constraints>\n                                    <constraint firstAttribute=\"height\" constant=\"40\" id=\"9Hk-Vp-RDS\"/>\n                                    <constraint firstAttribute=\"width\" constant=\"60\" id=\"qwQ-j4-YWI\"/>\n                                </constraints>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"17\"/>\n                                <state key=\"normal\" title=\"Send\"/>\n                                <connections>\n                                    <action selector=\"onSendButtonPressed:\" destination=\"RJS-iX-oRo\" eventType=\"touchUpInside\" id=\"mpC-eD-smW\"/>\n                                </connections>\n                            </button>\n                            <button opaque=\"NO\" contentMode=\"scaleToFill\" contentHorizontalAlignment=\"center\" contentVerticalAlignment=\"center\" buttonType=\"system\" lineBreakMode=\"middleTruncation\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"rRW-yN-Yh6\">\n                                <rect key=\"frame\" x=\"362\" y=\"72.5\" width=\"32\" height=\"36\"/>\n                                <fontDescription key=\"fontDescription\" type=\"system\" pointSize=\"20\"/>\n                                <state key=\"normal\" title=\"Exit\"/>\n                                <connections>\n                                    <action selector=\"onExitButtonPressed:\" destination=\"RJS-iX-oRo\" eventType=\"touchUpInside\" id=\"vRM-5t-ull\"/>\n                                </connections>\n                            </button>\n                            <tableView clipsSubviews=\"YES\" contentMode=\"scaleToFill\" alwaysBounceVertical=\"YES\" showsHorizontalScrollIndicator=\"NO\" showsVerticalScrollIndicator=\"NO\" dataMode=\"prototypes\" style=\"plain\" separatorStyle=\"none\" allowsSelection=\"NO\" rowHeight=\"-1\" estimatedRowHeight=\"-1\" sectionHeaderHeight=\"28\" sectionFooterHeight=\"28\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"H5w-0M-Z0D\">\n                                <rect key=\"frame\" x=\"0.0\" y=\"125\" width=\"414\" height=\"681\"/>\n                                <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n                            </tableView>\n                        </subviews>\n                        <viewLayoutGuide key=\"safeArea\" id=\"MAx-vC-OCj\"/>\n                        <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n                        <constraints>\n                            <constraint firstItem=\"AeE-bA-VFh\" firstAttribute=\"top\" secondItem=\"MAx-vC-OCj\" secondAttribute=\"top\" constant=\"20\" id=\"Fzh-cn-F6n\"/>\n                            <constraint firstItem=\"zEg-l5-c0O\" firstAttribute=\"top\" secondItem=\"98Q-7Z-8K2\" secondAttribute=\"top\" id=\"M7H-aj-AtL\"/>\n                            <constraint firstItem=\"98Q-7Z-8K2\" firstAttribute=\"top\" secondItem=\"H5w-0M-Z0D\" secondAttribute=\"bottom\" constant=\"8\" id=\"MiZ-bC-UOQ\"/>\n                            <constraint firstItem=\"zEg-l5-c0O\" firstAttribute=\"bottom\" secondItem=\"98Q-7Z-8K2\" secondAttribute=\"bottom\" id=\"TfB-TF-zUj\"/>\n                            <constraint firstItem=\"rRW-yN-Yh6\" firstAttribute=\"centerY\" secondItem=\"AeE-bA-VFh\" secondAttribute=\"centerY\" id=\"Uz9-N1-etM\"/>\n                            <constraint firstItem=\"MAx-vC-OCj\" firstAttribute=\"bottom\" secondItem=\"zEg-l5-c0O\" secondAttribute=\"bottom\" constant=\"8\" id=\"Yml-Pj-bcg\"/>\n                            <constraint firstItem=\"H5w-0M-Z0D\" firstAttribute=\"top\" secondItem=\"AeE-bA-VFh\" secondAttribute=\"bottom\" constant=\"8\" id=\"c2Y-Ic-eQW\"/>\n                            <constraint firstItem=\"MAx-vC-OCj\" firstAttribute=\"trailing\" secondItem=\"H5w-0M-Z0D\" secondAttribute=\"trailing\" id=\"d8n-Gf-e7g\"/>\n                            <constraint firstItem=\"98Q-7Z-8K2\" firstAttribute=\"leading\" secondItem=\"MAx-vC-OCj\" secondAttribute=\"leading\" constant=\"20\" id=\"fSG-ft-bc9\"/>\n                            <constraint firstItem=\"H5w-0M-Z0D\" firstAttribute=\"leading\" secondItem=\"MAx-vC-OCj\" secondAttribute=\"leading\" id=\"fkL-bu-6ft\"/>\n                            <constraint firstItem=\"MAx-vC-OCj\" firstAttribute=\"trailing\" secondItem=\"rRW-yN-Yh6\" secondAttribute=\"trailing\" constant=\"20\" id=\"gb1-Mk-q4f\"/>\n                            <constraint firstItem=\"MAx-vC-OCj\" firstAttribute=\"trailing\" secondItem=\"zEg-l5-c0O\" secondAttribute=\"trailing\" constant=\"20\" id=\"gvo-XL-cDQ\"/>\n                            <constraint firstItem=\"zEg-l5-c0O\" firstAttribute=\"leading\" secondItem=\"98Q-7Z-8K2\" secondAttribute=\"trailing\" constant=\"8\" id=\"iDb-I1-mhP\"/>\n                            <constraint firstItem=\"AeE-bA-VFh\" firstAttribute=\"leading\" secondItem=\"MAx-vC-OCj\" secondAttribute=\"leading\" constant=\"20\" id=\"nY4-Wj-yBw\"/>\n                        </constraints>\n                    </view>\n                    <navigationItem key=\"navigationItem\" id=\"TlM-WA-si1\"/>\n                    <connections>\n                        <outlet property=\"messageInput\" destination=\"98Q-7Z-8K2\" id=\"Gmh-GX-fqq\"/>\n                        <outlet property=\"tableView\" destination=\"H5w-0M-Z0D\" id=\"Fde-iv-hx8\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"e7P-lT-1aG\" userLabel=\"First Responder\" customClass=\"UIResponder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"935\" y=\"561\"/>\n        </scene>\n    </scenes>\n    <resources>\n        <systemColor name=\"labelColor\">\n            <color white=\"0.0\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n        </systemColor>\n        <systemColor name=\"systemBackgroundColor\">\n            <color white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"genericGamma22GrayColorSpace\"/>\n        </systemColor>\n    </resources>\n</document>\n"
  },
  {
    "path": "Examples/Basic/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>NSAppTransportSecurity</key>\n\t<dict>\n\t\t<key>NSAllowsArbitraryLoads</key>\n\t\t<true/>\n\t</dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t\t<key>UISceneConfigurations</key>\n\t\t<dict>\n\t\t\t<key>UIWindowSceneSessionRoleApplication</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>UISceneConfigurationName</key>\n\t\t\t\t\t<string>Default Configuration</string>\n\t\t\t\t\t<key>UISceneDelegateClassName</key>\n\t\t\t\t\t<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>\n\t\t\t\t\t<key>UISceneStoryboardFile</key>\n\t\t\t\t\t<string>Main</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t</dict>\n\t</dict>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "Examples/Basic/SceneDelegate.swift",
    "content": "//\n//  SceneDelegate.swift\n//  Basic\n//\n//  Created by Daniel Rees on 10/23/20.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport UIKit\n\nclass SceneDelegate: UIResponder, UIWindowSceneDelegate {\n  var window: UIWindow?\n}\n\n"
  },
  {
    "path": "Examples/Basic/basic/BasicChatViewController.swift",
    "content": "//\n//  BasicChatViewController.swift\n//  Basic\n//\n//  Created by Daniel Rees on 10/23/20.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport UIKit\nimport SwiftPhoenixClient\n\n/*\n Testing with Basic Chat\n \n This class is designed to provide as a sandbox to test various client features in a \"real\"\n environment where network can be dropped, disconnected, servers can quit, etc.\n \n For a more advanced example, see the ChatRoomViewController\n \n This example is intended to connect to a local chat server.\n \n Setup\n 1. Select which Transpart is being tested.\n \n Steps\n 1. Connect the Socket\n 2. Verify System pings come through\n 3. Send a message and verify it is returned by the server\n 4. From a web client, send a message and verify it is received by the app.\n 5. Disconnect and Connect the Socket again\n 6. Kill the server, verifying that the retry starts\n 7. Start the server again, verifying that the client reconnects\n 8. After the client reconnects, verify pings and messages work as before\n 9. Disconnect the client and kill the server again\n 10. While the server is disconnected, connect the client\n 11. Start the server and verify that the client connects once the server is available\n \n */\n\nlet endpoint = \"http://localhost:4000/socket/websocket\"\n\nclass BasicChatViewController: UIViewController {\n  \n  // MARK: - Child Views\n  \n  @IBOutlet weak var connectButton: UIButton!\n  \n  @IBOutlet weak var messageField: UITextField!\n  @IBOutlet weak var chatWindow: UITextView!\n  \n\n  // MARK: - Variables\n  let username: String = \"Basic\"\n  var topic: String = \"rooms:lobby\"\n  \n  \n  \n  // Test the URLSessionTransport\n  let socket = Socket(endpoint)\n    \n  var lobbyChannel: Channel!\n  \n  // MARK: - Lifecycle\n  override func viewDidLoad() {\n    super.viewDidLoad()\n    \n    self.chatWindow.text = \"\"\n    \n    // To automatically manage retain cycles, use `delegate*(to:)` methods.\n    // If you would prefer to handle them yourself, youcan use the same\n    // methods without the `delegate` functions, just be sure you avoid\n    // memory leakse with `[weak self]`\n    socket.delegateOnOpen(to: self) { (self) in\n      self.addText(\"Socket Opened\")\n      DispatchQueue.main.async {\n        self.connectButton.setTitle(\"Disconnect\", for: .normal)\n      }\n    }\n    \n    socket.delegateOnClose(to: self) { (self) in\n      self.addText(\"Socket Closed\")\n      DispatchQueue.main.async {\n        self.connectButton.setTitle(\"Connect\", for: .normal)\n      }\n    }\n    \n    socket.delegateOnError(to: self) { (self, arg1) in\n      let (error, response) = arg1\n      \n      if let statusCode = (response as? HTTPURLResponse)?.statusCode, statusCode > 400 {\n        self.addText(\"Socket Errored: \\(statusCode)\")\n        self.socket.disconnect()\n      } else {\n        self.addText(\"Socket Errored: \" + error.localizedDescription)\n      }\n    }\n    \n    socket.logger = { msg in print(\"LOG:\", msg) }\n    \n  }\n  \n  \n  // MARK: - IBActions\n  @IBAction func onConnectButtonPressed(_ sender: Any) {\n    if socket.isConnected {\n      disconnectAndLeave()\n      \n    } else {\n      connectAndJoin()\n    }\n  }\n  \n  @IBAction func sendMessage(_ sender: UIButton) {\n    let payload = [\"user\": username, \"body\": messageField.text!]\n    \n    self.lobbyChannel\n      .push(\"new:msg\", payload: payload)\n      .receive(\"ok\") { (message) in\n        print(\"success\", message)\n      }\n      .receive(\"error\") { (errorMessage) in\n        print(\"error: \", errorMessage)\n      }\n    \n    messageField.text = \"\"\n  }\n  \n  \n  private func disconnectAndLeave() {\n    //     Be sure the leave the channel or call socket.remove(lobbyChannel)\n    lobbyChannel.leave()\n    socket.disconnect {\n      self.addText(\"Socket Disconnected\")\n    }\n  }\n  \n  private func connectAndJoin() {\n    let channel = socket.channel(topic, params: [\"status\":\"joining\"])\n    channel.delegateOn(\"join\", to: self) { (self, _) in\n      self.addText(\"You joined the room.\")\n    }\n    \n    channel.delegateOn(\"new:msg\", to: self) { (self, message) in\n      let payload = message.payload\n      guard\n        let username = payload[\"user\"],\n        let body = payload[\"body\"] else { return }\n      let newMessage = \"[\\(username)] \\(body)\"\n      self.addText(newMessage)\n    }\n    \n    channel.delegateOn(\"user:entered\", to: self) { (self, message) in\n      self.addText(\"[anonymous entered]\")\n    }\n    \n    self.lobbyChannel = channel\n    self.lobbyChannel\n      .join()\n      .delegateReceive(\"ok\", to: self) { (self, _) in\n        self.addText(\"Joined Channel\")\n      }.delegateReceive(\"error\", to: self) { (self, message) in\n        self.addText(\"Failed to join channel: \\(message.payload)\")\n      }\n    self.socket.connect()\n    \n  }\n  \n  private func addText(_ text: String) {\n    DispatchQueue.main.async {\n      let updatedText = self.chatWindow.text.appending(text).appending(\"\\n\")\n      self.chatWindow.text = updatedText\n      \n      let bottom = NSMakeRange(updatedText.count - 1, 1)\n      self.chatWindow.scrollRangeToVisible(bottom)\n    }\n  }\n  \n}\n"
  },
  {
    "path": "Examples/Basic/chatroom/ChatRoomViewController.swift",
    "content": "//\n//  ChatRoomViewController.swift\n//  Basic\n//\n//  Created by Daniel Rees on 12/22/20.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport UIKit\nimport SwiftPhoenixClient\n\nstruct Shout {\n  let name: String\n  let message: String\n}\n\n/*\n ChatRoom provides a \"real\" example of using SwiftPhoenixClient, including how\n to use the Rx extensions for it. It also utilizes logic to disconnect/reconnect\n the socket when the app enters and exits the foreground.\n \n NOTE: iOS can, at will, kill your connection if the app enters the background without\n notiftying your process that it has been killed. Thus resulting in a disconnected\n socket when the app comes back to the foreground. The best way around this is to\n listen to UIApplication.didBecomeActiveNotification events and manually check if the socket is still connected\n and attempt to reconnect and rejoin any channels.\n \n In this example, the channel is left and socket is disconnected when the app enters\n the background and then a new channel is created and joined and the socket is connected\n when the app enters the foreground.\n \n This example utilizes the PhxChat example at https://github.com/dwyl/phoenix-chat-example\n */\nclass ChatRoomViewController: UIViewController {\n  \n  // MARK: - Child Views\n  @IBOutlet weak var messageInput: UITextField!\n  @IBOutlet weak var tableView: UITableView!\n  \n  // MARK: - Attributes\n  private let username: String = \"ChatRoom\"\n//  private let socket = Socket(\"http://localhost:4000/socket/websocket\")\n  \tprivate let socket = Socket(\"https://phoenix-chat.fly.dev/socket/websocket\")\n  private let topic: String = \"room:lobby\"\n  \n  private var lobbyChannel: Channel?\n  private var shouts: [Shout] = []\n  \n  // Notifcation Subscriptions\n  private var didbecomeActiveObservervation: NSObjectProtocol?\n  private var willResignActiveObservervation: NSObjectProtocol?\n  \n  \n  // MARK: - Lifecycle\n  override func viewDidLoad() {\n    super.viewDidLoad()\n    \n    self.tableView.dataSource = self\n    \n    // When app enters foreground, be sure that the socket is connected\n    self.observeDidBecomeActive()\n    \n    // Connect to the chat for the first time\n    self.connectToChat()\n  }\n  \n  override func viewDidDisappear(_ animated: Bool) {\n    super.viewDidDisappear(animated)\n    \n    // When the Controller is removed from the view hierarchy, then stop\n    // observing app lifecycle and disconnect from the chat\n    self.removeAppActiveObservation()\n    self.disconnectFromChat()\n  }\n  \n  // MARK: - IB Actions\n  @IBAction func onExitButtonPressed(_ sender: Any) {\n    self.navigationController?.popViewController(animated: true)\n  }\n  \n  \n  @IBAction func onSendButtonPressed(_ sender: Any) {\n    // Create and send the payload\n    let payload = [\"name\": username, \"message\": messageInput.text!]\n    self.lobbyChannel?.push(\"shout\", payload: payload)\n    \n    // Clear the text intput\n    self.messageInput.text = \"\"\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Background/Foreground reconnect strategy\n  //----------------------------------------------------------------------\n  private func observeDidBecomeActive() {\n    //Make sure there's no other observations\n    self.removeAppActiveObservation()\n    \n    self.didbecomeActiveObservervation = NotificationCenter.default\n      .addObserver(forName: UIApplication.didBecomeActiveNotification,\n                   object: nil,\n                   queue: .main) { [weak self] _ in self?.connectToChat() }\n    \n    // When the app resigns being active, the leave any existing channels\n    // and disconnect from the websocket.\n    self.willResignActiveObservervation = NotificationCenter.default\n      .addObserver(forName: UIApplication.willResignActiveNotification,\n                   object: nil,\n                   queue: .main) { [weak self] _ in self?.disconnectFromChat() }\n  }\n  \n  private func removeAppActiveObservation() {\n    if let observer = self.didbecomeActiveObservervation {\n      NotificationCenter.default.removeObserver(observer)\n      self.didbecomeActiveObservervation = nil\n    }\n    \n    if let observer = self.willResignActiveObservervation {\n      NotificationCenter.default.removeObserver(observer)\n      self.willResignActiveObservervation = nil\n    }\n  }\n  \n  private func connectToChat() {\n    // Setup the socket to receive open/close events\n    socket.delegateOnOpen(to: self) { (self) in\n      print(\"CHAT ROOM: Socket Opened\")\n    }\n    \n    socket.delegateOnClose(to: self) { (self) in\n      print(\"CHAT ROOM: Socket Closed\")\n      \n    }\n    \n    socket.delegateOnError(to: self) { (self, error) in\n      let (error, response) = error\n      if let statusCode = (response as? HTTPURLResponse)?.statusCode, statusCode > 400 {\n        print(\"CHAT ROOM: Socket Errored. \\(statusCode)\")\n        self.socket.disconnect()\n      } else {\n        print(\"CHAT ROOM: Socket Errored. \\(error)\")\n      }\n    }\n    \n    socket.logger = { msg in print(\"LOG:\", msg) }\n    \n    // Setup the Channel to receive and send messages\n    let channel = socket.channel(topic, params: [\"status\": \"joining\"])\n    channel.delegateOn(\"shout\", to: self) { (self, message) in\n      let payload = message.payload\n      guard\n        let name = payload[\"name\"] as? String,\n        let message = payload[\"message\"] as? String else { return }\n      \n      let shout = Shout(name: name, message: message)\n      self.shouts.append(shout)\n      \n      \n      DispatchQueue.main.async {\n        let indexPath = IndexPath(row: self.shouts.count - 1, section: 0)\n        self.tableView.reloadData() //reloadRows(at: [indexPath], with: .automatic)\n        self.tableView.scrollToRow(at: indexPath, at: .bottom, animated: true)\n      }\n    }\n    \n    // Now connect the socket and join the channel\n    self.lobbyChannel = channel\n    self.lobbyChannel?\n      .join()\n      .delegateReceive(\"ok\", to: self, callback: { (self, _) in\n        print(\"CHANNEL: rooms:lobby joined\")\n      })\n      .delegateReceive(\"error\", to: self, callback: { (self, message) in\n        print(\"CHANNEL: rooms:lobby failed to join. \\(message.payload)\")\n      })\n    \n    self.socket.connect()\n  }\n  \n  private func disconnectFromChat() {\n    if let channel = self.lobbyChannel {\n      channel.leave()\n      self.socket.remove(channel)\n    }\n    \n    self.socket.disconnect()\n    self.shouts = []\n  }\n}\n\n\nextension ChatRoomViewController: UITableViewDataSource {\n  func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {\n    return self.shouts.count\n  }\n  \n  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {\n    let cell = UITableViewCell(style: .subtitle, reuseIdentifier: \"shout_cell\")\n    \n    let shout = self.shouts[indexPath.row]\n    \n    cell.textLabel?.text = shout.message\n    cell.detailTextLabel?.text = shout.name\n    \n    return cell\n  }\n}\n"
  },
  {
    "path": "Gemfile",
    "content": "source \"https://rubygems.org\"\n\ngem 'fastlane'\ngem 'slather'\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2015 David Stump <david@davidstump.net>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "Package.swift",
    "content": "// swift-tools-version:5.3\n// The swift-tools-version declares the minimum version of Swift required to build this package.\n\nimport PackageDescription\nlet package = Package(\n    name: \"SwiftPhoenixClient\",\n    platforms: [\n        .macOS(.v10_12),\n        .iOS(.v10),\n        .tvOS(.v10),\n        .watchOS(.v3)\n    ],\n    products: [\n        // Products define the executables and libraries a package produces, and make them visible to other packages.\n        .library(name: \"SwiftPhoenixClient\", targets: [\"SwiftPhoenixClient\"]),\n    ],\n    dependencies: [\n        // Dependencies declare other packages that this package depends on.\n    ],\n    targets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages this package depends on.\n        .target(\n            name: \"SwiftPhoenixClient\",\n            dependencies: []\n        ),\n        .testTarget(\n            name: \"SwiftPhoenixClientTests\",\n            dependencies: [\"SwiftPhoenixClient\"]),\n    ]\n)\n"
  },
  {
    "path": "README.md",
    "content": "# Swift Phoenix Client\n\n[![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org/)\n[![Version](https://img.shields.io/cocoapods/v/SwiftPhoenixClient.svg?style=flat)](http://cocoapods.org/pods/SwiftPhoenixClient)\n[![License](https://img.shields.io/cocoapods/l/SwiftPhoenixClient.svg?style=flat)](http://cocoapods.org/pods/SwiftPhoenixClient)\n[![Platform](https://img.shields.io/cocoapods/p/SwiftPhoenixClient.svg?style=flat)](http://cocoapods.org/pods/SwiftPhoenixClient)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Open Source Helpers](https://www.codetriage.com/davidstump/swiftphoenixclient/badges/users.svg)](https://www.codetriage.com/davidstump/swiftphoenixclient)\n\n\n## About\nSwiftPhoenixClient is a Swift port of phoenix.js, allowing your swift projects\nto connect to a Phoenix Websocket backend.\n\nWe try out best to keep the library up to date with phoenix.js but if there is\nsomething that is missing, please create an issue or, even better,  a PR to\naddress the change.\n\n## Sample Projects\n\nYou can view the example of how to use SwiftPhoenixClient in the Example/ dir.\nThere are two primary classes, `BasicViewController` and `ChatRoomViewController`.\nThe `BasicViewController` is designed to test against a [local chat server](https://github.com/chrismccord/phoenix_chat_example)\nwhere as `ChatRoomViewController` is a more \"complete\" example which targets\ndwyl's [phoenix-chat-example](https://github.com/dwyl/phoenix-chat-example) Heroku app.\n\n\n### SwiftPhoenixClient\n\nThe core module which provides the Phoenix Channels and Presence logic. It also\nuses URLSession's default WebSocket implementation which has a minimum iOS target\nof 13.0.\n\n\n## Installation\n\n### CocoaPods\n\nYou can install SwiftPhoenix Client via CocoaPods by adding the following to your\nPodfile. Keep in mind that in order to use Swift Phoenix Client, the minimum iOS\ntarget must be '9.0'\n\n```RUBY\npod \"SwiftPhoenixClient\", '~> 5.3'\n```\n\nand running `pod install`. From there you will need to add `import SwiftPhoenixClient` in any class you want it to be used.\n\n### Carthage\n\nIf you use Carthage to manage your dependencies, simply add\nSwiftPhoenixClient to your `Cartfile`:\n\n```\ngithub \"davidstump/SwiftPhoenixClient\" ~> 5.3\n```\n\nThen run `carthage update`.\n\nIf this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).\n\n\n\n### SwiftPackageManager\n\n_Note: Instructions below are for using **SwiftPM** without the Xcode UI. It's the easiest to go to your Project Settings -> Swift Packages and add SwiftPhoenixClient from there._\n\nTo integrate using Apple's Swift package manager, without Xcode integration, add the following as a dependency to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/davidstump/SwiftPhoenixClient.git\", .upToNextMajor(from: \"5.2.2\"))\n```\n\nand then specify `\"SwiftPhoenixClient\"` as a dependency of the Target in which you wish to use SwiftPhoenixClient.\n\n\n## Usage\n\nUsing the Swift Phoenix Client is extremely easy (and familiar if you have used the phoenix.js client).\n\nSee the [Usage Guide](https://github.com/davidstump/SwiftPhoenixClient/wiki/Usage-Guide) for details instructions. You can also check out the [documentation](http://davidstump.github.io/SwiftPhoenixClient/)\n\n\n## Example\n\nCheck out the [ViewController](https://github.com/davidstump/SwiftPhoenixClient/blob/master/Examples/Basic/chatroom/ChatRoomViewController.swift) in this repo for a brief example of a simple iOS chat application using the [Phoenix Chat Example](https://github.com/dwyl/phoenix-chat-example)\n\nAlso check out both the Swift and Elixir channels on IRC.\n\n## Development\n\nCheck out the wiki page for [getting started](https://github.com/davidstump/SwiftPhoenixClient/wiki/Contributing)\n\n\n## Thanks\n\nMany many thanks to [Daniel Rees](https://github.com/dsrees) for his many contributions and continued maintenance of this project!\n\n## License\n\nSwiftPhoenixClient is available under the MIT license. See the LICENSE file for more info.\n"
  },
  {
    "path": "RELEASING.md",
    "content": "Release Process\n===============\n\n 1.  Ensure `version` in `SwiftPhoenixClient.podsec` is set to the version you want to release.\n 2.  Run a trial pod release `pod lib lint`\n 3.  Update `CHANGELOG.md` with the version about to be released along with notes.\n 4.  Commit: `git commit -am \"Prepare version X.Y.X\"`\n 5.  Tag: `git tag -a X.Y.Z -m \"Version X.Y.Z\"`\n 6.  Push: `git push && git push --tags`\n 7.  Release to Cocoapods `pod trunk push SwiftPhoenixClient.podspec`\n 8.  Add the new release with notes (https://github.com/davidstump/SwiftPhoenixClient/releases).\n"
  },
  {
    "path": "Sources/Supporting Files/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(CURRENT_PROJECT_VERSION)</string>\n\t<key>NSHumanReadableCopyright</key>\n\t<string>Copyright © 2021 SwiftPhoenixClient. All rights reserved.</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Sources/Supporting Files/SwiftPhoenixClient.h",
    "content": "//\n//  SwiftPhoenixClient.h\n//  SwiftPhoenixClient\n//\n//  Created by Daniel Rees on 10/21/20.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\n#import <Foundation/Foundation.h>\n\n//! Project version number for SwiftPhoenixClient.\nFOUNDATION_EXPORT double SwiftPhoenixClientVersionNumber;\n\n//! Project version string for SwiftPhoenixClient.\nFOUNDATION_EXPORT const unsigned char SwiftPhoenixClientVersionString[];\n\n// In this header, you should import all the public headers of your framework using statements like #import <SwiftPhoenixClient/PublicHeader.h>\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Channel.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Swift\nimport Foundation\n\n/// Container class of bindings to the channel\nstruct Binding {\n  \n  // The event that the Binding is bound to\n  let event: String\n  \n  // The reference number of the Binding\n  let ref: Int\n  \n  // The callback to be triggered\n  let callback: Delegated<Message, Void>\n}\n\n\n///\n/// Represents a Channel which is bound to a topic\n///\n/// A Channel can bind to multiple events on a given topic and\n/// be informed when those events occur within a topic.\n///\n/// ### Example:\n///\n///     let channel = socket.channel(\"room:123\", params: [\"token\": \"Room Token\"])\n///     channel.on(\"new_msg\") { payload in print(\"Got message\", payload\") }\n///     channel.push(\"new_msg, payload: [\"body\": \"This is a message\"])\n///         .receive(\"ok\") { payload in print(\"Sent message\", payload) }\n///         .receive(\"error\") { payload in print(\"Send failed\", payload) }\n///         .receive(\"timeout\") { payload in print(\"Networking issue...\", payload) }\n///\n///     channel.join()\n///         .receive(\"ok\") { payload in print(\"Channel Joined\", payload) }\n///         .receive(\"error\") { payload in print(\"Failed ot join\", payload) }\n///         .receive(\"timeout\") { payload in print(\"Networking issue...\", payload) }\n///\n\nimport Foundation\n\npublic class Channel {\n  \n  /// The topic of the Channel. e.g. \"rooms:friends\"\n  public let topic: String\n  \n  /// The params sent when joining the channel\n  public var params: Payload {\n    didSet { self.joinPush.payload = params }\n  }\n  \n  /// The Socket that the channel belongs to\n  weak var socket: Socket?\n  \n  /// Current state of the Channel\n  var state: ChannelState\n  \n  /// Collection of event bindings\n  let syncBindingsDel: SynchronizedArray<Binding>\n  \n  /// Tracks event binding ref counters\n  var bindingRef: Int\n  \n  /// Timout when attempting to join a Channel\n  var timeout: TimeInterval\n  \n  /// Set to true once the channel calls .join()\n  var joinedOnce: Bool\n  \n  /// Push to send when the channel calls .join()\n  var joinPush: Push!\n  \n  /// Buffer of Pushes that will be sent once the Channel's socket connects\n  var pushBuffer: [Push]\n  \n  /// Timer to attempt to rejoin\n  var rejoinTimer: TimeoutTimer\n  \n  /// Refs of stateChange hooks\n  var stateChangeRefs: [String]\n  \n  /// Initialize a Channel\n  ///\n  /// - parameter topic: Topic of the Channel\n  /// - parameter params: Optional. Parameters to send when joining.\n  /// - parameter socket: Socket that the channel is a part of\n  init(topic: String, params: [String: Any] = [:], socket: Socket) {\n    self.state = ChannelState.closed\n    self.topic = topic\n    self.params = params\n    self.socket = socket\n    self.syncBindingsDel = SynchronizedArray()\n    self.bindingRef = 0\n    self.timeout = socket.timeout\n    self.joinedOnce = false\n    self.pushBuffer = []\n    self.stateChangeRefs = []\n    self.rejoinTimer = TimeoutTimer()\n    \n    // Setup Timer delgation\n    self.rejoinTimer.callback\n      .delegate(to: self) { (self) in\n        if self.socket?.isConnected == true { self.rejoin() }\n      }\n    \n    self.rejoinTimer.timerCalculation\n      .delegate(to: self) { (self, tries) -> TimeInterval in\n        return self.socket?.rejoinAfter(tries) ?? 5.0\n      }\n    \n    // Respond to socket events\n    let onErrorRef = self.socket?.delegateOnError(to: self, callback: { (self, _) in\n      self.rejoinTimer.reset()\n    })\n    if let ref = onErrorRef { self.stateChangeRefs.append(ref) }\n  \n    let onOpenRef = self.socket?.delegateOnOpen(to: self, callback: { (self) in\n      self.rejoinTimer.reset()\n      if (self.isErrored) { self.rejoin() }\n    })\n    if let ref = onOpenRef { self.stateChangeRefs.append(ref) }\n    \n    // Setup Push Event to be sent when joining\n    self.joinPush = Push(channel: self,\n                         event: ChannelEvent.join,\n                         payload: self.params,\n                         timeout: self.timeout)\n    \n    /// Handle when a response is received after join()\n    self.joinPush.delegateReceive(\"ok\", to: self) { (self, _) in\n      // Mark the Channel as joined\n      self.state = ChannelState.joined\n      \n      // Reset the timer, preventing it from attempting to join again\n      self.rejoinTimer.reset()\n      \n      // Send and buffered messages and clear the buffer\n      self.pushBuffer.forEach( { $0.send() })\n      self.pushBuffer = []\n    }\n    \n    // Perform if Channel errors while attempting to joi\n    self.joinPush.delegateReceive(\"error\", to: self) { (self, _) in\n      self.state = .errored\n      if (self.socket?.isConnected == true) { self.rejoinTimer.scheduleTimeout() }\n    }\n    \n    // Handle when the join push times out when sending after join()\n    self.joinPush.delegateReceive(\"timeout\", to: self) { (self, _) in\n      // log that the channel timed out\n      self.socket?.logItems(\"channel\", \"timeout \\(self.topic) \\(self.joinRef ?? \"\") after \\(self.timeout)s\")\n      \n      // Send a Push to the server to leave the channel\n      let leavePush = Push(channel: self,\n                           event: ChannelEvent.leave,\n                           timeout: self.timeout)\n      leavePush.send()\n      \n      // Mark the Channel as in an error and attempt to rejoin if socket is connected\n      self.state = ChannelState.errored\n      self.joinPush.reset()\n      \n      if (self.socket?.isConnected == true) { self.rejoinTimer.scheduleTimeout() }\n    }\n    \n    /// Perfom when the Channel has been closed\n    self.delegateOnClose(to: self) { (self, _) in\n      // Reset any timer that may be on-going\n      self.rejoinTimer.reset()\n      \n      // Log that the channel was left\n      self.socket?.logItems(\"channel\", \"close topic: \\(self.topic) joinRef: \\(self.joinRef ?? \"nil\")\")\n      \n      // Mark the channel as closed and remove it from the socket\n      self.state = ChannelState.closed\n      self.socket?.remove(self)\n    }\n    \n    /// Perfom when the Channel errors\n    self.delegateOnError(to: self) { (self, message) in\n      // Log that the channel received an error\n      self.socket?.logItems(\"channel\", \"error topic: \\(self.topic) joinRef: \\(self.joinRef ?? \"nil\") mesage: \\(message)\")\n      \n      // If error was received while joining, then reset the Push\n      if (self.isJoining) {\n        // Make sure that the \"phx_join\" isn't buffered to send once the socket\n        // reconnects. The channel will send a new join event when the socket connects.\n        if let safeJoinRef = self.joinRef {\n          self.socket?.removeFromSendBuffer(ref: safeJoinRef)\n        }\n        \n        // Reset the push to be used again later\n        self.joinPush.reset()\n      }\n      \n      // Mark the channel as errored and attempt to rejoin if socket is currently connected\n      self.state = ChannelState.errored\n      if (self.socket?.isConnected == true) { self.rejoinTimer.scheduleTimeout() }\n    }\n    \n    // Perform when the join reply is received\n    self.delegateOn(ChannelEvent.reply, to: self) { (self, message) in\n      // Trigger bindings\n      self.trigger(event: self.replyEventName(message.ref),\n                   payload: message.rawPayload,\n                   ref: message.ref,\n                   joinRef: message.joinRef)\n    }\n  }\n  \n  deinit {\n    rejoinTimer.reset()\n  }\n  \n  /// Overridable message hook. Receives all events for specialized message\n  /// handling before dispatching to the channel callbacks.\n  ///\n  /// - parameter msg: The Message received by the client from the server\n  /// - return: Must return the message, modified or unmodified\n  public var onMessage: (_ message: Message) -> Message = { (message) in\n    return message\n  }\n  \n  /// Joins the channel\n  ///\n  /// - parameter timeout: Optional. Defaults to Channel's timeout\n  /// - return: Push event\n  @discardableResult\n  public func join(timeout: TimeInterval? = nil) -> Push {\n    guard !joinedOnce else {\n      fatalError(\"tried to join multiple times. 'join' \"\n        + \"can only be called a single time per channel instance\")\n    }\n    \n    // Join the Channel\n    if let safeTimeout = timeout { self.timeout = safeTimeout }\n    \n    self.joinedOnce = true\n    self.rejoin()\n    return joinPush\n  }\n  \n  \n  /// Hook into when the Channel is closed. Does not handle retain cycles.\n  /// Use `delegateOnClose(to:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     channel.onClose() { [weak self] message in\n  ///         self?.print(\"Channel \\(message.topic) has closed\"\n  ///     }\n  ///\n  /// - parameter callback: Called when the Channel closes\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func onClose(_ callback: @escaping ((Message) -> Void)) -> Int {\n    return self.on(ChannelEvent.close, callback: callback)\n  }\n  \n  /// Hook into when the Channel is closed. Automatically handles retain\n  /// cycles. Use `onClose()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     channel.delegateOnClose(to: self) { (self, message) in\n  ///         self.print(\"Channel \\(message.topic) has closed\"\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Channel closes\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func delegateOnClose<Target: AnyObject>(to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> Void)) -> Int {\n    return self.delegateOn(ChannelEvent.close, to: owner, callback: callback)\n  }\n  \n  /// Hook into when the Channel receives an Error. Does not handle retain\n  /// cycles. Use `delegateOnError(to:)` for automatic handling of retain\n  /// cycles.\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     channel.onError() { [weak self] (message) in\n  ///         self?.print(\"Channel \\(message.topic) has errored\"\n  ///     }\n  ///\n  /// - parameter callback: Called when the Channel closes\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func onError(_ callback: @escaping ((_ message: Message) -> Void)) -> Int {\n    return self.on(ChannelEvent.error, callback: callback)\n  }\n  \n  /// Hook into when the Channel receives an Error. Automatically handles\n  /// retain cycles. Use `onError()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     channel.delegateOnError(to: self) { (self, message) in\n  ///         self.print(\"Channel \\(message.topic) has closed\"\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Channel closes\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func delegateOnError<Target: AnyObject>(to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> Void)) -> Int {\n    return self.delegateOn(ChannelEvent.error, to: owner, callback: callback)\n  }\n  \n  /// Subscribes on channel events. Does not handle retain cycles. Use\n  /// `delegateOn(_:, to:)` for automatic handling of retain cycles.\n  ///\n  /// Subscription returns a ref counter, which can be used later to\n  /// unsubscribe the exact event listener\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     let ref1 = channel.on(\"event\") { [weak self] (message) in\n  ///         self?.print(\"do stuff\")\n  ///     }\n  ///     let ref2 = channel.on(\"event\") { [weak self] (message) in\n  ///         self?.print(\"do other stuff\")\n  ///     }\n  ///     channel.off(\"event\", ref1)\n  ///\n  /// Since unsubscription of ref1, \"do stuff\" won't print, but \"do other\n  /// stuff\" will keep on printing on the \"event\"\n  ///\n  /// - parameter event: Event to receive\n  /// - parameter callback: Called with the event's message\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func on(_ event: String, callback: @escaping ((Message) -> Void)) -> Int {\n    var delegated = Delegated<Message, Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.on(event, delegated: delegated)\n  }\n  \n  \n  /// Subscribes on channel events. Automatically handles retain cycles. Use\n  /// `on()` to handle yourself.\n  ///\n  /// Subscription returns a ref counter, which can be used later to\n  /// unsubscribe the exact event listener\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     let ref1 = channel.delegateOn(\"event\", to: self) { (self, message) in\n  ///         self?.print(\"do stuff\")\n  ///     }\n  ///     let ref2 = channel.delegateOn(\"event\", to: self) { (self, message) in\n  ///         self?.print(\"do other stuff\")\n  ///     }\n  ///     channel.off(\"event\", ref1)\n  ///\n  /// Since unsubscription of ref1, \"do stuff\" won't print, but \"do other\n  /// stuff\" will keep on printing on the \"event\"\n  ///\n  /// - parameter event: Event to receive\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called with the event's message\n  /// - return: Ref counter of the subscription. See `func off()`\n  @discardableResult\n  public func delegateOn<Target: AnyObject>(_ event: String,\n                                            to owner: Target,\n                                            callback: @escaping ((Target, Message) -> Void)) -> Int {\n    var delegated = Delegated<Message, Void>()\n    delegated.delegate(to: owner, with: callback)\n    \n    return self.on(event, delegated: delegated)\n  }\n  \n  /// Shared method between `on` and `manualOn`\n  @discardableResult\n  private func on(_ event: String, delegated: Delegated<Message, Void>) -> Int {\n    let ref = bindingRef\n    self.bindingRef = ref + 1\n    \n    self.syncBindingsDel.append(Binding(event: event, ref: ref, callback: delegated))\n    return ref\n  }\n  \n  /// Unsubscribes from a channel event. If a `ref` is given, only the exact\n  /// listener will be removed. Else all listeners for the `event` will be\n  /// removed.\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"topic\")\n  ///     let ref1 = channel.on(\"event\") { _ in print(\"ref1 event\" }\n  ///     let ref2 = channel.on(\"event\") { _ in print(\"ref2 event\" }\n  ///     let ref3 = channel.on(\"other_event\") { _ in print(\"ref3 other\" }\n  ///     let ref4 = channel.on(\"other_event\") { _ in print(\"ref4 other\" }\n  ///     channel.off(\"event\", ref1)\n  ///     channel.off(\"other_event\")\n  ///\n  /// After this, only \"ref2 event\" will be printed if the channel receives\n  /// \"event\" and nothing is printed if the channel receives \"other_event\".\n  ///\n  /// - parameter event: Event to unsubscribe from\n  /// - paramter ref: Ref counter returned when subscribing. Can be omitted\n  public func off(_ event: String, ref: Int? = nil) {\n    self.syncBindingsDel.removeAll { (bind) -> Bool in\n      bind.event == event && (ref == nil || ref == bind.ref)\n    }\n  }\n  \n  /// Push a payload to the Channel\n  ///\n  /// Example:\n  ///\n  ///     channel\n  ///         .push(\"event\", payload: [\"message\": \"hello\")\n  ///         .receive(\"ok\") { _ in { print(\"message sent\") }\n  ///\n  /// - parameter event: Event to push\n  /// - parameter payload: Payload to push\n  /// - parameter timeout: Optional timeout\n  @discardableResult\n  public func push(_ event: String,\n                   payload: Payload,\n                   timeout: TimeInterval = Defaults.timeoutInterval) -> Push {\n    guard joinedOnce else { fatalError(\"Tried to push \\(event) to \\(self.topic) before joining. Use channel.join() before pushing events\") }\n    \n    let pushEvent = Push(channel: self,\n                         event: event,\n                         payload: payload,\n                         timeout: timeout)\n    if canPush {\n      pushEvent.send()\n    } else {\n      pushEvent.startTimeout()\n      pushBuffer.append(pushEvent)\n    }\n    \n    return pushEvent\n  }\n  \n  /// Leaves the channel\n  ///\n  /// Unsubscribes from server events, and instructs channel to terminate on\n  /// server\n  ///\n  /// Triggers onClose() hooks\n  ///\n  /// To receive leave acknowledgements, use the a `receive`\n  /// hook to bind to the server ack, ie:\n  ///\n  /// Example:\n  ////\n  ///     channel.leave().receive(\"ok\") { _ in { print(\"left\") }\n  ///\n  /// - parameter timeout: Optional timeout\n  /// - return: Push that can add receive hooks\n  @discardableResult\n  public func leave(timeout: TimeInterval = Defaults.timeoutInterval) -> Push {\n    // If attempting a rejoin during a leave, then reset, cancelling the rejoin\n    self.rejoinTimer.reset()\n    \n    // Now set the state to leaving\n    self.state = .leaving\n    \n    /// Delegated callback for a successful or a failed channel leave\n    var onCloseDelegate = Delegated<Message, Void>()\n    onCloseDelegate.delegate(to: self) { (self, message) in\n      self.socket?.logItems(\"channel\", \"leave \\(self.topic)\")\n      \n      // Triggers onClose() hooks\n      self.trigger(event: ChannelEvent.close, payload: [\"reason\": \"leave\"])\n    }\n    \n    // Push event to send to the server\n    let leavePush = Push(channel: self,\n                         event: ChannelEvent.leave,\n                         timeout: timeout)\n    \n    // Perform the same behavior if successfully left the channel\n    // or if sending the event timed out\n    leavePush\n      .receive(\"ok\", delegated: onCloseDelegate)\n      .receive(\"timeout\", delegated: onCloseDelegate)\n    leavePush.send()\n    \n    // If the Channel cannot send push events, trigger a success locally\n    if !canPush { leavePush.trigger(\"ok\", payload: [:]) }\n    \n    // Return the push so it can be bound to\n    return leavePush\n  }\n  \n  /// Overridable message hook. Receives all events for specialized message\n  /// handling before dispatching to the channel callbacks.\n  ///\n  /// - parameter event: The event the message was for\n  /// - parameter payload: The payload for the message\n  /// - parameter ref: The reference of the message\n  /// - return: Must return the payload, modified or unmodified\n  public func onMessage(callback: @escaping (Message) -> Message) {\n    self.onMessage = callback\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Internal\n  //----------------------------------------------------------------------\n  /// Checks if an event received by the Socket belongs to this Channel\n  func isMember(_ message: Message) -> Bool {\n    // Return false if the message's topic does not match the Channel's topic\n    guard message.topic == self.topic else { return false }\n\n    guard\n      let safeJoinRef = message.joinRef,\n      safeJoinRef != self.joinRef,\n      ChannelEvent.isLifecyleEvent(message.event)\n      else { return true }\n\n    self.socket?.logItems(\"channel\", \"dropping outdated message\", message.topic, message.event, message.rawPayload, safeJoinRef)\n    return false\n  }\n  \n  /// Sends the payload to join the Channel\n  func sendJoin(_ timeout: TimeInterval) {\n    self.state = ChannelState.joining\n    self.joinPush.resend(timeout)\n  }\n  \n  /// Rejoins the channel\n  func rejoin(_ timeout: TimeInterval? = nil) {\n    // Do not attempt to rejoin if the channel is in the process of leaving\n    guard !self.isLeaving else { return }\n    \n    // Leave potentially duplicate channels\n    self.socket?.leaveOpenTopic(topic: self.topic)\n    \n    // Send the joinPush\n    self.sendJoin(timeout ?? self.timeout)\n  }\n  \n  /// Triggers an event to the correct event bindings created by\n  /// `channel.on(\"event\")`.\n  ///\n  /// - parameter message: Message to pass to the event bindings\n  func trigger(_ message: Message) {\n    let handledMessage = self.onMessage(message)\n    \n    self.syncBindingsDel.forEach { binding in\n        if binding.event == message.event {\n            binding.callback.call(handledMessage)\n        }\n    }\n  }\n  \n  /// Triggers an event to the correct event bindings created by\n  //// `channel.on(\"event\")`.\n  ///\n  /// - parameter event: Event to trigger\n  /// - parameter payload: Payload of the event\n  /// - parameter ref: Ref of the event. Defaults to empty\n  /// - parameter joinRef: Ref of the join event. Defaults to nil\n  func trigger(event: String,\n               payload: Payload = [:],\n               ref: String = \"\",\n               joinRef: String? = nil) {\n    let message = Message(ref: ref,\n                          topic: self.topic,\n                          event: event,\n                          payload: payload,\n                          joinRef: joinRef ?? self.joinRef)\n    self.trigger(message)\n  }\n  \n  /// - parameter ref: The ref of the event push\n  /// - return: The event name of the reply\n  func replyEventName(_ ref: String) -> String {\n    return \"chan_reply_\\(ref)\"\n  }\n  \n  /// The Ref send during the join message.\n  var joinRef: String? {\n    return self.joinPush.ref\n  }\n  \n  /// - return: True if the Channel can push messages, meaning the socket\n  ///           is connected and the channel is joined\n  var canPush: Bool {\n    return self.socket?.isConnected == true && self.isJoined\n  }\n}\n\n\n//----------------------------------------------------------------------\n// MARK: - Public API\n//----------------------------------------------------------------------\nextension Channel {\n  \n  /// - return: True if the Channel has been closed\n  public var isClosed: Bool {\n    return state == .closed\n  }\n  \n  /// - return: True if the Channel experienced an error\n  public var isErrored: Bool {\n    return state == .errored\n  }\n  \n  /// - return: True if the channel has joined\n  public var isJoined: Bool {\n    return state == .joined\n  }\n  \n  /// - return: True if the channel has requested to join\n  public var isJoining: Bool {\n    return state == .joining\n  }\n  \n  /// - return: True if the channel has requested to leave\n  public var isLeaving: Bool {\n    return state == .leaving\n  }\n  \n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Defaults.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n\n/// A collection of default values and behaviors used across the Client\npublic class Defaults {\n  \n  /// Default timeout when sending messages\n  public static let timeoutInterval: TimeInterval = 10.0\n  \n  /// Default interval to send heartbeats on\n  public static let heartbeatInterval: TimeInterval = 30.0\n\n  /// Default maximum amount of time which the system may delay heartbeat events in order to minimize power usage\n  public static let heartbeatLeeway: DispatchTimeInterval = .milliseconds(10)\n  \n  /// Default reconnect algorithm for the socket\n  public static let reconnectSteppedBackOff: (Int) -> TimeInterval = { tries in\n    return tries > 9 ? 5.0 : [0.01, 0.05, 0.1, 0.15, 0.2, 0.25, 0.5, 1.0, 2.0][tries - 1]\n  }\n  \n  /** Default rejoin algorithm for individual channels */\n  public static let rejoinSteppedBackOff: (Int) -> TimeInterval = { tries in\n    return tries > 3 ? 10 : [1, 2, 5][tries - 1]\n  }\n\n  public static let vsn = \"2.0.0\"\n  \n  /// Default encode function, utilizing JSONSerialization.data\n  public static let encode: (Any) -> Data = { json in\n    return try! JSONSerialization\n      .data(withJSONObject: json,\n            options: JSONSerialization.WritingOptions())\n  }\n  \n  /// Default decode function, utilizing JSONSerialization.jsonObject\n  public static let decode: (Data) -> Any? = { data in\n    guard\n      let json = try? JSONSerialization\n        .jsonObject(with: data,\n                    options: JSONSerialization.ReadingOptions())\n      else { return nil }\n    return json\n  }\n  \n  public static let heartbeatQueue: DispatchQueue\n    = DispatchQueue(label: \"com.phoenix.socket.heartbeat\")\n}\n\n\n/// Represents the multiple states that a Channel can be in\n/// throughout it's lifecycle.\npublic enum ChannelState: String {\n  case closed = \"closed\"\n  case errored = \"errored\"\n  case joined = \"joined\"\n  case joining = \"joining\"\n  case leaving = \"leaving\"\n}\n\n/// Represents the different events that can be sent through\n/// a channel regarding a Channel's lifecycle.\npublic struct ChannelEvent {\n  public static let heartbeat = \"heartbeat\"\n  public static let join      = \"phx_join\"\n  public static let leave     = \"phx_leave\"\n  public static let reply     = \"phx_reply\"\n  public static let error     = \"phx_error\"\n  public static let close     = \"phx_close\"\n  \n  static func isLifecyleEvent(_ event: String) -> Bool {\n    switch event {\n    case join, leave, reply, error, close: return true\n    default: return false\n    }\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Delegated.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n/// Provides a memory-safe way of passing callbacks around while not creating\n/// retain cycles. This file was copied from https://github.com/dreymonde/Delegated\n/// instead of added as a dependency to reduce the number of packages that\n/// ship with SwiftPhoenixClient\npublic struct Delegated<Input, Output> {\n  \n  private(set) var callback: ((Input) -> Output?)?\n  \n  public init() { }\n  \n  public mutating func delegate<Target : AnyObject>(to target: Target,\n                                                    with callback: @escaping (Target, Input) -> Output) {\n    self.callback = { [weak target] input in\n      guard let target = target else {\n        return nil\n      }\n      return callback(target, input)\n    }\n  }\n  \n  public func call(_ input: Input) -> Output? {\n    return self.callback?(input)\n  }\n  \n  public var isDelegateSet: Bool {\n    return callback != nil\n  }\n  \n}\n\nextension Delegated {\n  \n  public mutating func stronglyDelegate<Target : AnyObject>(to target: Target,\n                                                            with callback: @escaping (Target, Input) -> Output) {\n    self.callback = { input in\n      return callback(target, input)\n    }\n  }\n  \n  public mutating func manuallyDelegate(with callback: @escaping (Input) -> Output) {\n    self.callback = callback\n  }\n  \n  public mutating func removeDelegate() {\n    self.callback = nil\n  }\n  \n}\n\nextension Delegated where Input == Void {\n  \n  public mutating func delegate<Target : AnyObject>(to target: Target,\n                                                    with callback: @escaping (Target) -> Output) {\n    self.delegate(to: target, with: { target, voidInput in callback(target) })\n  }\n  \n  public mutating func stronglyDelegate<Target : AnyObject>(to target: Target,\n                                                            with callback: @escaping (Target) -> Output) {\n    self.stronglyDelegate(to: target, with: { target, voidInput in callback(target) })\n  }\n  \n}\n\nextension Delegated where Input == Void {\n  \n  public func call() -> Output? {\n    return self.call(())\n  }\n  \n}\n\nextension Delegated where Output == Void {\n  \n  public func call(_ input: Input) {\n    self.callback?(input)\n  }\n  \n}\n\nextension Delegated where Input == Void, Output == Void {\n  \n  public func call() {\n    self.call(())\n  }\n  \n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/HeartbeatTimer.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n\n\n\n/**\n Heartbeat Timer class which manages the lifecycle of the underlying\n timer which triggers when a heartbeat should be fired. This heartbeat\n runs on it's own Queue so that it does not interfere with the main\n queue but guarantees thread safety.\n */\n\nclass HeartbeatTimer {\n  \n  //----------------------------------------------------------------------\n  // MARK: - Dependencies\n  //----------------------------------------------------------------------\n  // The interval to wait before firing the Timer\n  let timeInterval: TimeInterval\n\n  /// The maximum amount of time which the system may delay the delivery of the timer events\n  let leeway: DispatchTimeInterval\n  \n  // The DispatchQueue to schedule the timers on\n  let queue: DispatchQueue\n  \n  // UUID which specifies the Timer instance. Verifies that timers are different\n  let uuid: String = UUID().uuidString\n  \n  //----------------------------------------------------------------------\n  // MARK: - Properties\n  //----------------------------------------------------------------------\n  // The underlying, cancelable, resettable, timer.\n  private var temporaryTimer: DispatchSourceTimer? = nil\n  // The event handler that is called by the timer when it fires.\n  private var temporaryEventHandler: (() -> Void)? = nil\n  \n  /**\n   Create a new HeartbeatTimer\n   \n   - Parameters:\n     - timeInterval: Interval to fire the timer. Repeats\n     - queue: Queue to schedule the timer on\n     - leeway: The maximum amount of time which the system may delay the delivery of the timer events\n   */\n  init(timeInterval: TimeInterval, queue: DispatchQueue = Defaults.heartbeatQueue, leeway: DispatchTimeInterval = Defaults.heartbeatLeeway) {\n    self.timeInterval = timeInterval\n    self.queue = queue\n    self.leeway = leeway\n  }\n  \n  /**\n   Create a new HeartbeatTimer\n   \n   - Parameter timeInterval: Interval to fire the timer. Repeats\n   */\n  convenience init(timeInterval: TimeInterval) {\n    self.init(timeInterval: timeInterval, queue: Defaults.heartbeatQueue)\n  }\n  \n  func start(eventHandler: @escaping () -> Void) {\n    queue.sync { [weak self] in\n      guard let self = self else { return }\n        \n      // Create a new DispatchSourceTimer, passing the event handler\n      let timer = DispatchSource.makeTimerSource(flags: [], queue: queue)\n      timer.setEventHandler(handler: eventHandler)\n      \n      // Schedule the timer to first fire in `timeInterval` and then\n      // repeat every `timeInterval`\n      timer.schedule(deadline: DispatchTime.now() + self.timeInterval,\n                     repeating: self.timeInterval,\n                     leeway: self.leeway)\n      \n      // Start the timer\n      timer.resume()\n      self.temporaryEventHandler = eventHandler\n      self.temporaryTimer = timer\n    }\n  }\n  \n  func stop() {\n    // Must be queued synchronously to prevent threading issues.\n    queue.sync { [weak self] in\n      guard let self = self else { return }\n        \n      // DispatchSourceTimer will automatically cancel when released\n      temporaryTimer = nil\n      temporaryEventHandler = nil\n    }\n  }\n  \n  /**\n   True if the Timer exists and has not been cancelled. False otherwise\n   */\n  var isValid: Bool {\n    guard let timer = self.temporaryTimer else { return false }\n    return !timer.isCancelled\n  }\n  \n  /**\n   Calls the Timer's event handler immediately. This method\n   is primarily used in tests (not ideal)\n   */\n  func fire() {\n    guard isValid else { return }\n    self.temporaryEventHandler?()\n  }\n}\n\nextension HeartbeatTimer: Equatable {\n  static func == (lhs: HeartbeatTimer, rhs: HeartbeatTimer) -> Bool {\n    return lhs.uuid == rhs.uuid\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Message.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n\n/// Data that is received from the Server.\npublic class Message {\n  \n  /// Reference number. Empty if missing\n  public let ref: String\n  \n  /// Join Reference number\n  internal let joinRef: String?\n  \n  /// Message topic\n  public let topic: String\n  \n  /// Message event\n  public let event: String\n  \n  /// The raw payload from the Message, including a nested response from\n  /// phx_reply events. It is recommended to use `payload` instead.\n  internal let rawPayload: Payload\n  \n  /// Message payload\n  public var payload: Payload {\n    guard let response = rawPayload[\"response\"] as? Payload\n    else { return rawPayload }\n    return response\n  }\n  \n  /// Convenience accessor. Equivalent to getting the status as such:\n  /// ```swift\n  /// message.payload[\"status\"]\n  /// ```\n  public var status: String? {\n    return rawPayload[\"status\"] as? String\n  }\n\n  init(ref: String = \"\",\n       topic: String = \"\",\n       event: String = \"\",\n       payload: Payload = [:],\n       joinRef: String? = nil) {\n    self.ref = ref\n    self.topic = topic\n    self.event = event\n    self.rawPayload = payload\n    self.joinRef = joinRef\n  }\n\n  init?(json: [Any?]) {\n    guard json.count > 4 else { return nil }\n    self.joinRef = json[0] as? String\n    self.ref = json[1] as? String ?? \"\"\n    \n    if \n      let topic = json[2] as? String,\n      let event = json[3] as? String,\n      let payload = json[4] as? Payload {\n        \n      self.topic = topic\n      self.event = event\n      self.rawPayload = payload\n    } else {\n      return nil\n    }\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/PhoenixTransport.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n\n\n//----------------------------------------------------------------------\n// MARK: - Transport Protocol\n//----------------------------------------------------------------------\n/**\n Defines a `Socket`'s Transport layer.\n */\n// sourcery: AutoMockable\npublic protocol PhoenixTransport {\n  \n  /// The current `ReadyState` of the `Transport` layer\n  var readyState: PhoenixTransportReadyState { get }\n  \n  /// Delegate for the `Transport` layer\n  var delegate: PhoenixTransportDelegate? { get set }\n  \n  /**\n   Connect to the server\n   \n   - Parameters:\n   - headers: Headers to include in the URLRequests when opening the Websocket connection. Can be empty [:]\n   */\n  func connect(with headers: [String: Any])\n  \n  /**\n   Disconnect from the server.\n   \n   - Parameters:\n   - code: Status code as defined by <ahref=\"http://tools.ietf.org/html/rfc6455#section-7.4\">Section 7.4 of RFC 6455</a>.\n   - reason: Reason why the connection is closing. Optional.\n   */\n  func disconnect(code: Int, reason: String?)\n  \n  /**\n   Sends a message to the server.\n   \n   - Parameter data: Data to send.\n   */\n  func send(data: Data)\n}\n\n\n//----------------------------------------------------------------------\n// MARK: - Transport Delegate Protocol\n//----------------------------------------------------------------------\n/**\n Delegate to receive notifications of events that occur in the `Transport` layer\n */\npublic protocol PhoenixTransportDelegate {\n  \n  /**\n   Notified when the `Transport` opens.\n   \n   - Parameter response: Response from the server indicating that the WebSocket handshake was successful and the connection has been upgraded to webSockets\n   */\n  func onOpen(response: URLResponse?)\n  \n  /**\n   Notified when the `Transport` receives an error.\n   \n   - Parameter error: Client-side error from the underlying `Transport` implementation\n   - Parameter response: Response from the server, if any, that occurred with the Error\n   \n   */\n  func onError(error: Error, response: URLResponse?)\n  \n  /**\n   Notified when the `Transport` receives a message from the server.\n   \n   - Parameter message: Message received from the server\n   */\n  func onMessage(message: String)\n  \n  /**\n   Notified when the `Transport` closes.\n   \n   - Parameter code: Code that was sent when the `Transport` closed\n   - Parameter reason: A concise human-readable prose explanation for the closure\n   */\n  func onClose(code: Int, reason: String?)\n}\n\n//----------------------------------------------------------------------\n// MARK: - Transport Ready State Enum\n//----------------------------------------------------------------------\n/**\n Available `ReadyState`s of a `Transport` layer.\n */\npublic enum PhoenixTransportReadyState {\n  \n  /// The `Transport` is opening a connection to the server.\n  case connecting\n  \n  /// The `Transport` is connected to the server.\n  case open\n  \n  /// The `Transport` is closing the connection to the server.\n  case closing\n  \n  /// The `Transport` has disconnected from the server.\n  case closed\n  \n}\n\n//----------------------------------------------------------------------\n// MARK: - Default Websocket Transport Implementation\n//----------------------------------------------------------------------\n/**\n A `Transport` implementation that relies on URLSession's native WebSocket\n implementation.\n \n This implementation ships default with SwiftPhoenixClient however\n SwiftPhoenixClient supports earlier OS versions using one of the submodule\n `Transport` implementations. Or you can create your own implementation using\n your own WebSocket library or implementation.\n */\n@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)\nopen class URLSessionTransport: NSObject, PhoenixTransport, URLSessionWebSocketDelegate {\n  \n  \n  /// The URL to connect to\n  internal let url: URL\n  \n  /// The URLSession configuration\n  internal let configuration: URLSessionConfiguration\n    \n  /// The underling URLSession. Assigned during `connect()`\n  private var session: URLSession? = nil\n  \n  /// The ongoing task. Assigned during `connect()`\n  private var task: URLSessionWebSocketTask? = nil\n\n  /// Holds the current receive task\n  private var receiveMessageTask: Task<Void, Never>? {\n      didSet {\n          oldValue?.cancel()\n      }\n  }\n  \n  /**\n   Initializes a `Transport` layer built using URLSession's WebSocket\n   \n   Example:\n   \n   ```swift\n   let url = URL(\"wss://example.com/socket\")\n   let transport: Transport = URLSessionTransport(url: url)\n   ```\n     \n   Using a custom `URLSessionConfiguration`\n\n   ```swift\n   let url = URL(\"wss://example.com/socket\")\n   let configuration = URLSessionConfiguration.default\n   let transport: Transport = URLSessionTransport(url: url, configuration: configuration)\n   ```\n   \n   - parameter url: URL to connect to\n   - parameter configuration: Provide your own URLSessionConfiguration. Uses `.default` if none provided\n   */\n  public init(url: URL, configuration: URLSessionConfiguration = .default) {\n  \n    // URLSession requires that the endpoint be \"wss\" instead of \"https\".\n    let endpoint = url.absoluteString\n    let wsEndpoint = endpoint\n      .replacingOccurrences(of: \"http://\", with: \"ws://\")\n      .replacingOccurrences(of: \"https://\", with: \"wss://\")\n    \n    // Force unwrapping should be safe here since a valid URL came in and we just\n    // replaced the protocol.\n    self.url = URL(string: wsEndpoint)!\n    self.configuration = configuration\n    \n    super.init()\n  }\n  \n  deinit {\n    self.delegate = nil\n    receiveMessageTask?.cancel()\n  }\n  \n  \n  // MARK: - Transport\n  public var readyState: PhoenixTransportReadyState = .closed\n  public var delegate: PhoenixTransportDelegate? = nil\n  \n  public func connect(with headers: [String : Any]) {\n    // Set the transport state as connecting\n    self.readyState = .connecting\n    \n    // Create the session and websocket task\n    self.session = URLSession(configuration: self.configuration, delegate: self, delegateQueue: nil)\n    var request = URLRequest(url: url)\n      \n    headers.forEach { (key: String, value: Any) in\n        guard let value = value as? String else { return }\n        request.addValue(value, forHTTPHeaderField: key)\n    }\n      \n    self.task = self.session?.webSocketTask(with: request)\n\n    \n    // Start the task\n    self.task?.resume()\n  }\n  \n  open func disconnect(code: Int, reason: String?) {\n    /*\n     TODO:\n     1. Provide a \"strict\" mode that fails if an invalid close code is given\n     2. If strict mode is disabled, default to CloseCode.invalid\n     3. Provide default .normalClosure function\n     */\n    guard let closeCode = URLSessionWebSocketTask.CloseCode.init(rawValue: code) else {\n      fatalError(\"Could not create a CloseCode with invalid code: [\\(code)].\")\n    }\n    \n    self.readyState = .closing\n    self.task?.cancel(with: closeCode, reason: reason?.data(using: .utf8))\n    self.session?.finishTasksAndInvalidate()\n    receiveMessageTask?.cancel()\n  }\n  \n  open func send(data: Data) {\n    self.task?.send(.string(String(data: data, encoding: .utf8)!)) { (error) in\n      // TODO: What is the behavior when an error occurs?\n    }\n  }\n  \n  \n  // MARK: - URLSessionWebSocketDelegate\n  open func urlSession(_ session: URLSession,\n                       webSocketTask: URLSessionWebSocketTask,\n                       didOpenWithProtocol protocol: String?) {\n    // The Websocket is connected. Set Transport state to open and inform delegate\n    self.readyState = .open\n    self.delegate?.onOpen(response: webSocketTask.response)\n    \n    // Start receiving messages\n    self.receive()\n  }\n  \n  open func urlSession(_ session: URLSession,\n                       webSocketTask: URLSessionWebSocketTask,\n                       didCloseWith closeCode: URLSessionWebSocketTask.CloseCode,\n                       reason: Data?) {\n    // A close frame was received from the server.\n    self.readyState = .closed\n    self.delegate?.onClose(code: closeCode.rawValue, reason: reason.flatMap { String(data: $0, encoding: .utf8) })\n  }\n  \n  open func urlSession(_ session: URLSession,\n                       task: URLSessionTask,\n                       didCompleteWithError error: Error?) {\n    // The task has terminated. Inform the delegate that the transport has closed abnormally\n    // if this was caused by an error.\n    guard let err = error else { return }\n    \n    self.abnormalErrorReceived(err, response: task.response)\n  }\n  \n  \n  // MARK: - Private\n  private func receive() {\n    receiveMessageTask = Task { [weak self] in\n      guard let self else { return }\n        do {\n            let message = try await task?.receive()\n            switch message {\n            case .data:\n                print(\"Data received. This method is unsupported by the Client\")\n            case .string(let text):\n                delegate?.onMessage(message: text)\n            default:\n                fatalError(\"Nil message received.\")\n            }\n              \n            // Since `.receive()` is only good for a single message, it must\n            // be called again after a message is received in order to\n            // received the next message.\n            receive()\n          } catch {\n              print(\"Error when receiving \\(error)\")\n              abnormalErrorReceived(error, response: nil)\n          }\n      }\n  }\n  \n  private func abnormalErrorReceived(_ error: Error, response: URLResponse?) {\n    // Set the state of the Transport to closed\n    self.readyState = .closed\n    \n    // Inform the Transport's delegate that an error occurred.\n    self.delegate?.onError(error: error, response: response)\n    \n    // An abnormal error is results in an abnormal closure, such as internet getting dropped\n    // so inform the delegate that the Transport has closed abnormally. This will kick off\n    // the reconnect logic.\n    self.delegate?.onClose(code: Socket.CloseCode.abnormal.rawValue, reason: error.localizedDescription)\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Presence.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nimport Foundation\n\n/// The Presence object provides features for syncing presence information from\n/// the server with the client and handling presences joining and leaving.\n///\n/// ## Syncing state from the server\n///\n/// To sync presence state from the server, first instantiate an object and pass\n/// your channel in to track lifecycle events:\n///\n///     let channel = socket.channel(\"some:topic\")\n///     let presence = Presence(channel)\n///\n/// If you have custom syncing state events, you can configure the `Presence`\n/// object to use those instead.\n///\n///     let options = Options(events: [.state: \"my_state\", .diff: \"my_diff\"])\n///     let presence = Presence(channel, opts: options)\n///\n/// Next, use the presence.onSync callback to react to state changes from the\n/// server. For example, to render the list of users every time the list\n/// changes, you could write:\n///\n///     presence.onSync { renderUsers(presence.list()) }\n///\n/// ## Listing Presences\n///\n/// presence.list is used to return a list of presence information based on the\n/// local state of metadata. By default, all presence metadata is returned, but\n/// a listBy function can be supplied to allow the client to select which\n/// metadata to use for a given presence. For example, you may have a user\n/// online from different devices with a metadata status of \"online\", but they\n/// have set themselves to \"away\" on another device. In this case, the app may\n/// choose to use the \"away\" status for what appears on the UI. The example\n/// below defines a listBy function which prioritizes the first metadata which\n/// was registered for each user. This could be the first tab they opened, or\n/// the first device they came online from:\n///\n///     let listBy: (String, Presence.Map) -> Presence.Meta = { id, pres in\n///         let first = pres[\"metas\"]!.first!\n///         first[\"count\"] = pres[\"metas\"]!.count\n///         first[\"id\"] = id\n///         return first\n///     }\n///     let onlineUsers = presence.list(by: listBy)\n///\n/// (NOTE: The underlying behavior is a `map` on the `presence.state`. You are\n/// mapping the `state` dictionary into whatever datastructure suites your needs)\n///\n/// ## Handling individual presence join and leave events\n///\n/// The presence.onJoin and presence.onLeave callbacks can be used to react to\n/// individual presences joining and leaving the app. For example:\n///\n///     let presence = Presence(channel)\n///     presence.onJoin { [weak self] (key, current, newPres) in\n///         if let cur = current {\n///             print(\"user additional presence\", cur)\n///         } else {\n///             print(\"user entered for the first time\", newPres)\n///         }\n///     }\n///\n///     presence.onLeave { [weak self] (key, current, leftPres) in\n///         if current[\"metas\"]?.isEmpty == true {\n///             print(\"user has left from all devices\", leftPres)\n///         } else {\n///             print(\"user left from a device\", current)\n///         }\n///     }\n///\n///     presence.onSync { renderUsers(presence.list()) }\npublic final class Presence {\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Enums and Structs\n  //----------------------------------------------------------------------\n  /// Custom options that can be provided when creating Presence\n  ///\n  /// ### Example:\n  ///\n  ///     let options = Options(events: [.state: \"my_state\", .diff: \"my_diff\"])\n  ///     let presence = Presence(channel, opts: options)\n  public struct Options {\n    let events: [Events: String]\n    \n    /// Default set of Options used when creating Presence. Uses the\n    /// phoenix events \"presence_state\" and \"presence_diff\"\n    static public let defaults\n      = Options(events: [.state: \"presence_state\",\n                         .diff: \"presence_diff\"])\n    \n    public init(events: [Events: String]) {\n      self.events = events\n    }\n  }\n  \n  /// Presense Events\n  public enum Events: String {\n    case state = \"state\"\n    case diff = \"diff\"\n  }\n  \n  //----------------------------------------------------------------------\n  // MARK: - Typaliases\n  //----------------------------------------------------------------------\n  /// Meta details of a Presence. Just a dictionary of properties\n  public typealias Meta = [String: Any]\n  \n  /// A mapping of a String to an array of Metas. e.g. {\"metas\": [{id: 1}]}\n  public typealias Map = [String: [Meta]]\n  \n  /// A mapping of a Presence state to a mapping of Metas\n  public typealias State = [String: Map]\n  \n  // Diff has keys \"joins\" and \"leaves\", pointing to a Presence.State each\n  // containing the users that joined and left.\n  public typealias Diff = [String: State]\n  \n  /// Closure signature of OnJoin callbacks\n  public typealias OnJoin = (_ key: String, _ current: Map?, _ new: Map) -> Void\n  \n  /// Closure signature for OnLeave callbacks\n  public typealias OnLeave = (_ key: String, _ current: Map, _ left: Map) -> Void\n  \n  //// Closure signature for OnSync callbacks\n  public typealias OnSync = () -> Void\n  \n  /// Collection of callbacks with default values\n  struct Caller {\n    var onJoin: OnJoin = {_,_,_ in }\n    var onLeave: OnLeave = {_,_,_ in }\n    var onSync: OnSync = {}\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Properties\n  //----------------------------------------------------------------------\n  /// The channel the Presence belongs to\n  weak var channel: Channel?\n  \n  /// Caller to callback hooks\n  var caller: Caller\n  \n  /// The state of the Presence\n  private(set) public var state: State\n  \n  /// Pending `join` and `leave` diffs that need to be synced\n  private(set) public var pendingDiffs: [Diff]\n  \n  /// The channel's joinRef, set when state events occur\n  private(set) public var joinRef: String?\n  \n  public var isPendingSyncState: Bool {\n    guard let safeJoinRef = self.joinRef else { return true }\n    return safeJoinRef != self.channel?.joinRef\n  }\n  \n  /// Callback to be informed of joins\n  public var onJoin: OnJoin {\n    get { return caller.onJoin }\n    set { caller.onJoin = newValue }\n  }\n  \n  /// Set the OnJoin callback\n  public func onJoin(_ callback: @escaping OnJoin) {\n    self.onJoin = callback\n  }\n  \n  /// Callback to be informed of leaves\n  public var onLeave: OnLeave {\n    get { return caller.onLeave }\n    set { caller.onLeave = newValue }\n  }\n  \n  /// Set the OnLeave callback\n  public func onLeave(_ callback: @escaping OnLeave) {\n    self.onLeave = callback\n  }\n  \n  /// Callback to be informed of synces\n  public var onSync: OnSync {\n    get { return caller.onSync }\n    set { caller.onSync = newValue }\n  }\n  \n  /// Set the OnSync callback\n  public func onSync(_ callback: @escaping OnSync) {\n    self.onSync = callback\n  }\n  \n  \n  public init(channel: Channel, opts: Options = Options.defaults) {\n    self.state = [:]\n    self.pendingDiffs = []\n    self.channel = channel\n    self.joinRef = nil\n    self.caller = Caller()\n    \n    guard // Do not subscribe to events if they were not provided\n      let stateEvent = opts.events[.state],\n      let diffEvent = opts.events[.diff] else { return }\n    \n    \n    self.channel?.delegateOn(stateEvent, to: self) { (self, message) in\n      guard let newState = message.rawPayload as? State else { return }\n      \n      self.joinRef = self.channel?.joinRef\n      self.state = Presence.syncState(self.state,\n                                      newState: newState,\n                                      onJoin: self.caller.onJoin,\n                                      onLeave: self.caller.onLeave)\n      \n      self.pendingDiffs.forEach({ (diff) in\n        self.state = Presence.syncDiff(self.state,\n                                       diff: diff,\n                                       onJoin: self.caller.onJoin,\n                                       onLeave: self.caller.onLeave)\n      })\n      \n      self.pendingDiffs = []\n      self.caller.onSync()\n    }\n    \n    self.channel?.delegateOn(diffEvent, to: self) { (self, message) in\n      guard let diff = message.rawPayload as? Diff else { return }\n      if self.isPendingSyncState {\n        self.pendingDiffs.append(diff)\n      } else {\n        self.state = Presence.syncDiff(self.state,\n                                       diff: diff,\n                                       onJoin: self.caller.onJoin,\n                                       onLeave: self.caller.onLeave)\n        self.caller.onSync()\n      }\n    }\n  }\n  \n  /// Returns the array of presences, with deault selected metadata.\n  public func list() -> [Map] {\n    return self.list(by: { _, pres in pres })\n  }\n  \n  /// Returns the array of presences, with selected metadata\n  public func list<T>(by transformer: (String, Map) -> T) -> [T] {\n    return Presence.listBy(self.state, transformer: transformer)\n  }\n  \n  /// Filter the Presence state with a given function\n  public func filter(by filter: ((String, Map) -> Bool)?) -> State {\n    return Presence.filter(self.state, by: filter)\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Static\n  //----------------------------------------------------------------------\n  \n  // Used to sync the list of presences on the server\n  // with the client's state. An optional `onJoin` and `onLeave` callback can\n  // be provided to react to changes in the client's local presences across\n  // disconnects and reconnects with the server.\n  //\n  // - returns: Presence.State\n  @discardableResult\n  public static func syncState(_ currentState: State,\n                               newState: State,\n                               onJoin: OnJoin = {_,_,_ in },\n                               onLeave: OnLeave = {_,_,_ in }) -> State {\n    let state = currentState\n    var leaves: Presence.State = [:]\n    var joins: Presence.State = [:]\n    \n    state.forEach { (key, presence) in\n      if newState[key] == nil {\n        leaves[key] = presence\n      }\n    }\n    \n    newState.forEach { (key, newPresence) in\n      if let currentPresence = state[key] {\n        let newRefs = newPresence[\"metas\"]!.map({ $0[\"phx_ref\"] as! String })\n        let curRefs = currentPresence[\"metas\"]!.map({ $0[\"phx_ref\"] as! String })\n        \n        let joinedMetas = newPresence[\"metas\"]!.filter({ (meta: Meta) -> Bool in\n          !curRefs.contains { $0 == meta[\"phx_ref\"] as! String }\n        })\n        let leftMetas = currentPresence[\"metas\"]!.filter({ (meta: Meta) -> Bool in\n          !newRefs.contains { $0 == meta[\"phx_ref\"] as! String }\n        })\n        \n        \n        if joinedMetas.count > 0 {\n          joins[key] = newPresence\n          joins[key]![\"metas\"] = joinedMetas\n        }\n        \n        if leftMetas.count > 0 {\n          leaves[key] = currentPresence\n          leaves[key]![\"metas\"] = leftMetas\n        }\n      } else {\n        joins[key] = newPresence\n      }\n    }\n    \n    return Presence.syncDiff(state,\n                             diff: [\"joins\": joins, \"leaves\": leaves],\n                             onJoin: onJoin,\n                             onLeave: onLeave)\n  }\n  \n  \n  // Used to sync a diff of presence join and leave\n  // events from the server, as they happen. Like `syncState`, `syncDiff`\n  // accepts optional `onJoin` and `onLeave` callbacks to react to a user\n  // joining or leaving from a device.\n  //\n  // - returns: Presence.State\n  @discardableResult\n  public static func syncDiff(_ currentState: State,\n                              diff: Diff,\n                              onJoin: OnJoin = {_,_,_ in },\n                              onLeave: OnLeave = {_,_,_ in }) -> State {\n    var state = currentState\n    diff[\"joins\"]?.forEach { (key, newPresence) in\n      let currentPresence = state[key]\n      state[key] = newPresence\n      \n      if let curPresence = currentPresence {\n        let joinedRefs = state[key]![\"metas\"]!.map({ $0[\"phx_ref\"] as! String })\n        let curMetas = curPresence[\"metas\"]!.filter { (meta: Meta) -> Bool in\n          !joinedRefs.contains { $0 == meta[\"phx_ref\"] as! String }\n        }\n        state[key]![\"metas\"]!.insert(contentsOf: curMetas, at: 0)\n      }\n      \n      onJoin(key, currentPresence, newPresence)\n    }\n    \n    diff[\"leaves\"]?.forEach({ (key, leftPresence) in\n      guard var curPresence = state[key] else { return }\n      let refsToRemove = leftPresence[\"metas\"]!.map { $0[\"phx_ref\"] as! String }\n      let keepMetas = curPresence[\"metas\"]!.filter { (meta: Meta) -> Bool in\n        !refsToRemove.contains { $0 == meta[\"phx_ref\"] as! String }\n      }\n      \n      curPresence[\"metas\"] = keepMetas\n      onLeave(key, curPresence, leftPresence)\n      \n      if keepMetas.count > 0 {\n        state[key]![\"metas\"] = keepMetas\n      } else {\n        state.removeValue(forKey: key)\n      }\n    })\n    \n    return state\n  }\n  \n  public static func filter(_ presences: State,\n                            by filter: ((String, Map) -> Bool)?) -> State {\n    let safeFilter = filter ?? { key, pres in true }\n    return presences.filter(safeFilter)\n  }\n  \n  public static func listBy<T>(_ presences: State,\n                               transformer: (String, Map) -> T) -> [T] {\n    return presences.map(transformer)\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Push.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nimport Foundation\n\n\n/// Represnts pushing data to a `Channel` through the `Socket`\npublic class Push {\n  \n  /// The channel sending the Push\n  public weak var channel: Channel?\n  \n  /// The event, for example `phx_join`\n  public let event: String\n  \n  /// The payload, for example [\"user_id\": \"abc123\"]\n  public var payload: Payload\n  \n  /// The push timeout. Default is 10.0 seconds\n  public var timeout: TimeInterval\n  \n  /// The server's response to the Push\n  var receivedMessage: Message?\n  \n  /// Timer which triggers a timeout event\n  var timeoutTimer: TimerQueue\n  \n  /// WorkItem to be performed when the timeout timer fires\n  var timeoutWorkItem: DispatchWorkItem?\n  \n  /// Hooks into a Push. Where .receive(\"ok\", callback(Payload)) are stored\n  var receiveHooks: [String: [Delegated<Message, Void>]]\n  \n  /// True if the Push has been sent\n  var sent: Bool\n  \n  /// The reference ID of the Push\n  var ref: String?\n  \n  /// The event that is associated with the reference ID of the Push\n  var refEvent: String?\n  \n  \n  \n  /// Initializes a Push\n  ///\n  /// - parameter channel: The Channel\n  /// - parameter event: The event, for example ChannelEvent.join\n  /// - parameter payload: Optional. The Payload to send, e.g. [\"user_id\": \"abc123\"]\n  /// - parameter timeout: Optional. The push timeout. Default is 10.0s\n  init(channel: Channel,\n       event: String,\n       payload: Payload = [:],\n       timeout: TimeInterval = Defaults.timeoutInterval) {\n    self.channel = channel\n    self.event = event\n    self.payload = payload\n    self.timeout = timeout\n    self.receivedMessage = nil\n    self.timeoutTimer = TimerQueue.main\n    self.receiveHooks = [:]\n    self.sent = false\n    self.ref = nil\n  }\n  \n  \n  \n  /// Resets and sends the Push\n  /// - parameter timeout: Optional. The push timeout. Default is 10.0s\n  public func resend(_ timeout: TimeInterval = Defaults.timeoutInterval) {\n    self.timeout = timeout\n    self.reset()\n    self.send()\n  }\n  \n  /// Sends the Push. If it has already timed out, then the call will\n  /// be ignored and return early. Use `resend` in this case.\n  public func send() {\n    guard !hasReceived(status: \"timeout\") else { return }\n    \n    self.startTimeout()\n    self.sent = true\n    self.channel?.socket?.push(\n      topic: channel?.topic ?? \"\",\n      event: self.event,\n      payload: self.payload,\n      ref: self.ref,\n      joinRef: channel?.joinRef\n    )\n  }\n  \n  /// Receive a specific event when sending an Outbound message. Subscribing\n  /// to status events with this method does not guarantees no retain cycles.\n  /// You should pass `weak self` in the capture list of the callback. You\n  /// can call `.delegateReceive(status:, to:, callback:) and the library will\n  /// handle it for you.\n  ///\n  /// Example:\n  ///\n  ///     channel\n  ///         .send(event:\"custom\", payload: [\"body\": \"example\"])\n  ///         .receive(\"error\") { [weak self] payload in\n  ///             print(\"Error: \", payload)\n  ///         }\n  ///\n  /// - parameter status: Status to receive\n  /// - parameter callback: Callback to fire when the status is recevied\n  @discardableResult\n  public func receive(_ status: String,\n                      callback: @escaping ((Message) -> ())) -> Push {\n    var delegated = Delegated<Message, Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.receive(status, delegated: delegated)\n  }\n  \n  /// Receive a specific event when sending an Outbound message. Automatically\n  /// prevents retain cycles. See `manualReceive(status:, callback:)` if you\n  /// want to handle this yourself.\n  ///\n  /// Example:\n  ///\n  ///     channel\n  ///         .send(event:\"custom\", payload: [\"body\": \"example\"])\n  ///         .delegateReceive(\"error\", to: self) { payload in\n  ///             print(\"Error: \", payload)\n  ///         }\n  ///\n  /// - parameter status: Status to receive\n  /// - parameter owner: The class that is calling .receive. Usually `self`\n  /// - parameter callback: Callback to fire when the status is recevied\n  @discardableResult\n  public func delegateReceive<Target: AnyObject>(_ status: String,\n                                                 to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> ())) -> Push {\n    var delegated = Delegated<Message, Void>()\n    delegated.delegate(to: owner, with: callback)\n    \n    return self.receive(status, delegated: delegated)\n  }\n  \n  /// Shared behavior between `receive` calls\n  @discardableResult\n  internal func receive(_ status: String, delegated: Delegated<Message, Void>) -> Push {\n    // If the message has already been received, pass it to the callback immediately\n    if hasReceived(status: status), let receivedMessage = self.receivedMessage {\n      delegated.call(receivedMessage)\n    }\n    \n    if receiveHooks[status] == nil {\n      /// Create a new array of hooks if no previous hook is associated with status\n      receiveHooks[status] = [delegated]\n    } else {\n      /// A previous hook for this status already exists. Just append the new hook\n      receiveHooks[status]?.append(delegated)\n    }\n    \n    return self\n  }\n  \n  \n  \n  /// Resets the Push as it was after it was first tnitialized.\n  internal func reset() {\n    self.cancelRefEvent()\n    self.ref = nil\n    self.refEvent = nil\n    self.receivedMessage = nil\n    self.sent = false\n  }\n  \n  \n  /// Finds the receiveHook which needs to be informed of a status response\n  ///\n  /// - parameter status: Status which was received, e.g. \"ok\", \"error\", \"timeout\"\n  /// - parameter response: Response that was received\n  private func matchReceive(_ status: String, message: Message) {\n    receiveHooks[status]?.forEach( { $0.call(message) } )\n  }\n  \n  /// Reverses the result on channel.on(ChannelEvent, callback) that spawned the Push\n  private func cancelRefEvent() {\n    guard let refEvent = self.refEvent else { return }\n    self.channel?.off(refEvent)\n  }\n  \n  /// Cancel any ongoing Timeout Timer\n  internal func cancelTimeout() {\n    self.timeoutWorkItem?.cancel()\n    self.timeoutWorkItem = nil\n  }\n  \n  /// Starts the Timer which will trigger a timeout after a specific _timeout_\n  /// time, in milliseconds, is reached.\n  internal func startTimeout() {\n    // Cancel any existing timeout before starting a new one\n    if let safeWorkItem = timeoutWorkItem, !safeWorkItem.isCancelled {\n      self.cancelTimeout()\n    }\n    \n    guard\n      let channel = channel,\n      let socket = channel.socket else { return }\n    \n    let ref = socket.makeRef()\n    let refEvent = channel.replyEventName(ref)\n    \n    self.ref = ref\n    self.refEvent = refEvent\n    \n    /// If a response is received  before the Timer triggers, cancel timer\n    /// and match the recevied event to it's corresponding hook\n    channel.delegateOn(refEvent, to: self) { (self, message) in\n      self.cancelRefEvent()\n      self.cancelTimeout()\n      self.receivedMessage = message\n      \n      /// Check if there is event a status available\n      guard let status = message.status else { return }\n      self.matchReceive(status, message: message)\n    }\n    \n    /// Setup and start the Timeout timer.\n    let workItem = DispatchWorkItem {\n      self.trigger(\"timeout\", payload: [:])\n    }\n    \n    self.timeoutWorkItem = workItem\n    self.timeoutTimer.queue(timeInterval: timeout, execute: workItem)\n  }\n  \n  /// Checks if a status has already been received by the Push.\n  ///\n  /// - parameter status: Status to check\n  /// - return: True if given status has been received by the Push.\n  internal func hasReceived(status: String) -> Bool {\n    return self.receivedMessage?.status == status\n  }\n  \n  /// Triggers an event to be sent though the Channel\n  internal func trigger(_ status: String, payload: Payload) {\n    /// If there is no ref event, then there is nothing to trigger on the channel\n    guard let refEvent = self.refEvent else { return }\n    \n    var mutPayload = payload\n    mutPayload[\"status\"] = status\n    \n    self.channel?.trigger(event: refEvent, payload: mutPayload)\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/Socket.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\nimport Foundation\n\npublic enum SocketError: Error {\n  \n  case abnormalClosureError\n  \n}\n\n\n/// Alias for a JSON dictionary [String: Any]\npublic typealias Payload = [String: Any]\n\n/// Alias for a function returning an optional JSON dictionary (`Payload?`)\npublic typealias PayloadClosure = () -> Payload?\n\n/// Struct that gathers callbacks assigned to the Socket\nstruct StateChangeCallbacks {\n    let open: SynchronizedArray<(ref: String, callback: Delegated<URLResponse?, Void>)> = .init()\n    let close: SynchronizedArray<(ref: String, callback: Delegated<(Int, String?), Void>)> = .init()\n    let error: SynchronizedArray<(ref: String, callback: Delegated<(Error, URLResponse?), Void>)> = .init()\n    let message: SynchronizedArray<(ref: String, callback: Delegated<Message, Void>)> = .init()\n}\n\n\n/// ## Socket Connection\n/// A single connection is established to the server and\n/// channels are multiplexed over the connection.\n/// Connect to the server using the `Socket` class:\n///\n/// ```swift\n/// let socket = new Socket(\"/socket\", paramsClosure: { [\"userToken\": \"123\" ] })\n/// socket.connect()\n/// ```\n///\n/// The `Socket` constructor takes the mount point of the socket,\n/// the authentication params, as well as options that can be found in\n/// the Socket docs, such as configuring the heartbeat.\npublic class Socket: PhoenixTransportDelegate {\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Public Attributes\n  //----------------------------------------------------------------------\n  /// The string WebSocket endpoint (ie `\"ws://example.com/socket\"`,\n  /// `\"wss://example.com\"`, etc.) That was passed to the Socket during\n  /// initialization. The URL endpoint will be modified by the Socket to\n  /// include `\"/websocket\"` if missing.\n  public let endPoint: String\n\n  /// The fully qualified socket URL\n  public private(set) var endPointUrl: URL\n  \n  /// Resolves to return the `paramsClosure` result at the time of calling.\n  /// If the `Socket` was created with static params, then those will be\n  /// returned every time.\n  public var params: Payload? {\n    return self.paramsClosure?()\n  }\n  \n  /// The optional params closure used to get params when connecting. Must\n  /// be set when initializing the Socket.\n  public let paramsClosure: PayloadClosure?\n  \n  /// The WebSocket transport. Default behavior is to provide a\n  /// URLSessionWebsocketTask. See README for alternatives.\n  private let transport: ((URL) -> PhoenixTransport)\n\n  /// Phoenix serializer version, defaults to \"2.0.0\"\n  public let vsn: String\n  \n  /// Override to provide custom encoding of data before writing to the socket\n  public var encode: (Any) -> Data = Defaults.encode\n  \n  /// Override to provide custom decoding of data read from the socket\n  public var decode: (Data) -> Any? = Defaults.decode\n  \n  /// Timeout to use when opening connections\n  public var timeout: TimeInterval = Defaults.timeoutInterval\n    \n  /// Custom headers to be added to the socket connection request\n  public var headers: [String : Any] = [:]\n  \n  /// Interval between sending a heartbeat\n  public var heartbeatInterval: TimeInterval = Defaults.heartbeatInterval\n\n  /// The maximum amount of time which the system may delay heartbeats in order to optimize power usage\n  public var heartbeatLeeway: DispatchTimeInterval = Defaults.heartbeatLeeway\n  \n  /// Interval between socket reconnect attempts, in seconds\n  public var reconnectAfter: (Int) -> TimeInterval = Defaults.reconnectSteppedBackOff\n  \n  /// Interval between channel rejoin attempts, in seconds\n  public var rejoinAfter: (Int) -> TimeInterval = Defaults.rejoinSteppedBackOff\n  \n  /// The optional function to receive logs\n  public var logger: ((String) -> Void)?\n  \n  /// Disables heartbeats from being sent. Default is false.\n  public var skipHeartbeat: Bool = false\n  \n  /// Enable/Disable SSL certificate validation. Default is false. This\n  /// must be set before calling `socket.connect()` in order to be applied\n  public var disableSSLCertValidation: Bool = false\n  \n  #if os(Linux)\n  #else\n  /// Configure custom SSL validation logic, eg. SSL pinning. This\n  /// must be set before calling `socket.connect()` in order to apply.\n//  public var security: SSLTrustValidator?\n  \n  /// Configure the encryption used by your client by setting the\n  /// allowed cipher suites supported by your server. This must be\n  /// set before calling `socket.connect()` in order to apply.\n  public var enabledSSLCipherSuites: [SSLCipherSuite]?\n  #endif\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Private Attributes\n  //----------------------------------------------------------------------\n  /// Callbacks for socket state changes\n  let stateChangeCallbacks: StateChangeCallbacks = StateChangeCallbacks()\n  \n  /// Collection on channels created for the Socket\n  public var channels: [Channel] { _channels.copy() }\n  private var _channels = SynchronizedArray<Channel>()\n  \n  /// Buffers messages that need to be sent once the socket has connected. It is an array\n  /// of tuples, with the ref of the message to send and the callback that will send the message.\n  let sendBuffer = SynchronizedArray<(ref: String?, callback: () throws -> ())>()\n  \n  /// Ref counter for messages\n  var ref: UInt64 = UInt64.min // 0 (max: 18,446,744,073,709,551,615)\n    \n  /// Timer that triggers sending new Heartbeat messages\n  var heartbeatTimer: HeartbeatTimer?\n  \n  /// Ref counter for the last heartbeat that was sent\n  var pendingHeartbeatRef: String?\n  \n  /// Timer to use when attempting to reconnect\n  var reconnectTimer: TimeoutTimer\n\n  /// Close status\n  var closeStatus: CloseStatus = .unknown\n  \n  /// The connection to the server\n  var connection: PhoenixTransport? = nil\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Initialization\n  //----------------------------------------------------------------------\n  @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)\n  public convenience init(_ endPoint: String,\n                          params: Payload? = nil,\n                          vsn: String = Defaults.vsn) {\n    self.init(endPoint: endPoint,\n              transport: { url in return URLSessionTransport(url: url) },\n              paramsClosure: { params },\n              vsn: vsn)\n  }\n\n  @available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)\n  public convenience init(_ endPoint: String,\n                          paramsClosure: PayloadClosure?,\n                          vsn: String = Defaults.vsn) {\n    self.init(endPoint: endPoint,\n              transport: { url in return URLSessionTransport(url: url) },\n              paramsClosure: paramsClosure,\n              vsn: vsn)\n  }\n  \n  \n  public init(endPoint: String,\n       transport: @escaping ((URL) -> PhoenixTransport),\n       paramsClosure: PayloadClosure? = nil,\n       vsn: String = Defaults.vsn) {\n    self.transport = transport\n    self.paramsClosure = paramsClosure\n    self.endPoint = endPoint\n    self.vsn = vsn\n    self.endPointUrl = Socket.buildEndpointUrl(endpoint: endPoint,\n                                               paramsClosure: paramsClosure,\n                                               vsn: vsn)\n\n    self.reconnectTimer = TimeoutTimer()\n    self.reconnectTimer.callback.delegate(to: self) { (self) in\n      self.logItems(\"Socket attempting to reconnect\")\n      self.teardown(reason: \"reconnection\") { self.connect() }\n    }\n    self.reconnectTimer.timerCalculation\n      .delegate(to: self) { (self, tries) -> TimeInterval in\n        let interval = self.reconnectAfter(tries)\n        self.logItems(\"Socket reconnecting in \\(interval)s\")\n        return interval\n    }\n  }\n  \n  deinit {\n    reconnectTimer.reset()\n  }\n  \n  //----------------------------------------------------------------------\n  // MARK: - Public\n  //----------------------------------------------------------------------\n  /// - return: The socket protocol, wss or ws\n  public var websocketProtocol: String {\n    switch endPointUrl.scheme {\n    case \"https\": return \"wss\"\n    case \"http\": return \"ws\"\n    default: return endPointUrl.scheme ?? \"\"\n    }\n  }\n  \n  /// - return: True if the socket is connected\n  public var isConnected: Bool {\n    return self.connectionState == .open\n  }\n    \n  public var isConnecting: Bool {\n    return self.connectionState == .connecting\n  }\n  \n  /// - return: The state of the connect. [.connecting, .open, .closing, .closed]\n  public var connectionState: PhoenixTransportReadyState {\n    return self.connection?.readyState ?? .closed\n  }\n  \n  /// Connects the Socket. The params passed to the Socket on initialization\n  /// will be sent through the connection. If the Socket is already connected,\n  /// then this call will be ignored.\n  public func connect() {\n    // Do not attempt to reconnect if the socket is currently connected or in the process of connecting\n    guard !isConnected && !isConnecting else { return }\n    \n    // Reset the close status when attempting to connect\n    self.closeStatus = .unknown\n\n    // We need to build this right before attempting to connect as the\n    // parameters could be built upon demand and change over time\n    self.endPointUrl = Socket.buildEndpointUrl(endpoint: self.endPoint,\n                                               paramsClosure: self.paramsClosure,\n                                               vsn: vsn)\n\n    self.connection = self.transport(self.endPointUrl)\n    self.connection?.delegate = self\n//    self.connection?.disableSSLCertValidation = disableSSLCertValidation\n//\n//    #if os(Linux)\n//    #else\n//    self.connection?.security = security\n//    self.connection?.enabledSSLCipherSuites = enabledSSLCipherSuites\n//    #endif\n    \n    self.connection?.connect(with: self.headers)\n  }\n  \n  /// Disconnects the socket\n  ///\n  /// - parameter code: Optional. Closing status code\n  /// - parameter callback: Optional. Called when disconnected\n  public func disconnect(code: CloseCode = CloseCode.normal,\n                         reason: String? = nil,\n                         callback: (() -> Void)? = nil) {\n    // The socket was closed cleanly by the User\n    self.closeStatus = CloseStatus(closeCode: code.rawValue)\n    \n    // Reset any reconnects and teardown the socket connection\n    self.reconnectTimer.reset()\n    self.teardown(code: code, reason: reason, callback: callback)\n  }\n  \n  internal func teardown(code: CloseCode = CloseCode.normal, reason: String? = nil, callback: (() -> Void)? = nil) {\n    self.connection?.delegate = nil\n    self.connection?.disconnect(code: code.rawValue, reason: reason)\n    self.connection = nil\n    \n    // The socket connection has been torndown, heartbeats are not needed\n    self.heartbeatTimer?.stop()\n    \n    // Since the connection's delegate was nil'd out, inform all state\n    // callbacks that the connection has closed\n    self.stateChangeCallbacks.close.forEach({ $0.callback.call((code.rawValue, reason)) })\n    callback?()\n  }\n  \n\n  \n  //----------------------------------------------------------------------\n  // MARK: - Register Socket State Callbacks\n  //----------------------------------------------------------------------\n  \n  /// Registers callbacks for connection open events. Does not handle retain\n  /// cycles. Use `delegateOnOpen(to:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onOpen() { [weak self] in\n  ///         self?.print(\"Socket Connection Open\")\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket is opened\n  @discardableResult\n  public func onOpen(callback: @escaping () -> Void) -> String {\n    return self.onOpen { _ in callback() }\n  }\n  \n  /// Registers callbacks for connection open events. Does not handle retain\n  /// cycles. Use `delegateOnOpen(to:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onOpen() { [weak self] response in\n  ///         self?.print(\"Socket Connection Open\")\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket is opened\n  @discardableResult\n  public func onOpen(callback: @escaping (URLResponse?) -> Void) -> String {\n    var delegated = Delegated<URLResponse?, Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.open)\n  }\n  \n  /// Registers callbacks for connection open events. Automatically handles\n  /// retain cycles. Use `onOpen()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnOpen(to: self) { self in\n  ///         self.print(\"Socket Connection Open\")\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket is opened\n  @discardableResult\n  public func delegateOnOpen<T: AnyObject>(to owner: T,\n                                           callback: @escaping ((T) -> Void)) -> String {\n    return self.delegateOnOpen(to: owner) { owner, _ in callback(owner) }\n  }\n\n  /// Registers callbacks for connection open events. Automatically handles\n  /// retain cycles. Use `onOpen()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnOpen(to: self) { self, response in\n  ///         self.print(\"Socket Connection Open\")\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket is opened\n  @discardableResult\n  public func delegateOnOpen<T: AnyObject>(to owner: T,\n                                           callback: @escaping ((T, URLResponse?) -> Void)) -> String {\n    var delegated = Delegated<URLResponse?, Void>()\n    delegated.delegate(to: owner, with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.open)\n  }\n  \n  /// Registers callbacks for connection close events. Does not handle retain\n  /// cycles. Use `delegateOnClose(_:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onClose() { [weak self] in\n  ///         self?.print(\"Socket Connection Close\")\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket is closed\n  @discardableResult\n  public func onClose(callback: @escaping () -> Void) -> String {\n    return self.onClose { _, _ in callback() }\n  }\n\n  /// Registers callbacks for connection close events. Does not handle retain\n  /// cycles. Use `delegateOnClose(_:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onClose() { [weak self] code, reason in\n  ///         self?.print(\"Socket Connection Close\")\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket is closed\n  @discardableResult\n  public func onClose(callback: @escaping (Int, String?) -> Void) -> String {\n    var delegated = Delegated<(Int, String?), Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.close)\n  }\n  \n  /// Registers callbacks for connection close events. Automatically handles\n  /// retain cycles. Use `onClose()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnClose(self) { self in\n  ///         self.print(\"Socket Connection Close\")\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket is closed\n  @discardableResult\n  public func delegateOnClose<T: AnyObject>(to owner: T,\n                                            callback: @escaping ((T) -> Void)) -> String {\n    return self.delegateOnClose(to: owner) { owner, _ in callback(owner) }\n  }\n\n  /// Registers callbacks for connection close events. Automatically handles\n  /// retain cycles. Use `onClose()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnClose(self) { self, code, reason in\n  ///         self.print(\"Socket Connection Close\")\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket is closed\n  @discardableResult\n  public func delegateOnClose<T: AnyObject>(to owner: T,\n                                            callback: @escaping ((T, (Int, String?)) -> Void)) -> String {\n    var delegated = Delegated<(Int, String?), Void>()\n    delegated.delegate(to: owner, with: callback)\n   \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.close)\n  }\n  \n  /// Registers callbacks for connection error events. Does not handle retain\n  /// cycles. Use `delegateOnError(to:)` for automatic handling of retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onError() { [weak self] (error) in\n  ///         self?.print(\"Socket Connection Error\", error)\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket errors\n  @discardableResult\n  public func onError(callback: @escaping ((Error, URLResponse?)) -> Void) -> String {\n    var delegated = Delegated<(Error, URLResponse?), Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.error)\n  }\n  \n  /// Registers callbacks for connection error events. Automatically handles\n  /// retain cycles. Use `manualOnError()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnError(to: self) { (self, error) in\n  ///         self.print(\"Socket Connection Error\", error)\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket errors\n  @discardableResult\n  public func delegateOnError<T: AnyObject>(to owner: T,\n                                            callback: @escaping ((T, (Error, URLResponse?)) -> Void)) -> String {\n    var delegated = Delegated<(Error, URLResponse?), Void>()\n    delegated.delegate(to: owner, with: callback)\n\n    return self.append(callback: delegated, to: self.stateChangeCallbacks.error)\n  }\n  \n  /// Registers callbacks for connection message events. Does not handle\n  /// retain cycles. Use `delegateOnMessage(_to:)` for automatic handling of\n  /// retain cycles.\n  ///\n  /// Example:\n  ///\n  ///     socket.onMessage() { [weak self] (message) in\n  ///         self?.print(\"Socket Connection Message\", message)\n  ///     }\n  ///\n  /// - parameter callback: Called when the Socket receives a message event\n  @discardableResult\n  public func onMessage(callback: @escaping (Message) -> Void) -> String {\n    var delegated = Delegated<Message, Void>()\n    delegated.manuallyDelegate(with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.message)\n  }\n  \n  /// Registers callbacks for connection message events. Automatically handles\n  /// retain cycles. Use `onMessage()` to handle yourself.\n  ///\n  /// Example:\n  ///\n  ///     socket.delegateOnMessage(self) { (self, message) in\n  ///         self.print(\"Socket Connection Message\", message)\n  ///     }\n  ///\n  /// - parameter owner: Class registering the callback. Usually `self`\n  /// - parameter callback: Called when the Socket receives a message event\n  @discardableResult\n  public func delegateOnMessage<T: AnyObject>(to owner: T,\n                                              callback: @escaping ((T, Message) -> Void)) -> String {\n    var delegated = Delegated<Message, Void>()\n    delegated.delegate(to: owner, with: callback)\n    \n    return self.append(callback: delegated, to: self.stateChangeCallbacks.message)\n  }\n  \n  private func append<T>(callback: T, to array: SynchronizedArray<(ref: String, callback: T)>) -> String {\n    let ref = makeRef()\n    array.append((ref, callback))\n    return ref\n  }\n  \n  /// Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should\n  /// call this method when you are finished when the Socket in order to release\n  /// any references held by the socket.\n  public func releaseCallbacks() {\n    self.stateChangeCallbacks.open.removeAll()\n    self.stateChangeCallbacks.close.removeAll()\n    self.stateChangeCallbacks.error.removeAll()\n    self.stateChangeCallbacks.message.removeAll()\n  }\n  \n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Channel Initialization\n  //----------------------------------------------------------------------\n  /// Initialize a new Channel\n  ///\n  /// Example:\n  ///\n  ///     let channel = socket.channel(\"rooms\", params: [\"user_id\": \"abc123\"])\n  ///\n  /// - parameter topic: Topic of the channel\n  /// - parameter params: Optional. Parameters for the channel\n  /// - return: A new channel\n  public func channel(_ topic: String,\n                      params: [String: Any] = [:]) -> Channel {\n    let channel = Channel(topic: topic, params: params, socket: self)\n    _channels.append(channel)\n    \n    return channel\n  }\n  \n  /// Removes the Channel from the socket. This does not cause the channel to\n  /// inform the server that it is leaving. You should call channel.leave()\n  /// prior to removing the Channel.\n  ///\n  /// Example:\n  ///\n  ///     channel.leave()\n  ///     socket.remove(channel)\n  ///\n  /// - parameter channel: Channel to remove\n  public func remove(_ channel: Channel) {\n    self.off(channel.stateChangeRefs)\n    _channels.removeAll(where: { $0.joinRef == channel.joinRef })\n  }\n  \n  /// Removes `onOpen`, `onClose`, `onError,` and `onMessage` registrations.\n  ///\n  ///\n  /// - Parameter refs: List of refs returned by calls to `onOpen`, `onClose`, etc\n  public func off(_ refs: [String]) {\n    self.stateChangeCallbacks.open.removeAll { refs.contains($0.ref) }\n    self.stateChangeCallbacks.close.removeAll { refs.contains($0.ref) }\n    self.stateChangeCallbacks.error.removeAll { refs.contains($0.ref) }\n    self.stateChangeCallbacks.message.removeAll { refs.contains($0.ref) }\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - Sending Data\n  //----------------------------------------------------------------------\n  /// Sends data through the Socket. This method is internal. Instead, you\n  /// should call `push(_:, payload:, timeout:)` on the Channel you are\n  /// sending an event to.\n  ///\n  /// - parameter topic:\n  /// - parameter event:\n  /// - parameter payload:\n  /// - parameter ref: Optional. Defaults to nil\n  /// - parameter joinRef: Optional. Defaults to nil\n  internal func push(topic: String,\n                     event: String,\n                     payload: Payload,\n                     ref: String? = nil,\n                     joinRef: String? = nil) {\n    \n    let callback: (() throws -> ()) = { [weak self] in\n      guard let self else { return }\n      let body: [Any?] = [joinRef, ref, topic, event, payload]\n      let data = self.encode(body)\n      \n      self.logItems(\"push\", \"Sending \\(String(data: data, encoding: String.Encoding.utf8) ?? \"\")\" )\n      self.connection?.send(data: data)\n    }\n    \n    /// If the socket is connected, then execute the callback immediately.\n    if isConnected {\n      try? callback()\n    } else {\n      /// If the socket is not connected, add the push to a buffer which will\n      /// be sent immediately upon connection.\n      self.sendBuffer.append((ref: ref, callback: callback))\n    }\n  }\n  \n  /// - return: the next message ref, accounting for overflows\n  public func makeRef() -> String {\n    self.ref = (ref == UInt64.max) ? 0 : self.ref + 1\n    return String(ref)\n  }\n  \n  /// Logs the message. Override Socket.logger for specialized logging. noops by default\n  ///\n  /// - parameter items: List of items to be logged. Behaves just like debugPrint()\n  func logItems(_ items: Any...) {\n    let msg = items.map( { return String(describing: $0) } ).joined(separator: \", \")\n    self.logger?(\"SwiftPhoenixClient: \\(msg)\")\n  }\n  \n  //----------------------------------------------------------------------\n  // MARK: - Connection Events\n  //----------------------------------------------------------------------\n  /// Called when the underlying Websocket connects to it's host\n  internal func onConnectionOpen(response: URLResponse?) {\n    self.logItems(\"transport\", \"Connected to \\(endPoint)\")\n    \n    // Reset the close status now that the socket has been connected\n    self.closeStatus = .unknown\n\n    // Send any messages that were waiting for a connection\n    self.flushSendBuffer()\n    \n    // Reset how the socket tried to reconnect\n    self.reconnectTimer.reset()\n    \n    // Restart the heartbeat timer\n    self.resetHeartbeat()\n    \n    // Inform all onOpen callbacks that the Socket has opened\n    self.stateChangeCallbacks.open.forEach({ $0.callback.call((response)) })\n  }\n  \n  internal func onConnectionClosed(code: Int, reason: String?) {\n    self.logItems(\"transport\", \"close\")\n\n    // Send an error to all channels\n    self.triggerChannelError()\n    \n    // Prevent the heartbeat from triggering if the\n    self.heartbeatTimer?.stop()\n    \n    // Only attempt to reconnect if the socket did not close normally,\n    // or if it was closed abnormally but on client side (e.g. due to heartbeat timeout)\n    if (self.closeStatus.shouldReconnect) {\n      self.reconnectTimer.scheduleTimeout()\n    }\n    \n    self.stateChangeCallbacks.close.forEach({ $0.callback.call((code, reason)) })\n  }\n  \n  internal func onConnectionError(_ error: Error, response: URLResponse?) {\n    self.logItems(\"transport\", error, response ?? \"\")\n    \n    // Send an error to all channels\n    self.triggerChannelError()\n    \n    // Inform any state callbacks of the error\n    self.stateChangeCallbacks.error.forEach({ $0.callback.call((error, response)) })\n  }\n  \n  internal func onConnectionMessage(_ rawMessage: String) {\n    self.logItems(\"receive \", rawMessage)\n    \n    guard\n      let data = rawMessage.data(using: String.Encoding.utf8),\n      let json = decode(data) as? [Any?],\n      let message = Message(json: json)\n      else {\n        self.logItems(\"receive: Unable to parse JSON: \\(rawMessage)\")\n        return }\n    \n    // Clear heartbeat ref, preventing a heartbeat timeout disconnect\n    if message.ref == pendingHeartbeatRef { pendingHeartbeatRef = nil }\n    \n    if message.event == \"phx_close\" {\n      print(\"Close Event Received\")\n    }\n    \n    // Dispatch the message to all channels that belong to the topic\n    _channels.forEach { channel in\n      if channel.isMember(message) {\n        channel.trigger(message)\n      }\n    }\n\n    // Inform all onMessage callbacks of the message\n    self.stateChangeCallbacks.message.forEach({ $0.callback.call(message) })\n  }\n  \n  /// Triggers an error event to all of the connected Channels\n  internal func triggerChannelError() {\n    _channels.forEach { channel in\n      // Only trigger a channel error if it is in an \"opened\" state\n      if !(channel.isErrored || channel.isLeaving || channel.isClosed) {\n        channel.trigger(event: ChannelEvent.error)\n      }\n    }\n  }\n  \n  /// Send all messages that were buffered before the socket opened\n  internal func flushSendBuffer() {\n    guard isConnected else { return }\n    self.sendBuffer.forEach( { try? $0.callback() } )\n    self.sendBuffer.removeAll()\n  }\n  \n  /// Removes an item from the sendBuffer with the matching ref\n  internal func removeFromSendBuffer(ref: String) {\n    self.sendBuffer.removeAll { $0.ref == ref }\n  }\n\n  /// Builds a fully qualified socket `URL` from `endPoint` and `params`.\n  internal static func buildEndpointUrl(endpoint: String, paramsClosure params: PayloadClosure?, vsn: String) -> URL {\n    guard\n      let url = URL(string: endpoint),\n      var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false)\n      else { fatalError(\"Malformed URL: \\(endpoint)\") }\n\n    // Ensure that the URL ends with \"/websocket\n    if !urlComponents.path.contains(\"/websocket\") {\n      // Do not duplicate '/' in the path\n      if urlComponents.path.last != \"/\" {\n        urlComponents.path.append(\"/\")\n      }\n\n      // append 'websocket' to the path\n      urlComponents.path.append(\"websocket\")\n\n    }\n\n    urlComponents.queryItems = [URLQueryItem(name: \"vsn\", value: vsn)]\n\n    // If there are parameters, append them to the URL\n    if let params = params?() {\n      urlComponents.queryItems?.append(contentsOf: params.map {\n        URLQueryItem(name: $0.key, value: String(describing: $0.value))\n      })\n    }\n\n    guard let qualifiedUrl = urlComponents.url\n      else { fatalError(\"Malformed URL while adding parameters\") }\n    return qualifiedUrl\n  }\n  \n  \n  // Leaves any channel that is open that has a duplicate topic\n  internal func leaveOpenTopic(topic: String) {\n    guard\n      let dupe = _channels.first(where: { $0.topic == topic && ($0.isJoined || $0.isJoining) })\n    else { return }\n    \n    self.logItems(\"transport\", \"leaving duplicate topic: [\\(topic)]\" )\n    dupe.leave()\n  }\n  \n  //----------------------------------------------------------------------\n  // MARK: - Heartbeat\n  //----------------------------------------------------------------------\n  internal func resetHeartbeat() {\n    // Clear anything related to the heartbeat\n    self.pendingHeartbeatRef = nil\n    self.heartbeatTimer?.stop()\n\n    // Do not start up the heartbeat timer if skipHeartbeat is true\n    guard !skipHeartbeat else { return }\n\n    self.heartbeatTimer = HeartbeatTimer(timeInterval: heartbeatInterval, leeway: heartbeatLeeway)\n    self.heartbeatTimer?.start(eventHandler: { [weak self] in\n      self?.sendHeartbeat()\n    })\n  }\n  \n  /// Sends a heartbeat payload to the phoenix servers\n  @objc func sendHeartbeat() {\n    // Do not send if the connection is closed\n    guard isConnected else { return }\n\n    \n    // If there is a pending heartbeat ref, then the last heartbeat was\n    // never acknowledged by the server. Close the connection and attempt\n    // to reconnect.\n    if let _ = self.pendingHeartbeatRef {\n      self.pendingHeartbeatRef = nil\n      self.logItems(\"transport\",\n                    \"heartbeat timeout. Attempting to re-establish connection\")\n      \n      // Close the socket manually, flagging the closure as abnormal. Do not use\n      // `teardown` or `disconnect` as they will nil out the websocket delegate.\n      self.abnormalClose(\"heartbeat timeout\")\n      \n      return\n    }\n    \n    // The last heartbeat was acknowledged by the server. Send another one\n    self.pendingHeartbeatRef = self.makeRef()\n    self.push(topic: \"phoenix\",\n              event: ChannelEvent.heartbeat,\n              payload: [:],\n              ref: self.pendingHeartbeatRef)\n  }\n  \n  internal func abnormalClose(_ reason: String) {\n    self.closeStatus = .abnormal\n    \n    /*\n     We use NORMAL here since the client is the one determining to close the\n     connection. However, we set to close status to abnormal so that\n     the client knows that it should attempt to reconnect.\n\n     If the server subsequently acknowledges with code 1000 (normal close),\n     the socket will keep the `.abnormal` close status and trigger a reconnection.\n     */\n    self.connection?.disconnect(code: CloseCode.normal.rawValue, reason: reason)\n  }\n  \n  \n  //----------------------------------------------------------------------\n  // MARK: - TransportDelegate\n  //----------------------------------------------------------------------\n  public func onOpen(response: URLResponse?) {\n    self.onConnectionOpen(response: response)\n  }\n  \n  public func onError(error: Error, response: URLResponse?) {\n    self.onConnectionError(error, response: response)\n  }\n  \n  public func onMessage(message: String) {\n    self.onConnectionMessage(message)\n  }\n  \n  public func onClose(code: Int, reason: String? = nil) {\n    self.closeStatus.update(transportCloseCode: code)\n    self.onConnectionClosed(code: code, reason: reason)\n  }\n}\n\n\n//----------------------------------------------------------------------\n// MARK: - Close Codes\n//----------------------------------------------------------------------\nextension Socket {\n  public enum CloseCode : Int {\n    case abnormal = 999\n    \n    case normal = 1000\n\n    case goingAway = 1001\n  }\n}\n\n\n//----------------------------------------------------------------------\n// MARK: - Close Status\n//----------------------------------------------------------------------\nextension Socket {\n  /// Indicates the different closure states a socket can be in.\n  enum CloseStatus {\n    /// Undetermined closure state\n    case unknown\n    /// A clean closure requested either by the client or the server\n    case clean\n    /// An abnormal closure requested by the client\n    case abnormal\n    \n    /// Temporarily close the socket, pausing reconnect attempts. Useful on mobile\n    /// clients when disconnecting a because the app resigned active but should\n    /// reconnect when app enters active state.\n    case temporary\n    \n    init(closeCode: Int) {\n      switch closeCode {\n      case CloseCode.abnormal.rawValue:\n        self = .abnormal\n      case CloseCode.goingAway.rawValue:\n        self = .temporary\n      default:\n        self = .clean\n      }\n    }\n    \n    mutating func update(transportCloseCode: Int) {\n      switch self {\n      case .unknown, .clean, .temporary:\n        // Allow transport layer to override these statuses.\n        self = .init(closeCode: transportCloseCode)\n      case .abnormal:\n        // Do not allow transport layer to override the abnormal close status.\n        // The socket itself should reset it on the next connection attempt.\n        // See `Socket.abnormalClose(_:)` for more information.\n        break\n      }\n    }\n    \n    var shouldReconnect: Bool {\n      switch self {\n      case .unknown, .abnormal:\n        return true\n      case .clean, .temporary:\n        return false\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/SynchronizedArray.swift",
    "content": "//\n//  SynchronizedArray.swift\n//  SwiftPhoenixClient\n//\n//  Created by Daniel Rees on 4/12/23.\n//  Copyright © 2023 SwiftPhoenixClient. All rights reserved.\n//\n\nimport Foundation\n\n/// A thread-safe array.\npublic class SynchronizedArray<Element> {\n    fileprivate let queue = DispatchQueue(label: \"spc_sync_array\", attributes: .concurrent)\n    fileprivate var array: [Element]\n    \n    public init(_ array: [Element] = []) {\n        self.array = array\n    }\n    \n    public func copy() -> [Element] {\n        queue.sync { self.array }\n    }\n    \n    func append( _ newElement: Element) {\n        queue.async(flags: .barrier) {\n            self.array.append(newElement)\n        }\n    }\n    \n    func first(where predicate: (Element) -> Bool) -> Element? {\n        queue.sync { self.array.first(where: predicate) }\n    }\n    \n    func forEach(_ body: (Element) -> Void) {\n        queue.sync { self.array }.forEach(body)\n    }\n    \n    func removeAll() {\n        queue.async(flags: .barrier) {\n            self.array.removeAll()\n        }\n    }\n    \n    func removeAll(where shouldBeRemoved: @escaping (Element) -> Bool) {\n        queue.async(flags: .barrier) {\n            self.array.removeAll(where: shouldBeRemoved)\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/SwiftPhoenixClient/TimeoutTimer.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/// Creates a timer that can perform calculated reties by setting\n/// `timerCalculation` , such as exponential backoff.\n///\n/// ### Example\n///\n///     let reconnectTimer = TimeoutTimer()\n///\n///     // Receive a callbcak when the timer is fired\n///     reconnectTimer.callback.delegate(to: self) { (_) in\n///         print(\"timer was fired\")\n///     }\n///\n///     // Provide timer interval calculation\n///     reconnectTimer.timerCalculation.delegate(to: self) { (_, tries) -> TimeInterval in\n///         return tries > 2 ? 1000 : [1000, 5000, 10000][tries - 1]\n///     }\n///\n///     reconnectTimer.scheduleTimeout() // fires after 1000ms\n///     reconnectTimer.scheduleTimeout() // fires after 5000ms\n///     reconnectTimer.reset()\n///     reconnectTimer.scheduleTimeout() // fires after 1000ms\n\nimport Foundation\n\n// sourcery: AutoMockable\nclass TimeoutTimer {\n  \n  /// Callback to be informed when the underlying Timer fires\n  var callback = Delegated<(), Void>()\n  \n  /// Provides TimeInterval to use when scheduling the timer\n  var timerCalculation = Delegated<Int, TimeInterval>()\n  \n  /// The work to be done when the queue fires\n  var workItem: DispatchWorkItem? = nil\n  \n  /// The number of times the underlyingTimer hass been set off.\n  var tries: Int = 0\n  \n  /// The Queue to execute on. In testing, this is overridden\n  var queue: TimerQueue = TimerQueue.main\n  \n  \n  /// Resets the Timer, clearing the number of tries and stops\n  /// any scheduled timeout.\n  func reset() {\n    self.tries = 0\n    self.clearTimer()\n  }\n  \n  \n  /// Schedules a timeout callback to fire after a calculated timeout duration.\n  func scheduleTimeout() {\n    // Clear any ongoing timer, not resetting the number of tries\n    self.clearTimer()\n    \n    // Get the next calculated interval, in milliseconds. Do not\n    // start the timer if the interval is returned as nil.\n    guard let timeInterval\n      = self.timerCalculation.call(self.tries + 1) else { return }\n    \n    let workItem = DispatchWorkItem {\n      self.tries += 1\n      self.callback.call()\n    }\n    \n    self.workItem = workItem\n    self.queue.queue(timeInterval: timeInterval, execute: workItem)\n  }\n  \n  /// Invalidates any ongoing Timer. Will not clear how many tries have been made\n  private func clearTimer() {\n    self.workItem?.cancel()\n    self.workItem = nil\n  }\n}\n\n\n/// Wrapper class around a DispatchQueue. Allows for providing a fake clock\n/// during tests.\nclass TimerQueue {\n  \n  // Can be overriden in tests\n  static var main = TimerQueue()\n  \n  func queue(timeInterval: TimeInterval, execute: DispatchWorkItem) {\n    // TimeInterval is always in seconds. Multiply it by 1000 to convert\n    // to milliseconds and round to the nearest millisecond.\n    let dispatchInterval = Int(round(timeInterval * 1000))\n    \n    let dispatchTime = DispatchTime.now() + .milliseconds(dispatchInterval)\n    DispatchQueue.main.asyncAfter(deadline: dispatchTime, execute: execute)\n  }\n}\n\n"
  },
  {
    "path": "SwiftPhoenixClient.podspec",
    "content": "#\n# Be sure to run `pod lib lint SwiftPhoenixClient.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any lines starting with a # are optional, but their use is encouraged\n# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html\n#\n\nPod::Spec.new do |s|\n  s.name             = \"SwiftPhoenixClient\"\n  s.version          = \"5.3.5\"\n  s.summary          = \"Connect your Phoenix and iOS applications through WebSockets!\"\n  s.swift_version    = \"5.0\"\n  s.description  = <<-EOS\n  SwiftPhoenixClient is a Swift port of phoenix.js, abstracting away the details\n  of the Phoenix Channels library and providing a near identical experience\n  to connect to your Phoenix WebSockets on iOS.\n\n  RxSwift extensions exist as well when subscribing to channel events.\n\n  A default Transport layer is implmenented for iOS 13 or later. If targeting\n  an earlier iOS version, please see the StarscreamSwiftPhoenixClient extention.\n  EOS\n  s.homepage         = \"https://github.com/davidstump/SwiftPhoenixClient\"\n  s.license          = { :type => \"MIT\", :file => \"LICENSE\" }\n  s.author           = { \"David Stump\" => \"david@davidstump.net\" }\n  s.source           = { :git => \"https://github.com/davidstump/SwiftPhoenixClient.git\", :tag => s.version.to_s }\n  s.ios.deployment_target     = '11.0'\n  s.osx.deployment_target     = '10.13'\n  s.tvos.deployment_target    = '11.0'\n  s.watchos.deployment_target = '4.0'\n\n  s.swift_version = '5.0'\n  s.source_files  = \"Sources/SwiftPhoenixClient/\"\nend\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 52;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t125A9EF82543C84700292017 /* SwiftPhoenixClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1281439225410D52008615A7 /* SwiftPhoenixClient.framework */; };\n\t\t125A9F082543C8D000292017 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 125A9EFF2543C8D000292017 /* Assets.xcassets */; };\n\t\t125A9F092543C8D000292017 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 125A9F002543C8D000292017 /* LaunchScreen.storyboard */; };\n\t\t125A9F0A2543C8D000292017 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 125A9F022543C8D000292017 /* Main.storyboard */; };\n\t\t125A9F0B2543C8D000292017 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125A9F042543C8D000292017 /* AppDelegate.swift */; };\n\t\t125A9F0D2543C8D000292017 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125A9F062543C8D000292017 /* SceneDelegate.swift */; };\n\t\t125A9F0F2543CDDE00292017 /* BasicChatViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 125A9F0E2543CDDE00292017 /* BasicChatViewController.swift */; };\n\t\t1281439C25410D52008615A7 /* SwiftPhoenixClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1281439225410D52008615A7 /* SwiftPhoenixClient.framework */; };\n\t\t128143B225410DF3008615A7 /* SwiftPhoenixClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 128143B025410DF3008615A7 /* SwiftPhoenixClient.h */; settings = {ATTRIBUTES = (Public, ); }; };\n\t\t12922E202543B10B0034B257 /* Socket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12922E1F2543B10B0034B257 /* Socket.swift */; };\n\t\t12922E222543B37B0034B257 /* PhoenixTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12922E212543B37B0034B257 /* PhoenixTransport.swift */; };\n\t\t12991DFB254C3EB800BB8650 /* Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991DFA254C3EB800BB8650 /* Defaults.swift */; };\n\t\t12991DFD254C3ED300BB8650 /* Delegated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991DFC254C3ED300BB8650 /* Delegated.swift */; };\n\t\t12991DFF254C3EF900BB8650 /* HeartbeatTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991DFE254C3EF900BB8650 /* HeartbeatTimer.swift */; };\n\t\t12991E01254C3F1300BB8650 /* TimeoutTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E00254C3F1300BB8650 /* TimeoutTimer.swift */; };\n\t\t12991E03254C3F2300BB8650 /* Push.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E02254C3F2300BB8650 /* Push.swift */; };\n\t\t12991E05254C3F3300BB8650 /* Channel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E04254C3F3300BB8650 /* Channel.swift */; };\n\t\t12991E07254C3F4B00BB8650 /* Message.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E06254C3F4B00BB8650 /* Message.swift */; };\n\t\t12991E09254C3F5B00BB8650 /* Presence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E08254C3F5B00BB8650 /* Presence.swift */; };\n\t\t12991E0F254C454C00BB8650 /* SocketSpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E0E254C454C00BB8650 /* SocketSpy.swift */; };\n\t\t12991E11254C456F00BB8650 /* FakeTimerQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E10254C456F00BB8650 /* FakeTimerQueue.swift */; };\n\t\t12991E13254C458100BB8650 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E12254C458100BB8650 /* TestHelpers.swift */; };\n\t\t12991E15254C45FC00BB8650 /* FakeTimerQueueSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12991E14254C45FC00BB8650 /* FakeTimerQueueSpec.swift */; };\n\t\t12EF620425524B6800A6EE9B /* SocketSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF61FF25524B6800A6EE9B /* SocketSpec.swift */; };\n\t\t12EF620525524B6800A6EE9B /* ChannelSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620025524B6800A6EE9B /* ChannelSpec.swift */; };\n\t\t12EF620625524B6800A6EE9B /* PresenceSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620125524B6800A6EE9B /* PresenceSpec.swift */; };\n\t\t12EF620725524B6800A6EE9B /* TimeoutTimerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620225524B6800A6EE9B /* TimeoutTimerSpec.swift */; };\n\t\t12EF620825524B6800A6EE9B /* DefaultSerializerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620325524B6800A6EE9B /* DefaultSerializerSpec.swift */; };\n\t\t12EF620E25524EEF00A6EE9B /* MockableClass.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620C25524EEF00A6EE9B /* MockableClass.generated.swift */; };\n\t\t12EF620F25524EEF00A6EE9B /* MockableProtocol.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12EF620D25524EEF00A6EE9B /* MockableProtocol.generated.swift */; };\n\t\t635669C4261631DC0068B665 /* URLSessionTransportSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635669C3261631DC0068B665 /* URLSessionTransportSpec.swift */; };\n\t\t63ACBE9426D53DF500171582 /* HeartbeatTimerSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63ACBE9326D53DF500171582 /* HeartbeatTimerSpec.swift */; };\n\t\t63B526DE2656D53700289719 /* Nimble.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B526DC2656D53700289719 /* Nimble.xcframework */; };\n\t\t63B526DF2656D53700289719 /* Quick.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63B526DD2656D53700289719 /* Quick.xcframework */; };\n\t\t63DE6CCA272A2ECB00E2A728 /* MessageSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63DE6CC9272A2ECB00E2A728 /* MessageSpec.swift */; };\n\t\t63F0F58D2592E44800C904FB /* ChatRoomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F0F58C2592E44800C904FB /* ChatRoomViewController.swift */; };\n\t\t63F3765329E7296F00A5AB6E /* SynchronizedArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63F3765229E7296F00A5AB6E /* SynchronizedArray.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t125A9EFA2543C84700292017 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1281438925410D52008615A7 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1281439125410D52008615A7;\n\t\t\tremoteInfo = SwiftPhoenixClient;\n\t\t};\n\t\t1281439D25410D52008615A7 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 1281438925410D52008615A7 /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 1281439125410D52008615A7;\n\t\t\tremoteInfo = SwiftPhoenixClient;\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t63B526B42656D0DE00289719 /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t125A9EE42543C82800292017 /* Basic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Basic.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t125A9EFF2543C8D000292017 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t125A9F012543C8D000292017 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t125A9F032543C8D000292017 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t125A9F042543C8D000292017 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t125A9F052543C8D000292017 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t125A9F062543C8D000292017 /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = \"<group>\"; };\n\t\t125A9F0E2543CDDE00292017 /* BasicChatViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasicChatViewController.swift; sourceTree = \"<group>\"; };\n\t\t1281439225410D52008615A7 /* SwiftPhoenixClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftPhoenixClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t1281439B25410D52008615A7 /* SwiftPhoenixClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftPhoenixClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t128143B025410DF3008615A7 /* SwiftPhoenixClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SwiftPhoenixClient.h; sourceTree = \"<group>\"; };\n\t\t128143B125410DF3008615A7 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t12922E1F2543B10B0034B257 /* Socket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Socket.swift; sourceTree = \"<group>\"; };\n\t\t12922E212543B37B0034B257 /* PhoenixTransport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhoenixTransport.swift; sourceTree = \"<group>\"; };\n\t\t12991DFA254C3EB800BB8650 /* Defaults.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Defaults.swift; sourceTree = \"<group>\"; };\n\t\t12991DFC254C3ED300BB8650 /* Delegated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Delegated.swift; sourceTree = \"<group>\"; };\n\t\t12991DFE254C3EF900BB8650 /* HeartbeatTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartbeatTimer.swift; sourceTree = \"<group>\"; };\n\t\t12991E00254C3F1300BB8650 /* TimeoutTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeoutTimer.swift; sourceTree = \"<group>\"; };\n\t\t12991E02254C3F2300BB8650 /* Push.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Push.swift; sourceTree = \"<group>\"; };\n\t\t12991E04254C3F3300BB8650 /* Channel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Channel.swift; sourceTree = \"<group>\"; };\n\t\t12991E06254C3F4B00BB8650 /* Message.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Message.swift; sourceTree = \"<group>\"; };\n\t\t12991E08254C3F5B00BB8650 /* Presence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Presence.swift; sourceTree = \"<group>\"; };\n\t\t12991E0E254C454C00BB8650 /* SocketSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketSpy.swift; sourceTree = \"<group>\"; };\n\t\t12991E10254C456F00BB8650 /* FakeTimerQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeTimerQueue.swift; sourceTree = \"<group>\"; };\n\t\t12991E12254C458100BB8650 /* TestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestHelpers.swift; sourceTree = \"<group>\"; };\n\t\t12991E14254C45FC00BB8650 /* FakeTimerQueueSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeTimerQueueSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF61FF25524B6800A6EE9B /* SocketSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SocketSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF620025524B6800A6EE9B /* ChannelSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChannelSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF620125524B6800A6EE9B /* PresenceSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PresenceSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF620225524B6800A6EE9B /* TimeoutTimerSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeoutTimerSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF620325524B6800A6EE9B /* DefaultSerializerSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultSerializerSpec.swift; sourceTree = \"<group>\"; };\n\t\t12EF620C25524EEF00A6EE9B /* MockableClass.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockableClass.generated.swift; sourceTree = \"<group>\"; };\n\t\t12EF620D25524EEF00A6EE9B /* MockableProtocol.generated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockableProtocol.generated.swift; sourceTree = \"<group>\"; };\n\t\t635669C3261631DC0068B665 /* URLSessionTransportSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTransportSpec.swift; sourceTree = \"<group>\"; };\n\t\t63ACBE9326D53DF500171582 /* HeartbeatTimerSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartbeatTimerSpec.swift; sourceTree = \"<group>\"; };\n\t\t63B526842656CF9600289719 /* Starscream.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Starscream.xcframework; path = Carthage/Build/Starscream.xcframework; sourceTree = \"<group>\"; };\n\t\t63B5268D2656CFFE00289719 /* RxSwift.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = RxSwift.xcframework; path = Carthage/Build/RxSwift.xcframework; sourceTree = \"<group>\"; };\n\t\t63B526DC2656D53700289719 /* Nimble.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Nimble.xcframework; path = Carthage/Build/Nimble.xcframework; sourceTree = \"<group>\"; };\n\t\t63B526DD2656D53700289719 /* Quick.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = Quick.xcframework; path = Carthage/Build/Quick.xcframework; sourceTree = \"<group>\"; };\n\t\t63DE6CC9272A2ECB00E2A728 /* MessageSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageSpec.swift; sourceTree = \"<group>\"; };\n\t\t63F0F58C2592E44800C904FB /* ChatRoomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatRoomViewController.swift; sourceTree = \"<group>\"; };\n\t\t63F3765229E7296F00A5AB6E /* SynchronizedArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SynchronizedArray.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t125A9EE12543C82800292017 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t125A9EF82543C84700292017 /* SwiftPhoenixClient.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281438F25410D52008615A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281439825410D52008615A7 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t63B526DE2656D53700289719 /* Nimble.xcframework in Frameworks */,\n\t\t\t\t63B526DF2656D53700289719 /* Quick.xcframework in Frameworks */,\n\t\t\t\t1281439C25410D52008615A7 /* SwiftPhoenixClient.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t125A9EFD2543C8D000292017 /* Basic */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t63F0F5922592E59800C904FB /* chatroom */,\n\t\t\t\t63F0F5912592E58800C904FB /* basic */,\n\t\t\t\t125A9EFF2543C8D000292017 /* Assets.xcassets */,\n\t\t\t\t125A9F002543C8D000292017 /* LaunchScreen.storyboard */,\n\t\t\t\t125A9F022543C8D000292017 /* Main.storyboard */,\n\t\t\t\t125A9F042543C8D000292017 /* AppDelegate.swift */,\n\t\t\t\t125A9F052543C8D000292017 /* Info.plist */,\n\t\t\t\t125A9F062543C8D000292017 /* SceneDelegate.swift */,\n\t\t\t);\n\t\t\tpath = Basic;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1281438825410D52008615A7 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t128143AC25410DF3008615A7 /* Sources */,\n\t\t\t\t128143B425410E01008615A7 /* Tests */,\n\t\t\t\t128143BB25410E13008615A7 /* Examples */,\n\t\t\t\t128143D82541142F008615A7 /* Frameworks */,\n\t\t\t\t1281439325410D52008615A7 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t1281439325410D52008615A7 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t1281439225410D52008615A7 /* SwiftPhoenixClient.framework */,\n\t\t\t\t1281439B25410D52008615A7 /* SwiftPhoenixClientTests.xctest */,\n\t\t\t\t125A9EE42543C82800292017 /* Basic.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143AC25410DF3008615A7 /* Sources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t128143AE25410DF3008615A7 /* SwiftPhoenixClient */,\n\t\t\t\t128143AF25410DF3008615A7 /* Supporting Files */,\n\t\t\t);\n\t\t\tpath = Sources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143AE25410DF3008615A7 /* SwiftPhoenixClient */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12991E04254C3F3300BB8650 /* Channel.swift */,\n\t\t\t\t12991DFA254C3EB800BB8650 /* Defaults.swift */,\n\t\t\t\t12991DFC254C3ED300BB8650 /* Delegated.swift */,\n\t\t\t\t12991DFE254C3EF900BB8650 /* HeartbeatTimer.swift */,\n\t\t\t\t12991E06254C3F4B00BB8650 /* Message.swift */,\n\t\t\t\t12991E08254C3F5B00BB8650 /* Presence.swift */,\n\t\t\t\t12991E02254C3F2300BB8650 /* Push.swift */,\n\t\t\t\t12922E1F2543B10B0034B257 /* Socket.swift */,\n\t\t\t\t12991E00254C3F1300BB8650 /* TimeoutTimer.swift */,\n\t\t\t\t12922E212543B37B0034B257 /* PhoenixTransport.swift */,\n\t\t\t\t63F3765229E7296F00A5AB6E /* SynchronizedArray.swift */,\n\t\t\t);\n\t\t\tpath = SwiftPhoenixClient;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143AF25410DF3008615A7 /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t128143B025410DF3008615A7 /* SwiftPhoenixClient.h */,\n\t\t\t\t128143B125410DF3008615A7 /* Info.plist */,\n\t\t\t);\n\t\t\tpath = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143B425410E01008615A7 /* Tests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12991E0C254C450A00BB8650 /* Fakes */,\n\t\t\t\t12991E0D254C451700BB8650 /* Helpers */,\n\t\t\t\t12EF620925524DBF00A6EE9B /* Mocks */,\n\t\t\t\t12EF61FE25524B6800A6EE9B /* SwiftPhoenixClientTests */,\n\t\t\t);\n\t\t\tpath = Tests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143BB25410E13008615A7 /* Examples */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t125A9EFD2543C8D000292017 /* Basic */,\n\t\t\t);\n\t\t\tpath = Examples;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t128143D82541142F008615A7 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t63B526DC2656D53700289719 /* Nimble.xcframework */,\n\t\t\t\t63B526DD2656D53700289719 /* Quick.xcframework */,\n\t\t\t\t63B5268D2656CFFE00289719 /* RxSwift.xcframework */,\n\t\t\t\t63B526842656CF9600289719 /* Starscream.xcframework */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t12991E0C254C450A00BB8650 /* Fakes */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12991E0E254C454C00BB8650 /* SocketSpy.swift */,\n\t\t\t\t12991E10254C456F00BB8650 /* FakeTimerQueue.swift */,\n\t\t\t\t12991E14254C45FC00BB8650 /* FakeTimerQueueSpec.swift */,\n\t\t\t);\n\t\t\tpath = Fakes;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t12991E0D254C451700BB8650 /* Helpers */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12991E12254C458100BB8650 /* TestHelpers.swift */,\n\t\t\t);\n\t\t\tpath = Helpers;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t12EF61FE25524B6800A6EE9B /* SwiftPhoenixClientTests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12EF61FF25524B6800A6EE9B /* SocketSpec.swift */,\n\t\t\t\t12EF620025524B6800A6EE9B /* ChannelSpec.swift */,\n\t\t\t\t12EF620125524B6800A6EE9B /* PresenceSpec.swift */,\n\t\t\t\t12EF620225524B6800A6EE9B /* TimeoutTimerSpec.swift */,\n\t\t\t\t12EF620325524B6800A6EE9B /* DefaultSerializerSpec.swift */,\n\t\t\t\t635669C3261631DC0068B665 /* URLSessionTransportSpec.swift */,\n\t\t\t\t63ACBE9326D53DF500171582 /* HeartbeatTimerSpec.swift */,\n\t\t\t\t63DE6CC9272A2ECB00E2A728 /* MessageSpec.swift */,\n\t\t\t);\n\t\t\tpath = SwiftPhoenixClientTests;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t12EF620925524DBF00A6EE9B /* Mocks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t12EF620C25524EEF00A6EE9B /* MockableClass.generated.swift */,\n\t\t\t\t12EF620D25524EEF00A6EE9B /* MockableProtocol.generated.swift */,\n\t\t\t);\n\t\t\tpath = Mocks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t63F0F5912592E58800C904FB /* basic */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t125A9F0E2543CDDE00292017 /* BasicChatViewController.swift */,\n\t\t\t);\n\t\t\tpath = basic;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t63F0F5922592E59800C904FB /* chatroom */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t63F0F58C2592E44800C904FB /* ChatRoomViewController.swift */,\n\t\t\t);\n\t\t\tpath = chatroom;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t1281438D25410D52008615A7 /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t128143B225410DF3008615A7 /* SwiftPhoenixClient.h in Headers */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t125A9EE32543C82800292017 /* Basic */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 125A9EF52543C82900292017 /* Build configuration list for PBXNativeTarget \"Basic\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t125A9EE02543C82800292017 /* Sources */,\n\t\t\t\t125A9EE12543C82800292017 /* Frameworks */,\n\t\t\t\t125A9EE22543C82800292017 /* Resources */,\n\t\t\t\t63B526B42656D0DE00289719 /* Embed Frameworks */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t125A9EFB2543C84700292017 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = Basic;\n\t\t\tproductName = Basic;\n\t\t\tproductReference = 125A9EE42543C82800292017 /* Basic.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n\t\t1281439125410D52008615A7 /* SwiftPhoenixClient */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 128143A625410D52008615A7 /* Build configuration list for PBXNativeTarget \"SwiftPhoenixClient\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1281438D25410D52008615A7 /* Headers */,\n\t\t\t\t1281438E25410D52008615A7 /* Sources */,\n\t\t\t\t1281438F25410D52008615A7 /* Frameworks */,\n\t\t\t\t1281439025410D52008615A7 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = SwiftPhoenixClient;\n\t\t\tproductName = SwiftPhoenixClient;\n\t\t\tproductReference = 1281439225410D52008615A7 /* SwiftPhoenixClient.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n\t\t1281439A25410D52008615A7 /* SwiftPhoenixClientTests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 128143A925410D52008615A7 /* Build configuration list for PBXNativeTarget \"SwiftPhoenixClientTests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t1281439725410D52008615A7 /* Sources */,\n\t\t\t\t1281439825410D52008615A7 /* Frameworks */,\n\t\t\t\t1281439925410D52008615A7 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t1281439E25410D52008615A7 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = SwiftPhoenixClientTests;\n\t\t\tproductName = SwiftPhoenixClientTests;\n\t\t\tproductReference = 1281439B25410D52008615A7 /* SwiftPhoenixClientTests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t1281438925410D52008615A7 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 1170;\n\t\t\t\tLastUpgradeCheck = 1420;\n\t\t\t\tORGANIZATIONNAME = SwiftPhoenixClient;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t125A9EE32543C82800292017 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 11.7;\n\t\t\t\t\t\tLastSwiftMigration = 1230;\n\t\t\t\t\t};\n\t\t\t\t\t1281439125410D52008615A7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 11.7;\n\t\t\t\t\t};\n\t\t\t\t\t1281439A25410D52008615A7 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 11.7;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 1281438C25410D52008615A7 /* Build configuration list for PBXProject \"SwiftPhoenixClient\" */;\n\t\t\tcompatibilityVersion = \"Xcode 9.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 1281438825410D52008615A7;\n\t\t\tproductRefGroup = 1281439325410D52008615A7 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t1281439125410D52008615A7 /* SwiftPhoenixClient */,\n\t\t\t\t1281439A25410D52008615A7 /* SwiftPhoenixClientTests */,\n\t\t\t\t125A9EE32543C82800292017 /* Basic */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t125A9EE22543C82800292017 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t125A9F082543C8D000292017 /* Assets.xcassets in Resources */,\n\t\t\t\t125A9F0A2543C8D000292017 /* Main.storyboard in Resources */,\n\t\t\t\t125A9F092543C8D000292017 /* LaunchScreen.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281439025410D52008615A7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281439925410D52008615A7 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t125A9EE02543C82800292017 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t125A9F0B2543C8D000292017 /* AppDelegate.swift in Sources */,\n\t\t\t\t125A9F0F2543CDDE00292017 /* BasicChatViewController.swift in Sources */,\n\t\t\t\t63F0F58D2592E44800C904FB /* ChatRoomViewController.swift in Sources */,\n\t\t\t\t125A9F0D2543C8D000292017 /* SceneDelegate.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281438E25410D52008615A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t12991DFB254C3EB800BB8650 /* Defaults.swift in Sources */,\n\t\t\t\t12991E05254C3F3300BB8650 /* Channel.swift in Sources */,\n\t\t\t\t63F3765329E7296F00A5AB6E /* SynchronizedArray.swift in Sources */,\n\t\t\t\t12991E09254C3F5B00BB8650 /* Presence.swift in Sources */,\n\t\t\t\t12991E01254C3F1300BB8650 /* TimeoutTimer.swift in Sources */,\n\t\t\t\t12991E07254C3F4B00BB8650 /* Message.swift in Sources */,\n\t\t\t\t12991DFD254C3ED300BB8650 /* Delegated.swift in Sources */,\n\t\t\t\t12991DFF254C3EF900BB8650 /* HeartbeatTimer.swift in Sources */,\n\t\t\t\t12991E03254C3F2300BB8650 /* Push.swift in Sources */,\n\t\t\t\t12922E202543B10B0034B257 /* Socket.swift in Sources */,\n\t\t\t\t12922E222543B37B0034B257 /* PhoenixTransport.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t1281439725410D52008615A7 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t12EF620825524B6800A6EE9B /* DefaultSerializerSpec.swift in Sources */,\n\t\t\t\t63ACBE9426D53DF500171582 /* HeartbeatTimerSpec.swift in Sources */,\n\t\t\t\t12991E11254C456F00BB8650 /* FakeTimerQueue.swift in Sources */,\n\t\t\t\t12991E15254C45FC00BB8650 /* FakeTimerQueueSpec.swift in Sources */,\n\t\t\t\t635669C4261631DC0068B665 /* URLSessionTransportSpec.swift in Sources */,\n\t\t\t\t12EF620725524B6800A6EE9B /* TimeoutTimerSpec.swift in Sources */,\n\t\t\t\t63DE6CCA272A2ECB00E2A728 /* MessageSpec.swift in Sources */,\n\t\t\t\t12EF620F25524EEF00A6EE9B /* MockableProtocol.generated.swift in Sources */,\n\t\t\t\t12991E0F254C454C00BB8650 /* SocketSpy.swift in Sources */,\n\t\t\t\t12991E13254C458100BB8650 /* TestHelpers.swift in Sources */,\n\t\t\t\t12EF620525524B6800A6EE9B /* ChannelSpec.swift in Sources */,\n\t\t\t\t12EF620E25524EEF00A6EE9B /* MockableClass.generated.swift in Sources */,\n\t\t\t\t12EF620625524B6800A6EE9B /* PresenceSpec.swift in Sources */,\n\t\t\t\t12EF620425524B6800A6EE9B /* SocketSpec.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t125A9EFB2543C84700292017 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1281439125410D52008615A7 /* SwiftPhoenixClient */;\n\t\t\ttargetProxy = 125A9EFA2543C84700292017 /* PBXContainerItemProxy */;\n\t\t};\n\t\t1281439E25410D52008615A7 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 1281439125410D52008615A7 /* SwiftPhoenixClient */;\n\t\t\ttargetProxy = 1281439D25410D52008615A7 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin PBXVariantGroup section */\n\t\t125A9F002543C8D000292017 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t125A9F012543C8D000292017 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t125A9F022543C8D000292017 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t125A9F032543C8D000292017 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t125A9EF62543C82900292017 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Carthage/Build/iOS\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = Examples/Basic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClient.Basic;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t125A9EF72543C82900292017 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Carthage/Build/iOS\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = Examples/Basic/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClient.Basic;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t128143A425410D52008615A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = \"$(SRCROOT)/Carthage/Build/\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.15;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t128143A525410D52008615A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = \"$(SRCROOT)/Carthage/Build/\";\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.15;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t128143A725410D52008615A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDEVELOPMENT_TEAM = \"\";\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/Sources/Supporting Files/Info.plist\";\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.13;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClient;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME:c99extidentifier)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSUPPORTED_PLATFORMS = \"macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tWATCHOS_DEPLOYMENT_TARGET = 4.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t128143A825410D52008615A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEFINES_MODULE = YES;\n\t\t\t\tDEVELOPMENT_TEAM = \"\";\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/Sources/Supporting Files/Info.plist\";\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.13;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClient;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME:c99extidentifier)\";\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t\tSUPPORTED_PLATFORMS = \"macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tWATCHOS_DEPLOYMENT_TARGET = 4.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t128143AA25410D52008615A7 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=appletvos*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/tvOS/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Nimble.xcframework/ios-arm64_armv7\",\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Quick.xcframework/ios-arm64_armv7\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Nimble.xcframework/ios-arm64_i386_x86_64-simulator\",\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Quick.xcframework/ios-arm64_i386_x86_64-simulator\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=macosx*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Mac/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/Sources/Supporting Files/Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\t\"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]\" = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.13;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClientTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 12.0;\n\t\t\t\tWATCHOS_DEPLOYMENT_TARGET = 4.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t128143AB25410D52008615A7 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=appletv*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/tvOS/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=iphone*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/iOS/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=macosx*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/Mac/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\t\"FRAMEWORK_SEARCH_PATHS[sdk=watch*]\" = (\n\t\t\t\t\t\"$(SRCROOT)/Carthage/Build/watchOS/\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = \"$(SRCROOT)/Sources/Supporting Files/Info.plist\";\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 11.0;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\t\"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]\" = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t\t\"@loader_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 10.13;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.SwiftPhoenixClientTests;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSUPPORTED_PLATFORMS = \"macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 12.0;\n\t\t\t\tWATCHOS_DEPLOYMENT_TARGET = 4.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t125A9EF52543C82900292017 /* Build configuration list for PBXNativeTarget \"Basic\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t125A9EF62543C82900292017 /* Debug */,\n\t\t\t\t125A9EF72543C82900292017 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t1281438C25410D52008615A7 /* Build configuration list for PBXProject \"SwiftPhoenixClient\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t128143A425410D52008615A7 /* Debug */,\n\t\t\t\t128143A525410D52008615A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t128143A625410D52008615A7 /* Build configuration list for PBXNativeTarget \"SwiftPhoenixClient\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t128143A725410D52008615A7 /* Debug */,\n\t\t\t\t128143A825410D52008615A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t128143A925410D52008615A7 /* Build configuration list for PBXNativeTarget \"SwiftPhoenixClientTests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t128143AA25410D52008615A7 /* Debug */,\n\t\t\t\t128143AB25410D52008615A7 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 1281438925410D52008615A7 /* Project object */;\n}\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:SwiftPhoenixClient.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict/>\n</plist>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/xcshareddata/xcschemes/Basic.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1420\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"125A9EE32543C82800292017\"\n               BuildableName = \"Basic.app\"\n               BlueprintName = \"Basic\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"125A9EE32543C82800292017\"\n            BuildableName = \"Basic.app\"\n            BlueprintName = \"Basic\"\n            ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"125A9EE32543C82800292017\"\n            BuildableName = \"Basic.app\"\n            BlueprintName = \"Basic\"\n            ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/xcshareddata/xcschemes/RxSwiftPhoenixClient.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1420\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"128143CA25411361008615A7\"\n               BuildableName = \"RxSwiftPhoenixClient.framework\"\n               BlueprintName = \"RxSwiftPhoenixClient\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"128143CA25411361008615A7\"\n            BuildableName = \"RxSwiftPhoenixClient.framework\"\n            BlueprintName = \"RxSwiftPhoenixClient\"\n            ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/xcshareddata/xcschemes/StarscreamSwiftPhoenixClient.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1420\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"631D1877259CE1D7005FAC0E\"\n               BuildableName = \"StarscreamSwiftPhoenixClient.framework\"\n               BlueprintName = \"StarscreamSwiftPhoenixClient\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"631D1877259CE1D7005FAC0E\"\n            BuildableName = \"StarscreamSwiftPhoenixClient.framework\"\n            BlueprintName = \"StarscreamSwiftPhoenixClient\"\n            ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/xcshareddata/xcschemes/SwiftPhoenixClient.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1420\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"1281439125410D52008615A7\"\n               BuildableName = \"SwiftPhoenixClient.framework\"\n               BlueprintName = \"SwiftPhoenixClient\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"1281439A25410D52008615A7\"\n               BuildableName = \"SwiftPhoenixClientTests.xctest\"\n               BlueprintName = \"SwiftPhoenixClientTests\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"1281439125410D52008615A7\"\n            BuildableName = \"SwiftPhoenixClient.framework\"\n            BlueprintName = \"SwiftPhoenixClient\"\n            ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "SwiftPhoenixClient.xcodeproj/xcshareddata/xcschemes/SwiftPhoenixClientTests.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1420\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"1281439A25410D52008615A7\"\n               BuildableName = \"SwiftPhoenixClientTests.xctest\"\n               BlueprintName = \"SwiftPhoenixClientTests\"\n               ReferencedContainer = \"container:SwiftPhoenixClient.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "Tests/Fakes/FakeTimerQueue.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n\n\nimport Foundation\n@testable import SwiftPhoenixClient\n\n\n/**\n Provides a fake TimerQueue that allows tests to manipulate the clock without\n actually waiting on a real Timer.\n */\nclass FakeTimerQueue: TimerQueue {\n  \n  var tickTime: TimeInterval = 0.0\n  var workItems: [(deadline: TimeInterval, workItem: DispatchWorkItem)] = []\n  \n  func reset() {\n    self.tickTime = 0.0\n    self.workItems = []\n  }\n  \n  func tick(_ timeInterval: TimeInterval) {\n    // calculate what time to advance to\n    let advanceTo = self.tickTime + timeInterval\n    \n    // Filter all work items that are due to be fired and have not been\n    // cancelled. Return early if there are no items to fire\n    var pastDue = workItems\n      .filter({ $0.deadline <= advanceTo && !$0.workItem.isCancelled })\n    \n    // Keep looping until there are no more work items that are passed the\n    // advance to time\n    while !pastDue.isEmpty {\n      \n      // Perform all work items that are due\n      pastDue.forEach({\n        self.tickTime = $0.deadline\n        $0.workItem.perform()\n      })\n      \n      // Remove all work items that are past due or canceled\n      workItems.removeAll(where: { $0.deadline <= self.tickTime\n        || $0.workItem.isCancelled })\n      pastDue = workItems\n        .filter({ $0.deadline <= advanceTo && !$0.workItem.isCancelled })\n    }\n    \n    // Now that all work has been performed, advance the clock\n    self.tickTime = advanceTo\n    \n  }\n  \n  override func queue(timeInterval: TimeInterval, execute: DispatchWorkItem) {\n    let deadline = tickTime + timeInterval\n    self.workItems.append((deadline, execute))\n  }\n  \n  // Helper for writing tests\n  func queue(timeInterval: TimeInterval, execute work: @escaping () -> Void) {\n    self.queue(timeInterval: timeInterval, execute: DispatchWorkItem(block: work))\n  }\n}\n\n"
  },
  {
    "path": "Tests/Fakes/FakeTimerQueueSpec.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\n/// Tests the FakeTimerQueue that is used in all other tests to verify that\n/// the fake timer is behaving as expected in all tests to prevent false\n/// negatives or positives when writing tests\nclass FakeTimerQueueSpec: QuickSpec {\n  \n  override func spec() {\n    \n    var queue: FakeTimerQueue!\n    \n    beforeEach {\n      queue = FakeTimerQueue()\n    }\n    \n    afterEach {\n      queue.reset()\n    }\n    \n    describe(\"reset\") {\n      it(\"resets the queue\", closure: {\n        var task100msCalled = false\n        var task200msCalled = false\n        var task300msCalled = false\n        \n        queue.queue(timeInterval: 0.1, execute: { task100msCalled = true })\n        queue.queue(timeInterval: 0.2, execute: { task200msCalled = true })\n        queue.queue(timeInterval: 0.3, execute: { task300msCalled = true })\n        \n        queue.tick(0.250)\n        expect(queue.tickTime).to(equal(0.250))\n        expect(queue.workItems).to(haveCount(1))\n        expect(task100msCalled).to(beTrue())\n        expect(task200msCalled).to(beTrue())\n        expect(task300msCalled).to(beFalse())\n        \n        queue.reset()\n        expect(queue.tickTime).to(equal(0))\n        expect(queue.workItems).to(beEmpty())\n      })\n    }\n    \n    describe(\"triggers\") {\n      it(\"triggers work that is passed due\", closure: {\n        var task100msCalled = false\n        var task200msCalled = false\n        var task300msCalled = false\n        \n        queue.queue(timeInterval: 0.1, execute: { task100msCalled = true })\n        queue.queue(timeInterval: 0.2, execute: { task200msCalled = true })\n        queue.queue(timeInterval: 0.3, execute: { task300msCalled = true })\n        \n        queue.tick(0.100)\n        expect(queue.tickTime).to(equal(0.100))\n        expect(task100msCalled).to(beTrue())\n        \n        queue.tick(0.100)\n        expect(queue.tickTime).to(equal(0.200))\n        expect(task200msCalled).to(beTrue())\n        \n        queue.tick(0.050)\n        expect(queue.tickTime).to(equal(0.250))\n        expect(task300msCalled).to(beFalse())\n      })\n      \n      it(\"triggers all work that is passed due\", closure: {\n        var task100msCalled = false\n        var task200msCalled = false\n        var task300msCalled = false\n        \n        queue.queue(timeInterval: 0.1, execute: { task100msCalled = true })\n        queue.queue(timeInterval: 0.2, execute: { task200msCalled = true })\n        queue.queue(timeInterval: 0.3, execute: { task300msCalled = true })\n        \n        queue.tick(0.250)\n        expect(queue.tickTime).to(equal(0.250))\n        expect(queue.workItems).to(haveCount(1))\n        expect(task100msCalled).to(beTrue())\n        expect(task200msCalled).to(beTrue())\n        expect(task300msCalled).to(beFalse())\n      })\n      \n      it(\"triggers work that is scheduled for a time that is after tick\", closure: {\n        var task100msCalled = false\n        var task200msCalled = false\n        var task300msCalled = false\n        \n        queue.queue(timeInterval: 0.1, execute: {\n          task100msCalled = true\n          \n          queue.queue(timeInterval: 0.1, execute: {\n            task200msCalled = true\n          })\n\n        })\n        \n        queue.queue(timeInterval: 0.3, execute: { task300msCalled = true })\n        \n        queue.tick(0.250)\n        expect(queue.tickTime).to(equal(0.250))\n        expect(task100msCalled).to(beTrue())\n        expect(task200msCalled).to(beTrue())\n        expect(task300msCalled).to(beFalse())\n      })\n      \n      it(\"does not triggers nested work that is scheduled outside of the tick\", closure: {\n        var task100msCalled = false\n        var task200msCalled = false\n        var task300msCalled = false\n        \n        queue.queue(timeInterval: 0.1, execute: {\n          task100msCalled = true\n          \n          queue.queue(timeInterval: 0.1, execute: {\n            task200msCalled = true\n            \n            queue.queue(timeInterval: 0.1, execute: {\n              task300msCalled = true\n            })\n            \n          })\n          \n        })\n        \n        queue.tick(0.250)\n        expect(queue.tickTime).to(equal(0.250))\n        expect(task100msCalled).to(beTrue())\n        expect(task200msCalled).to(beTrue())\n        expect(task300msCalled).to(beFalse())\n      })\n    }\n  }\n}\n\n"
  },
  {
    "path": "Tests/Fakes/SocketSpy.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n@testable import SwiftPhoenixClient\n\nclass SocketSpy: Socket {\n  \n  private(set) var pushCalled: Bool?\n  private(set) var pushCallCount: Int = 0\n  private(set) var pushArgs: [Int: (topic: String, event: String, payload: Payload, ref: String?, joinRef: String?)] = [:]\n  \n  override func push(topic: String,\n                     event: String,\n                     payload: Payload,\n                     ref: String? = nil,\n                     joinRef: String? = nil) {\n    self.pushCalled = true\n    self.pushCallCount += 1\n    self.pushArgs[pushCallCount] = (topic: topic, event: event, payload: payload, ref: ref, joinRef: joinRef)\n    super.push(topic: topic,\n               event: event,\n               payload: payload,\n               ref: ref,\n               joinRef: joinRef)\n  }\n\n  \n}\n"
  },
  {
    "path": "Tests/Helpers/TestHelpers.swift",
    "content": "// Copyright (c) 2021 David Stump <david@davidstump.net>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport Foundation\n@testable import SwiftPhoenixClient\n\nenum TestError: Error {\n  case stub\n}\n\nfunc toWebSocketText(data: [Any?]) -> String {\n  let encoded = Defaults.encode(data)\n  return String(decoding: encoded, as: UTF8.self)\n}\n\n/// Transforms two Dictionaries into NSDictionaries so they can be conpared\nfunc transform(_ lhs: [AnyHashable: Any],\n               and rhs: [AnyHashable: Any]) -> (lhs: NSDictionary, rhs: NSDictionary) {\n  return (NSDictionary(dictionary: lhs), NSDictionary(dictionary: rhs))\n}\n\n\nextension Channel {\n  /// Utility method to easily filter the bindings for a channel by their event\n  func getBindings(_ event: String) -> [Binding]? {\n    return self.syncBindingsDel.filter({ $0.event == event })\n  }\n}\n"
  },
  {
    "path": "Tests/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Tests/Mocks/MockableClass.generated.swift",
    "content": "// Generated using Sourcery 1.0.2 — https://github.com/krzysztofzablocki/Sourcery\n// DO NOT EDIT\n\n// swiftlint:disable line_length\n// swiftlint:disable variable_name\n\n@testable import SwiftPhoenixClient\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass ChannelMock: Channel {\n    var socketSetCount: Int = 0\n    var socketDidGetSet: Bool { return socketSetCount > 0 }\n    override var socket: Socket? {\n        didSet { socketSetCount += 1 }\n    }\n    override var state: ChannelState {\n        get { return underlyingState }\n        set(value) { underlyingState = value }\n    }\n    var underlyingState: (ChannelState)!\n    override var syncBindingsDel: SynchronizedArray<Binding> {\n        get { return underlyingSyncBindingsDel }\n        set(value) { underlyingSyncBindingsDel = value }\n    }\n    var underlyingSyncBindingsDel: (SynchronizedArray<Binding>)!\n    override var bindingRef: Int {\n        get { return underlyingBindingRef }\n        set(value) { underlyingBindingRef = value }\n    }\n    var underlyingBindingRef: (Int)!\n    override var timeout: TimeInterval {\n        get { return underlyingTimeout }\n        set(value) { underlyingTimeout = value }\n    }\n    var underlyingTimeout: (TimeInterval)!\n    override var joinedOnce: Bool {\n        get { return underlyingJoinedOnce }\n        set(value) { underlyingJoinedOnce = value }\n    }\n    var underlyingJoinedOnce: (Bool)!\n    var joinPushSetCount: Int = 0\n    var joinPushDidGetSet: Bool { return joinPushSetCount > 0 }\n    override var joinPush: Push! {\n        didSet { joinPushSetCount += 1 }\n    }\n    override var rejoinTimer: TimeoutTimer {\n        get { return underlyingRejoinTimer }\n        set(value) { underlyingRejoinTimer = value }\n    }\n    var underlyingRejoinTimer: (TimeoutTimer)!\n    override var onMessage: (_ message: Message) -> Message {\n        get { return underlyingOnMessage }\n        set(value) { underlyingOnMessage = value }\n    }\n    var underlyingOnMessage: ((_ message: Message) -> Message)!\n\n\n    //MARK: - init\n\n    var initTopicParamsSocketReceivedArguments: (topic: String, params: [String: Any], socket: Socket)?\n    var initTopicParamsSocketClosure: ((String, [String: Any], Socket) -> Void)?\n\n\n    //MARK: - deinit\n\n    var deinitCallsCount = 0\n    var deinitCalled: Bool {\n        return deinitCallsCount > 0\n    }\n    var deinitClosure: (() -> Void)?\n\n\n    //MARK: - join\n\n    var joinTimeoutCallsCount = 0\n    var joinTimeoutCalled: Bool {\n        return joinTimeoutCallsCount > 0\n    }\n    var joinTimeoutReceivedTimeout: TimeInterval?\n    var joinTimeoutReturnValue: Push!\n    var joinTimeoutClosure: ((TimeInterval?) -> Push)?\n\n    override func join(timeout: TimeInterval? = nil) -> Push {\n        joinTimeoutCallsCount += 1\n        joinTimeoutReceivedTimeout = timeout\n        return joinTimeoutClosure.map({ $0(timeout) }) ?? joinTimeoutReturnValue\n    }\n\n\n    //MARK: - onClose\n\n    var onCloseCallsCount = 0\n    var onCloseCalled: Bool {\n        return onCloseCallsCount > 0\n    }\n    var onCloseReceivedCallback: ((Message) -> Void)?\n    var onCloseReturnValue: Int!\n    var onCloseClosure: ((@escaping ((Message) -> Void)) -> Int)?\n\n    override func onClose(_ callback: @escaping ((Message) -> Void)) -> Int {\n        onCloseCallsCount += 1\n        onCloseReceivedCallback = callback\n        return onCloseClosure.map({ $0(callback) }) ?? onCloseReturnValue\n    }\n\n\n    //MARK: - delegateOnClose<Target: AnyObject>\n\n    var delegateOnCloseToCallbackCallsCount = 0\n    var delegateOnCloseToCallbackCalled: Bool {\n        return delegateOnCloseToCallbackCallsCount > 0\n    }\n    var delegateOnCloseToCallbackReturnValue: Int!\n\n    override func delegateOnClose<Target: AnyObject>(to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> Void)) -> Int {\n        delegateOnCloseToCallbackCallsCount += 1\n        return delegateOnCloseToCallbackReturnValue\n    }\n\n\n    //MARK: - onError\n\n    var onErrorCallsCount = 0\n    var onErrorCalled: Bool {\n        return onErrorCallsCount > 0\n    }\n    var onErrorReceivedCallback: ((_ message: Message) -> Void)?\n    var onErrorReturnValue: Int!\n    var onErrorClosure: ((@escaping ((_ message: Message) -> Void)) -> Int)?\n\n    override func onError(_ callback: @escaping ((_ message: Message) -> Void)) -> Int {\n        onErrorCallsCount += 1\n        onErrorReceivedCallback = callback\n        return onErrorClosure.map({ $0(callback) }) ?? onErrorReturnValue\n    }\n\n\n    //MARK: - delegateOnError<Target: AnyObject>\n\n    var delegateOnErrorToCallbackCallsCount = 0\n    var delegateOnErrorToCallbackCalled: Bool {\n        return delegateOnErrorToCallbackCallsCount > 0\n    }\n    var delegateOnErrorToCallbackReturnValue: Int!\n\n    override func delegateOnError<Target: AnyObject>(to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> Void)) -> Int {\n        delegateOnErrorToCallbackCallsCount += 1\n        return delegateOnErrorToCallbackReturnValue\n    }\n\n\n    //MARK: - on\n\n    var onCallbackCallsCount = 0\n    var onCallbackCalled: Bool {\n        return onCallbackCallsCount > 0\n    }\n    var onCallbackReceivedArguments: (event: String, callback: (Message) -> Void)?\n    var onCallbackReturnValue: Int!\n    var onCallbackClosure: ((String, @escaping ((Message) -> Void)) -> Int)?\n\n    override func on(_ event: String, callback: @escaping ((Message) -> Void)) -> Int {\n        onCallbackCallsCount += 1\n    onCallbackReceivedArguments = (event: event, callback: callback)\n        return onCallbackClosure.map({ $0(event, callback) }) ?? onCallbackReturnValue\n    }\n\n\n    //MARK: - delegateOn<Target: AnyObject>\n\n    var delegateOnToCallbackCallsCount = 0\n    var delegateOnToCallbackCalled: Bool {\n        return delegateOnToCallbackCallsCount > 0\n    }\n    var delegateOnToCallbackReturnValue: Int!\n\n    override func delegateOn<Target: AnyObject>(_ event: String,\n                                            to owner: Target,\n                                            callback: @escaping ((Target, Message) -> Void)) -> Int {\n        delegateOnToCallbackCallsCount += 1\n        return delegateOnToCallbackReturnValue\n    }\n\n\n    //MARK: - off\n\n    var offRefCallsCount = 0\n    var offRefCalled: Bool {\n        return offRefCallsCount > 0\n    }\n    var offRefReceivedArguments: (event: String, ref: Int?)?\n    var offRefClosure: ((String, Int?) -> Void)?\n\n    override func off(_ event: String, ref: Int? = nil) {\n        offRefCallsCount += 1\n    offRefReceivedArguments = (event: event, ref: ref)\n        offRefClosure?(event, ref)\n    }\n\n\n    //MARK: - push\n\n    var pushPayloadTimeoutCallsCount = 0\n    var pushPayloadTimeoutCalled: Bool {\n        return pushPayloadTimeoutCallsCount > 0\n    }\n    var pushPayloadTimeoutReceivedArguments: (event: String, payload: Payload, timeout: TimeInterval)?\n    var pushPayloadTimeoutReturnValue: Push!\n    var pushPayloadTimeoutClosure: ((String, Payload, TimeInterval) -> Push)?\n\n    override func push(_ event: String,\n                   payload: Payload,\n                   timeout: TimeInterval = Defaults.timeoutInterval) -> Push {\n        pushPayloadTimeoutCallsCount += 1\n    pushPayloadTimeoutReceivedArguments = (event: event, payload: payload, timeout: timeout)\n        return pushPayloadTimeoutClosure.map({ $0(event, payload, timeout) }) ?? pushPayloadTimeoutReturnValue\n    }\n\n\n    //MARK: - leave\n\n    var leaveTimeoutCallsCount = 0\n    var leaveTimeoutCalled: Bool {\n        return leaveTimeoutCallsCount > 0\n    }\n    var leaveTimeoutReceivedTimeout: TimeInterval?\n    var leaveTimeoutReturnValue: Push!\n    var leaveTimeoutClosure: ((TimeInterval) -> Push)?\n\n    override func leave(timeout: TimeInterval = Defaults.timeoutInterval) -> Push {\n        leaveTimeoutCallsCount += 1\n        leaveTimeoutReceivedTimeout = timeout\n        return leaveTimeoutClosure.map({ $0(timeout) }) ?? leaveTimeoutReturnValue\n    }\n\n\n    //MARK: - onMessage\n\n    var onMessageCallbackCallsCount = 0\n    var onMessageCallbackCalled: Bool {\n        return onMessageCallbackCallsCount > 0\n    }\n    var onMessageCallbackReceivedCallback: ((Message) -> Message)?\n    var onMessageCallbackClosure: ((@escaping (Message) -> Message) -> Void)?\n\n    override func onMessage(callback: @escaping (Message) -> Message) {\n        onMessageCallbackCallsCount += 1\n        onMessageCallbackReceivedCallback = callback\n        onMessageCallbackClosure?(callback)\n    }\n\n\n    //MARK: - isMember\n\n    var isMemberCallsCount = 0\n    var isMemberCalled: Bool {\n        return isMemberCallsCount > 0\n    }\n    var isMemberReceivedMessage: Message?\n    var isMemberReturnValue: Bool!\n    var isMemberClosure: ((Message) -> Bool)?\n\n    override func isMember(_ message: Message) -> Bool {\n        isMemberCallsCount += 1\n        isMemberReceivedMessage = message\n        return isMemberClosure.map({ $0(message) }) ?? isMemberReturnValue\n    }\n\n\n    //MARK: - sendJoin\n\n    var sendJoinCallsCount = 0\n    var sendJoinCalled: Bool {\n        return sendJoinCallsCount > 0\n    }\n    var sendJoinReceivedTimeout: TimeInterval?\n    var sendJoinClosure: ((TimeInterval) -> Void)?\n\n    override func sendJoin(_ timeout: TimeInterval) {\n        sendJoinCallsCount += 1\n        sendJoinReceivedTimeout = timeout\n        sendJoinClosure?(timeout)\n    }\n\n\n    //MARK: - rejoin\n\n    var rejoinCallsCount = 0\n    var rejoinCalled: Bool {\n        return rejoinCallsCount > 0\n    }\n    var rejoinReceivedTimeout: TimeInterval?\n    var rejoinClosure: ((TimeInterval?) -> Void)?\n\n    override func rejoin(_ timeout: TimeInterval? = nil) {\n        rejoinCallsCount += 1\n        rejoinReceivedTimeout = timeout\n        rejoinClosure?(timeout)\n    }\n\n\n    //MARK: - trigger\n\n    var triggerCallsCount = 0\n    var triggerCalled: Bool {\n        return triggerCallsCount > 0\n    }\n    var triggerReceivedMessage: Message?\n    var triggerClosure: ((Message) -> Void)?\n\n    override func trigger(_ message: Message) {\n        triggerCallsCount += 1\n        triggerReceivedMessage = message\n        triggerClosure?(message)\n    }\n\n\n    //MARK: - trigger\n\n    var triggerEventPayloadRefJoinRefCallsCount = 0\n    var triggerEventPayloadRefJoinRefCalled: Bool {\n        return triggerEventPayloadRefJoinRefCallsCount > 0\n    }\n    var triggerEventPayloadRefJoinRefReceivedArguments: (event: String, payload: Payload, ref: String, joinRef: String?)?\n    var triggerEventPayloadRefJoinRefClosure: ((String, Payload, String, String?) -> Void)?\n\n    override func trigger(event: String,\n               payload: Payload = [:],\n               ref: String = \"\",\n               joinRef: String? = nil) {\n        triggerEventPayloadRefJoinRefCallsCount += 1\n    triggerEventPayloadRefJoinRefReceivedArguments = (event: event, payload: payload, ref: ref, joinRef: joinRef)\n        triggerEventPayloadRefJoinRefClosure?(event, payload, ref, joinRef)\n    }\n\n\n    //MARK: - replyEventName\n\n    var replyEventNameCallsCount = 0\n    var replyEventNameCalled: Bool {\n        return replyEventNameCallsCount > 0\n    }\n    var replyEventNameReceivedRef: String?\n    var replyEventNameReturnValue: String!\n    var replyEventNameClosure: ((String) -> String)?\n\n    override func replyEventName(_ ref: String) -> String {\n        replyEventNameCallsCount += 1\n        replyEventNameReceivedRef = ref\n        return replyEventNameClosure.map({ $0(ref) }) ?? replyEventNameReturnValue\n    }\n\n\n}\nclass PushMock: Push {\n    var channelSetCount: Int = 0\n    var channelDidGetSet: Bool { return channelSetCount > 0 }\n    override var channel: Channel? {\n        didSet { channelSetCount += 1 }\n    }\n    override var timeout: TimeInterval {\n        get { return underlyingTimeout }\n        set(value) { underlyingTimeout = value }\n    }\n    var underlyingTimeout: (TimeInterval)!\n    var receivedMessageSetCount: Int = 0\n    var receivedMessageDidGetSet: Bool { return receivedMessageSetCount > 0 }\n    override var receivedMessage: Message? {\n        didSet { receivedMessageSetCount += 1 }\n    }\n    override var timeoutTimer: TimerQueue {\n        get { return underlyingTimeoutTimer }\n        set(value) { underlyingTimeoutTimer = value }\n    }\n    var underlyingTimeoutTimer: (TimerQueue)!\n    var timeoutWorkItemSetCount: Int = 0\n    var timeoutWorkItemDidGetSet: Bool { return timeoutWorkItemSetCount > 0 }\n    override var timeoutWorkItem: DispatchWorkItem? {\n        didSet { timeoutWorkItemSetCount += 1 }\n    }\n    override var sent: Bool {\n        get { return underlyingSent }\n        set(value) { underlyingSent = value }\n    }\n    var underlyingSent: (Bool)!\n    var refSetCount: Int = 0\n    var refDidGetSet: Bool { return refSetCount > 0 }\n    override var ref: String? {\n        didSet { refSetCount += 1 }\n    }\n    var refEventSetCount: Int = 0\n    var refEventDidGetSet: Bool { return refEventSetCount > 0 }\n    override var refEvent: String? {\n        didSet { refEventSetCount += 1 }\n    }\n\n\n    //MARK: - init\n\n    var initChannelEventPayloadTimeoutReceivedArguments: (channel: Channel, event: String, payload: Payload, timeout: TimeInterval)?\n    var initChannelEventPayloadTimeoutClosure: ((Channel, String, Payload, TimeInterval) -> Void)?\n\n\n    //MARK: - resend\n\n    var resendCallsCount = 0\n    var resendCalled: Bool {\n        return resendCallsCount > 0\n    }\n    var resendReceivedTimeout: TimeInterval?\n    var resendClosure: ((TimeInterval) -> Void)?\n\n    override func resend(_ timeout: TimeInterval = Defaults.timeoutInterval) {\n        resendCallsCount += 1\n        resendReceivedTimeout = timeout\n        resendClosure?(timeout)\n    }\n\n\n    //MARK: - send\n\n    var sendCallsCount = 0\n    var sendCalled: Bool {\n        return sendCallsCount > 0\n    }\n    var sendClosure: (() -> Void)?\n\n    override func send() {\n        sendCallsCount += 1\n        sendClosure?()\n    }\n\n\n    //MARK: - receive\n\n    var receiveCallbackCallsCount = 0\n    var receiveCallbackCalled: Bool {\n        return receiveCallbackCallsCount > 0\n    }\n    var receiveCallbackReceivedArguments: (status: String, callback: (Message) -> ())?\n    var receiveCallbackReturnValue: Push!\n    var receiveCallbackClosure: ((String, @escaping ((Message) -> ())) -> Push)?\n\n    override func receive(_ status: String,\n                      callback: @escaping ((Message) -> ())) -> Push {\n        receiveCallbackCallsCount += 1\n    receiveCallbackReceivedArguments = (status: status, callback: callback)\n        return receiveCallbackClosure.map({ $0(status, callback) }) ?? receiveCallbackReturnValue\n    }\n\n\n    //MARK: - delegateReceive<Target: AnyObject>\n\n    var delegateReceiveToCallbackCallsCount = 0\n    var delegateReceiveToCallbackCalled: Bool {\n        return delegateReceiveToCallbackCallsCount > 0\n    }\n    var delegateReceiveToCallbackReturnValue: Push!\n\n    override func delegateReceive<Target: AnyObject>(_ status: String,\n                                                 to owner: Target,\n                                                 callback: @escaping ((Target, Message) -> ())) -> Push {\n        delegateReceiveToCallbackCallsCount += 1\n        return delegateReceiveToCallbackReturnValue\n    }\n\n\n    //MARK: - receive\n\n    var receiveDelegatedCallsCount = 0\n    var receiveDelegatedCalled: Bool {\n        return receiveDelegatedCallsCount > 0\n    }\n    var receiveDelegatedReceivedArguments: (status: String, delegated: Delegated<Message, Void>)?\n    var receiveDelegatedReturnValue: Push!\n    var receiveDelegatedClosure: ((String, Delegated<Message, Void>) -> Push)?\n\n    override func receive(_ status: String, delegated: Delegated<Message, Void>) -> Push {\n        receiveDelegatedCallsCount += 1\n    receiveDelegatedReceivedArguments = (status: status, delegated: delegated)\n        return receiveDelegatedClosure.map({ $0(status, delegated) }) ?? receiveDelegatedReturnValue\n    }\n\n\n    //MARK: - reset\n\n    var resetCallsCount = 0\n    var resetCalled: Bool {\n        return resetCallsCount > 0\n    }\n    var resetClosure: (() -> Void)?\n\n    override func reset() {\n        resetCallsCount += 1\n        resetClosure?()\n    }\n\n\n    //MARK: - cancelTimeout\n\n    var cancelTimeoutCallsCount = 0\n    var cancelTimeoutCalled: Bool {\n        return cancelTimeoutCallsCount > 0\n    }\n    var cancelTimeoutClosure: (() -> Void)?\n\n    override func cancelTimeout() {\n        cancelTimeoutCallsCount += 1\n        cancelTimeoutClosure?()\n    }\n\n\n    //MARK: - startTimeout\n\n    var startTimeoutCallsCount = 0\n    var startTimeoutCalled: Bool {\n        return startTimeoutCallsCount > 0\n    }\n    var startTimeoutClosure: (() -> Void)?\n\n    override func startTimeout() {\n        startTimeoutCallsCount += 1\n        startTimeoutClosure?()\n    }\n\n\n    //MARK: - hasReceived\n\n    var hasReceivedStatusCallsCount = 0\n    var hasReceivedStatusCalled: Bool {\n        return hasReceivedStatusCallsCount > 0\n    }\n    var hasReceivedStatusReceivedStatus: String?\n    var hasReceivedStatusReturnValue: Bool!\n    var hasReceivedStatusClosure: ((String) -> Bool)?\n\n    override func hasReceived(status: String) -> Bool {\n        hasReceivedStatusCallsCount += 1\n        hasReceivedStatusReceivedStatus = status\n        return hasReceivedStatusClosure.map({ $0(status) }) ?? hasReceivedStatusReturnValue\n    }\n\n\n    //MARK: - trigger\n\n    var triggerPayloadCallsCount = 0\n    var triggerPayloadCalled: Bool {\n        return triggerPayloadCallsCount > 0\n    }\n    var triggerPayloadReceivedArguments: (status: String, payload: Payload)?\n    var triggerPayloadClosure: ((String, Payload) -> Void)?\n\n    override func trigger(_ status: String, payload: Payload) {\n        triggerPayloadCallsCount += 1\n    triggerPayloadReceivedArguments = (status: status, payload: payload)\n        triggerPayloadClosure?(status, payload)\n    }\n\n\n}\nclass SocketMock: Socket {\n    override var endPointUrl: URL {\n        get { return underlyingEndPointUrl }\n        set(value) { underlyingEndPointUrl = value }\n    }\n    var underlyingEndPointUrl: (URL)!\n    override var encode: (Any) -> Data {\n        get { return underlyingEncode }\n        set(value) { underlyingEncode = value }\n    }\n    var underlyingEncode: ((Any) -> Data)!\n    override var decode: (Data) -> Any? {\n        get { return underlyingDecode }\n        set(value) { underlyingDecode = value }\n    }\n    var underlyingDecode: ((Data) -> Any?)!\n    override var timeout: TimeInterval {\n        get { return underlyingTimeout }\n        set(value) { underlyingTimeout = value }\n    }\n    var underlyingTimeout: (TimeInterval)!\n    override var heartbeatInterval: TimeInterval {\n        get { return underlyingHeartbeatInterval }\n        set(value) { underlyingHeartbeatInterval = value }\n    }\n    var underlyingHeartbeatInterval: (TimeInterval)!\n    override var heartbeatLeeway: DispatchTimeInterval {\n        get { return underlyingHeartbeatLeeway }\n        set(value) { underlyingHeartbeatLeeway = value }\n    }\n    var underlyingHeartbeatLeeway: (DispatchTimeInterval)!\n    override var reconnectAfter: (Int) -> TimeInterval {\n        get { return underlyingReconnectAfter }\n        set(value) { underlyingReconnectAfter = value }\n    }\n    var underlyingReconnectAfter: ((Int) -> TimeInterval)!\n    override var rejoinAfter: (Int) -> TimeInterval {\n        get { return underlyingRejoinAfter }\n        set(value) { underlyingRejoinAfter = value }\n    }\n    var underlyingRejoinAfter: ((Int) -> TimeInterval)!\n    var loggerSetCount: Int = 0\n    var loggerDidGetSet: Bool { return loggerSetCount > 0 }\n    override var logger: ((String) -> Void)? {\n        didSet { loggerSetCount += 1 }\n    }\n    override var skipHeartbeat: Bool {\n        get { return underlyingSkipHeartbeat }\n        set(value) { underlyingSkipHeartbeat = value }\n    }\n    var underlyingSkipHeartbeat: (Bool)!\n    override var disableSSLCertValidation: Bool {\n        get { return underlyingDisableSSLCertValidation }\n        set(value) { underlyingDisableSSLCertValidation = value }\n    }\n    var underlyingDisableSSLCertValidation: (Bool)!\n    var enabledSSLCipherSuitesSetCount: Int = 0\n    var enabledSSLCipherSuitesDidGetSet: Bool { return enabledSSLCipherSuitesSetCount > 0 }\n    override var enabledSSLCipherSuites: [SSLCipherSuite]? {\n        didSet { enabledSSLCipherSuitesSetCount += 1 }\n    }\n    override var stateChangeCallbacks: StateChangeCallbacks {\n        get { return underlyingStateChangeCallbacks }\n        set(value) { underlyingStateChangeCallbacks = value }\n    }\n    var underlyingStateChangeCallbacks: (StateChangeCallbacks)!\n    override var ref: UInt64 {\n        get { return underlyingRef }\n        set(value) { underlyingRef = value }\n    }\n    var underlyingRef: (UInt64)!\n    var heartbeatTimerSetCount: Int = 0\n    var heartbeatTimerDidGetSet: Bool { return heartbeatTimerSetCount > 0 }\n    override var heartbeatTimer: HeartbeatTimer? {\n        didSet { heartbeatTimerSetCount += 1 }\n    }\n    var pendingHeartbeatRefSetCount: Int = 0\n    var pendingHeartbeatRefDidGetSet: Bool { return pendingHeartbeatRefSetCount > 0 }\n    override var pendingHeartbeatRef: String? {\n        didSet { pendingHeartbeatRefSetCount += 1 }\n    }\n    override var reconnectTimer: TimeoutTimer {\n        get { return underlyingReconnectTimer }\n        set(value) { underlyingReconnectTimer = value }\n    }\n    var underlyingReconnectTimer: (TimeoutTimer)!\n    override var closeStatus: CloseStatus {\n      get { return underlyingCloseStatus }\n      set(value) { underlyingCloseStatus = value }\n    }\n    var underlyingCloseStatus: (CloseStatus)!\n    var connectionSetCount: Int = 0\n    var connectionDidGetSet: Bool { return connectionSetCount > 0 }\n    override var connection: PhoenixTransport? {\n        didSet { connectionSetCount += 1 }\n    }\n\n\n    //MARK: - init\n\n    var initParamsVsnReceivedArguments: (endPoint: String, params: Payload?, vsn: String)?\n    var initParamsVsnClosure: ((String, Payload?, String) -> Void)?\n\n\n    //MARK: - init\n\n    var initParamsClosureVsnReceivedArguments: (endPoint: String, paramsClosure: PayloadClosure?, vsn: String)?\n    var initParamsClosureVsnClosure: ((String, PayloadClosure?, String) -> Void)?\n\n\n    //MARK: - init\n\n    var initEndPointTransportParamsClosureVsnReceivedArguments: (endPoint: String, transport: (URL) -> PhoenixTransport, paramsClosure: PayloadClosure?, vsn: String)?\n    var initEndPointTransportParamsClosureVsnClosure: ((String, @escaping (URL) -> PhoenixTransport, PayloadClosure?, String) -> Void)?\n\n\n    //MARK: - deinit\n\n    var deinitCallsCount = 0\n    var deinitCalled: Bool {\n        return deinitCallsCount > 0\n    }\n    var deinitClosure: (() -> Void)?\n\n\n    //MARK: - connect\n\n    var connectCallsCount = 0\n    var connectCalled: Bool {\n        return connectCallsCount > 0\n    }\n    var connectClosure: (() -> Void)?\n\n    override func connect() {\n        connectCallsCount += 1\n        connectClosure?()\n    }\n\n\n    //MARK: - disconnect\n\n    var disconnectCodeReasonCallbackCallsCount = 0\n    var disconnectCodeReasonCallbackCalled: Bool {\n        return disconnectCodeReasonCallbackCallsCount > 0\n    }\n    var disconnectCodeReasonCallbackReceivedArguments: (code: CloseCode, reason: String?, callback: (() -> Void)?)?\n    var disconnectCodeReasonCallbackClosure: ((CloseCode, String?, (() -> Void)?) -> Void)?\n\n    override func disconnect(code: CloseCode = CloseCode.normal, reason: String? = nil, callback: (() -> Void)? = nil) {\n        disconnectCodeReasonCallbackCallsCount += 1\n    disconnectCodeReasonCallbackReceivedArguments = (code: code, reason: reason, callback: callback)\n        disconnectCodeReasonCallbackClosure?(code, reason, callback)\n    }\n\n\n    //MARK: - teardown\n\n    var teardownCodeReasonCallbackCallsCount = 0\n    var teardownCodeReasonCallbackCalled: Bool {\n        return teardownCodeReasonCallbackCallsCount > 0\n    }\n    var teardownCodeReasonCallbackReceivedArguments: (code: CloseCode, reason: String?, callback: (() -> Void)?)?\n    var teardownCodeReasonCallbackClosure: ((CloseCode, String?, (() -> Void)?) -> Void)?\n\n    override func teardown(code: CloseCode = CloseCode.normal, reason: String? = nil, callback: (() -> Void)? = nil) {\n        teardownCodeReasonCallbackCallsCount += 1\n    teardownCodeReasonCallbackReceivedArguments = (code: code, reason: reason, callback: callback)\n        teardownCodeReasonCallbackClosure?(code, reason, callback)\n    }\n\n\n    //MARK: - onOpen\n\n    var onOpenCallbackCallsCount = 0\n    var onOpenCallbackCalled: Bool {\n        return onOpenCallbackCallsCount > 0\n    }\n    var onOpenCallbackReceivedCallback: (() -> Void)?\n    var onOpenCallbackReturnValue: String!\n    var onOpenCallbackClosure: ((@escaping () -> Void) -> String)?\n\n    override func onOpen(callback: @escaping () -> Void) -> String {\n        onOpenCallbackCallsCount += 1\n        onOpenCallbackReceivedCallback = callback\n        return onOpenCallbackClosure.map({ $0(callback) }) ?? onOpenCallbackReturnValue\n    }\n\n\n    //MARK: - delegateOnOpen<T: AnyObject>\n\n    var delegateOnOpenToCallbackCallsCount = 0\n    var delegateOnOpenToCallbackCalled: Bool {\n        return delegateOnOpenToCallbackCallsCount > 0\n    }\n    var delegateOnOpenToCallbackReturnValue: String!\n\n    override func delegateOnOpen<T: AnyObject>(to owner: T,\n                                           callback: @escaping ((T) -> Void)) -> String {\n        delegateOnOpenToCallbackCallsCount += 1\n        return delegateOnOpenToCallbackReturnValue\n    }\n\n\n    //MARK: - onClose\n\n    var onCloseCallbackCallsCount = 0\n    var onCloseCallbackCalled: Bool {\n        return onCloseCallbackCallsCount > 0\n    }\n    var onCloseCallbackReceivedCallback: (() -> Void)?\n    var onCloseCallbackReturnValue: String!\n    var onCloseCallbackClosure: ((@escaping () -> Void) -> String)?\n\n    override func onClose(callback: @escaping () -> Void) -> String {\n        onCloseCallbackCallsCount += 1\n        onCloseCallbackReceivedCallback = callback\n        return onCloseCallbackClosure.map({ $0(callback) }) ?? onCloseCallbackReturnValue\n    }\n\n\n    //MARK: - onClose\n\n    var onCloseCallbackWithCodeCallsCount = 0\n    var onCloseCallbackWithCodeCalled: Bool {\n        return onCloseCallbackWithCodeCallsCount > 0\n    }\n    var onCloseCallbackWithCodeReceivedCallback: ((Int, String?) -> Void)?\n    var onCloseCallbackWithCodeReturnValue: String!\n    var onCloseCallbackWithCodeClosure: ((@escaping (Int, String?) -> Void) -> String)?\n\n    override func onClose(callback: @escaping (Int, String?) -> Void) -> String {\n        onCloseCallbackWithCodeCallsCount += 1\n        onCloseCallbackWithCodeReceivedCallback = callback\n        return onCloseCallbackWithCodeClosure.map({ $0(callback) }) ?? onCloseCallbackWithCodeReturnValue\n    }\n\n\n    //MARK: - delegateOnClose<T: AnyObject>\n\n    var delegateOnCloseToCallbackCallsCount = 0\n    var delegateOnCloseToCallbackCalled: Bool {\n        return delegateOnCloseToCallbackCallsCount > 0\n    }\n    var delegateOnCloseToCallbackReturnValue: String!\n\n    override func delegateOnClose<T: AnyObject>(to owner: T, callback: @escaping (T) -> Void) -> String {\n        delegateOnCloseToCallbackCallsCount += 1\n        return delegateOnCloseToCallbackReturnValue\n    }\n\n\n    //MARK: - delegateOnClose<T: AnyObject>\n\n    var delegateOnCloseToCallbackWithCodeCallsCount = 0\n    var delegateOnCloseToCallbackWithCodeCalled: Bool {\n        return delegateOnCloseToCallbackWithCodeCallsCount > 0\n    }\n    var delegateOnCloseToCallbackWithCodeReturnValue: String!\n\n    override func delegateOnClose<T: AnyObject>(to owner: T, callback: @escaping (T, (Int, String?)) -> Void) -> String {\n        delegateOnCloseToCallbackWithCodeCallsCount += 1\n        return delegateOnCloseToCallbackWithCodeReturnValue\n    }\n\n\n    //MARK: - onError\n\n    var onErrorCallbackCallsCount = 0\n    var onErrorCallbackCalled: Bool {\n        return onErrorCallbackCallsCount > 0\n    }\n    var onErrorCallbackReceivedCallback: (((Error, URLResponse?)) -> Void)?\n    var onErrorCallbackReturnValue: String!\n    var onErrorCallbackClosure: ((@escaping ((Error, URLResponse?)) -> Void) -> String)?\n\n    override func onError(callback: @escaping ((Error, URLResponse?)) -> Void) -> String {\n        onErrorCallbackCallsCount += 1\n        onErrorCallbackReceivedCallback = callback\n        return onErrorCallbackClosure.map({ $0(callback) }) ?? onErrorCallbackReturnValue\n    }\n\n\n    //MARK: - delegateOnError<T: AnyObject>\n\n    var delegateOnErrorToCallbackCallsCount = 0\n    var delegateOnErrorToCallbackCalled: Bool {\n        return delegateOnErrorToCallbackCallsCount > 0\n    }\n    var delegateOnErrorToCallbackReturnValue: String!\n\n    override func delegateOnError<T: AnyObject>(to owner: T,\n                                            callback: @escaping ((T, (Error, URLResponse?)) -> Void)) -> String {\n        delegateOnErrorToCallbackCallsCount += 1\n        return delegateOnErrorToCallbackReturnValue\n    }\n\n\n    //MARK: - onMessage\n\n    var onMessageCallbackCallsCount = 0\n    var onMessageCallbackCalled: Bool {\n        return onMessageCallbackCallsCount > 0\n    }\n    var onMessageCallbackReceivedCallback: ((Message) -> Void)?\n    var onMessageCallbackReturnValue: String!\n    var onMessageCallbackClosure: ((@escaping (Message) -> Void) -> String)?\n\n    override func onMessage(callback: @escaping (Message) -> Void) -> String {\n        onMessageCallbackCallsCount += 1\n        onMessageCallbackReceivedCallback = callback\n        return onMessageCallbackClosure.map({ $0(callback) }) ?? onMessageCallbackReturnValue\n    }\n\n\n    //MARK: - delegateOnMessage<T: AnyObject>\n\n    var delegateOnMessageToCallbackCallsCount = 0\n    var delegateOnMessageToCallbackCalled: Bool {\n        return delegateOnMessageToCallbackCallsCount > 0\n    }\n    var delegateOnMessageToCallbackReturnValue: String!\n\n    override func delegateOnMessage<T: AnyObject>(to owner: T,\n                                              callback: @escaping ((T, Message) -> Void)) -> String {\n        delegateOnMessageToCallbackCallsCount += 1\n        return delegateOnMessageToCallbackReturnValue\n    }\n\n\n    //MARK: - releaseCallbacks\n\n    var releaseCallbacksCallsCount = 0\n    var releaseCallbacksCalled: Bool {\n        return releaseCallbacksCallsCount > 0\n    }\n    var releaseCallbacksClosure: (() -> Void)?\n\n    override func releaseCallbacks() {\n        releaseCallbacksCallsCount += 1\n        releaseCallbacksClosure?()\n    }\n\n\n    //MARK: - channel\n\n    var channelParamsCallsCount = 0\n    var channelParamsCalled: Bool {\n        return channelParamsCallsCount > 0\n    }\n    var channelParamsReceivedArguments: (topic: String, params: [String: Any])?\n    var channelParamsReturnValue: Channel!\n    var channelParamsClosure: ((String, [String: Any]) -> Channel)?\n\n    override func channel(_ topic: String,\n                      params: [String: Any] = [:]) -> Channel {\n        channelParamsCallsCount += 1\n    channelParamsReceivedArguments = (topic: topic, params: params)\n        return channelParamsClosure.map({ $0(topic, params) }) ?? channelParamsReturnValue\n    }\n\n\n    //MARK: - remove\n\n    var removeCallsCount = 0\n    var removeCalled: Bool {\n        return removeCallsCount > 0\n    }\n    var removeReceivedChannel: Channel?\n    var removeClosure: ((Channel) -> Void)?\n\n    override func remove(_ channel: Channel) {\n        removeCallsCount += 1\n        removeReceivedChannel = channel\n        removeClosure?(channel)\n    }\n\n\n    //MARK: - off\n\n    var offCallsCount = 0\n    var offCalled: Bool {\n        return offCallsCount > 0\n    }\n    var offReceivedRefs: [String]?\n    var offClosure: (([String]) -> Void)?\n\n    override func off(_ refs: [String]) {\n        offCallsCount += 1\n        offReceivedRefs = refs\n        offClosure?(refs)\n    }\n\n\n    //MARK: - push\n\n    var pushTopicEventPayloadRefJoinRefCallsCount = 0\n    var pushTopicEventPayloadRefJoinRefCalled: Bool {\n        return pushTopicEventPayloadRefJoinRefCallsCount > 0\n    }\n    var pushTopicEventPayloadRefJoinRefReceivedArguments: (topic: String, event: String, payload: Payload, ref: String?, joinRef: String?)?\n    var pushTopicEventPayloadRefJoinRefClosure: ((String, String, Payload, String?, String?) -> Void)?\n\n    override func push(topic: String,\n                     event: String,\n                     payload: Payload,\n                     ref: String? = nil,\n                     joinRef: String? = nil) {\n        pushTopicEventPayloadRefJoinRefCallsCount += 1\n    pushTopicEventPayloadRefJoinRefReceivedArguments = (topic: topic, event: event, payload: payload, ref: ref, joinRef: joinRef)\n        pushTopicEventPayloadRefJoinRefClosure?(topic, event, payload, ref, joinRef)\n    }\n\n\n    //MARK: - makeRef\n\n    var makeRefCallsCount = 0\n    var makeRefCalled: Bool {\n        return makeRefCallsCount > 0\n    }\n    var makeRefReturnValue: String!\n    var makeRefClosure: (() -> String)?\n\n    override func makeRef() -> String {\n        makeRefCallsCount += 1\n        return makeRefClosure.map({ $0() }) ?? makeRefReturnValue\n    }\n\n\n    //MARK: - logItems\n\n    var logItemsCallsCount = 0\n    var logItemsCalled: Bool {\n        return logItemsCallsCount > 0\n    }\n    var logItemsReceivedItems: Any?\n    var logItemsClosure: ((Any) -> Void)?\n\n    override func logItems(_ items: Any...) {\n        logItemsCallsCount += 1\n        logItemsReceivedItems = items\n        logItemsClosure?(items)\n    }\n\n\n    //MARK: - onConnectionOpen\n\n    var onConnectionOpenCallsCount = 0\n    var onConnectionOpenCalled: Bool {\n        return onConnectionOpenCallsCount > 0\n    }\n    var onConnectionOpenClosure: (() -> Void)?\n\n    override func onConnectionOpen() {\n        onConnectionOpenCallsCount += 1\n        onConnectionOpenClosure?()\n    }\n\n\n    //MARK: - onConnectionClosed\n\n    var onConnectionClosedCodeReasonCallsCount = 0\n    var onConnectionClosedCodeReasonCalled: Bool {\n        return onConnectionClosedCodeReasonCallsCount > 0\n    }\n    var onConnectionClosedCodeReasonReceivedArguments: (code: Int, reason: String?)?\n    var onConnectionClosedCodeReasonClosure: ((Int, String?) -> Void)?\n\n    override func onConnectionClosed(code: Int, reason: String?) {\n        onConnectionClosedCodeReasonCallsCount += 1\n    onConnectionClosedCodeReasonReceivedArguments = (code: code, reason: reason)\n        onConnectionClosedCodeReasonClosure?(code, reason)\n    }\n\n\n    //MARK: - onConnectionError\n\n    var onConnectionErrorResponseCallsCount = 0\n    var onConnectionErrorResponseCalled: Bool {\n        return onConnectionErrorResponseCallsCount > 0\n    }\n    var onConnectionErrorResponseReceivedArguments: (error: Error, response: URLResponse?)?\n    var onConnectionErrorResponseClosure: ((Error, URLResponse?) -> Void)?\n\n    override func onConnectionError(_ error: Error, response: URLResponse?) {\n        onConnectionErrorResponseCallsCount += 1\n    onConnectionErrorResponseReceivedArguments = (error: error, response: response)\n        onConnectionErrorResponseClosure?(error, response)\n    }\n\n\n    //MARK: - onConnectionMessage\n\n    var onConnectionMessageCallsCount = 0\n    var onConnectionMessageCalled: Bool {\n        return onConnectionMessageCallsCount > 0\n    }\n    var onConnectionMessageReceivedRawMessage: String?\n    var onConnectionMessageClosure: ((String) -> Void)?\n\n    override func onConnectionMessage(_ rawMessage: String) {\n        onConnectionMessageCallsCount += 1\n        onConnectionMessageReceivedRawMessage = rawMessage\n        onConnectionMessageClosure?(rawMessage)\n    }\n\n\n    //MARK: - triggerChannelError\n\n    var triggerChannelErrorCallsCount = 0\n    var triggerChannelErrorCalled: Bool {\n        return triggerChannelErrorCallsCount > 0\n    }\n    var triggerChannelErrorClosure: (() -> Void)?\n\n    override func triggerChannelError() {\n        triggerChannelErrorCallsCount += 1\n        triggerChannelErrorClosure?()\n    }\n\n\n    //MARK: - flushSendBuffer\n\n    var flushSendBufferCallsCount = 0\n    var flushSendBufferCalled: Bool {\n        return flushSendBufferCallsCount > 0\n    }\n    var flushSendBufferClosure: (() -> Void)?\n\n    override func flushSendBuffer() {\n        flushSendBufferCallsCount += 1\n        flushSendBufferClosure?()\n    }\n\n\n    //MARK: - removeFromSendBuffer\n\n    var removeFromSendBufferRefCallsCount = 0\n    var removeFromSendBufferRefCalled: Bool {\n        return removeFromSendBufferRefCallsCount > 0\n    }\n    var removeFromSendBufferRefReceivedRef: String?\n    var removeFromSendBufferRefClosure: ((String) -> Void)?\n\n    override func removeFromSendBuffer(ref: String) {\n        removeFromSendBufferRefCallsCount += 1\n        removeFromSendBufferRefReceivedRef = ref\n        removeFromSendBufferRefClosure?(ref)\n    }\n\n\n    //MARK: - leaveOpenTopic\n\n    var leaveOpenTopicTopicCallsCount = 0\n    var leaveOpenTopicTopicCalled: Bool {\n        return leaveOpenTopicTopicCallsCount > 0\n    }\n    var leaveOpenTopicTopicReceivedTopic: String?\n    var leaveOpenTopicTopicClosure: ((String) -> Void)?\n\n    override func leaveOpenTopic(topic: String) {\n        leaveOpenTopicTopicCallsCount += 1\n        leaveOpenTopicTopicReceivedTopic = topic\n        leaveOpenTopicTopicClosure?(topic)\n    }\n\n\n    //MARK: - resetHeartbeat\n\n    var resetHeartbeatCallsCount = 0\n    var resetHeartbeatCalled: Bool {\n        return resetHeartbeatCallsCount > 0\n    }\n    var resetHeartbeatClosure: (() -> Void)?\n\n    override func resetHeartbeat() {\n        resetHeartbeatCallsCount += 1\n        resetHeartbeatClosure?()\n    }\n\n\n    //MARK: - sendHeartbeat\n\n    var sendHeartbeatCallsCount = 0\n    var sendHeartbeatCalled: Bool {\n        return sendHeartbeatCallsCount > 0\n    }\n    var sendHeartbeatClosure: (() -> Void)?\n\n    override func sendHeartbeat() {\n        sendHeartbeatCallsCount += 1\n        sendHeartbeatClosure?()\n    }\n\n\n    //MARK: - abnormalClose\n\n    var abnormalCloseCallsCount = 0\n    var abnormalCloseCalled: Bool {\n        return abnormalCloseCallsCount > 0\n    }\n    var abnormalCloseReceivedReason: String?\n    var abnormalCloseClosure: ((String) -> Void)?\n\n    override func abnormalClose(_ reason: String) {\n        abnormalCloseCallsCount += 1\n        abnormalCloseReceivedReason = reason\n        abnormalCloseClosure?(reason)\n    }\n\n\n    //MARK: - onOpen\n\n    var onOpenCallsCount = 0\n    var onOpenCalled: Bool {\n        return onOpenCallsCount > 0\n    }\n    var onOpenClosure: (() -> Void)?\n\n    override func onOpen() {\n        onOpenCallsCount += 1\n        onOpenClosure?()\n    }\n\n\n    //MARK: - onError\n\n    var onErrorErrorResponseCallsCount = 0\n    var onErrorErrorResponseCalled: Bool {\n        return onErrorErrorResponseCallsCount > 0\n    }\n    var onErrorErrorResponseReceivedArguments: (error: Error, response: URLResponse?)?\n    var onErrorErrorResponseClosure: ((Error, URLResponse?) -> Void)?\n\n    override func onError(error: Error, response: URLResponse?) {\n        onErrorErrorResponseCallsCount += 1\n    onErrorErrorResponseReceivedArguments = (error: error, response: response)\n        onErrorErrorResponseClosure?(error, response)\n    }\n\n\n    //MARK: - onMessage\n\n    var onMessageMessageCallsCount = 0\n    var onMessageMessageCalled: Bool {\n        return onMessageMessageCallsCount > 0\n    }\n    var onMessageMessageReceivedMessage: String?\n    var onMessageMessageClosure: ((String) -> Void)?\n\n    override func onMessage(message: String) {\n        onMessageMessageCallsCount += 1\n        onMessageMessageReceivedMessage = message\n        onMessageMessageClosure?(message)\n    }\n\n\n    //MARK: - onClose\n\n    var onCloseCodeReasonCallsCount = 0\n    var onCloseCodeReasonCalled: Bool {\n        return onCloseCodeReasonCallsCount > 0\n    }\n    var onCloseCodeReasonReceivedArguments: (code: Int, reason: String?)?\n    var onCloseCodeReasonClosure: ((Int, String?) -> Void)?\n\n    override func onClose(code: Int, reason: String? = nil) {\n        onCloseCodeReasonCallsCount += 1\n    onCloseCodeReasonReceivedArguments = (code: code, reason: reason)\n        onCloseCodeReasonClosure?(code, reason)\n    }\n\n\n}\nclass TimeoutTimerMock: TimeoutTimer {\n    override var callback: Delegated<(), Void> {\n        get { return underlyingCallback }\n        set(value) { underlyingCallback = value }\n    }\n    var underlyingCallback: (Delegated<(), Void>)!\n    override var timerCalculation: Delegated<Int, TimeInterval> {\n        get { return underlyingTimerCalculation }\n        set(value) { underlyingTimerCalculation = value }\n    }\n    var underlyingTimerCalculation: (Delegated<Int, TimeInterval>)!\n    var workItemSetCount: Int = 0\n    var workItemDidGetSet: Bool { return workItemSetCount > 0 }\n    override var workItem: DispatchWorkItem? {\n        didSet { workItemSetCount += 1 }\n    }\n    override var tries: Int {\n        get { return underlyingTries }\n        set(value) { underlyingTries = value }\n    }\n    var underlyingTries: (Int)!\n    override var queue: TimerQueue {\n        get { return underlyingQueue }\n        set(value) { underlyingQueue = value }\n    }\n    var underlyingQueue: (TimerQueue)!\n\n\n    //MARK: - reset\n\n    var resetCallsCount = 0\n    var resetCalled: Bool {\n        return resetCallsCount > 0\n    }\n    var resetClosure: (() -> Void)?\n\n    override func reset() {\n        resetCallsCount += 1\n        resetClosure?()\n    }\n\n\n    //MARK: - scheduleTimeout\n\n    var scheduleTimeoutCallsCount = 0\n    var scheduleTimeoutCalled: Bool {\n        return scheduleTimeoutCallsCount > 0\n    }\n    var scheduleTimeoutClosure: (() -> Void)?\n\n    override func scheduleTimeout() {\n        scheduleTimeoutCallsCount += 1\n        scheduleTimeoutClosure?()\n    }\n\n\n}\n"
  },
  {
    "path": "Tests/Mocks/MockableProtocol.generated.swift",
    "content": "// Generated using Sourcery 1.0.2 — https://github.com/krzysztofzablocki/Sourcery\n// DO NOT EDIT\n\n// swiftlint:disable line_length\n// swiftlint:disable variable_name\n\nimport Foundation\n#if os(iOS) || os(tvOS) || os(watchOS)\nimport UIKit\n#elseif os(OSX)\nimport AppKit\n#endif\n\n@testable import SwiftPhoenixClient\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass PhoenixTransportMock: PhoenixTransport {\n    var readyState: PhoenixTransportReadyState {\n        get { return underlyingReadyState }\n        set(value) { underlyingReadyState = value }\n    }\n    var underlyingReadyState: PhoenixTransportReadyState!\n    var delegate: PhoenixTransportDelegate?\n\n    //MARK: - connect\n\n    var connectCallsCount = 0\n    var connectCalled: Bool {\n        return connectCallsCount > 0\n    }\n    var connectClosure: (() -> Void)?\n\n    func connect() {\n        connectCallsCount += 1\n        connectClosure?()\n    }\n\n    //MARK: - disconnect\n\n    var disconnectCodeReasonCallsCount = 0\n    var disconnectCodeReasonCalled: Bool {\n        return disconnectCodeReasonCallsCount > 0\n    }\n    var disconnectCodeReasonReceivedArguments: (code: Int, reason: String?)?\n    var disconnectCodeReasonReceivedInvocations: [(code: Int, reason: String?)] = []\n    var disconnectCodeReasonClosure: ((Int, String?) -> Void)?\n\n    func disconnect(code: Int, reason: String?) {\n        disconnectCodeReasonCallsCount += 1\n        disconnectCodeReasonReceivedArguments = (code: code, reason: reason)\n        disconnectCodeReasonReceivedInvocations.append((code: code, reason: reason))\n        disconnectCodeReasonClosure?(code, reason)\n    }\n\n    //MARK: - send\n\n    var sendDataCallsCount = 0\n    var sendDataCalled: Bool {\n        return sendDataCallsCount > 0\n    }\n    var sendDataReceivedData: Data?\n    var sendDataReceivedInvocations: [Data] = []\n    var sendDataClosure: ((Data) -> Void)?\n\n    func send(data: Data) {\n        sendDataCallsCount += 1\n        sendDataReceivedData = data\n        sendDataReceivedInvocations.append(data)\n        sendDataClosure?(data)\n    }\n\n}\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/ChannelSpec.swift",
    "content": "//\n//  ChannelSpec.swift\n//  SwiftPhoenixClient\n//\n//  Created by Daniel Rees on 5/18/18.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\n\nclass ChannelSpec: QuickSpec {\n  \n  override func spec() {\n    \n    // Mocks\n    var mockClient: PhoenixTransportMock!\n    var mockSocket: SocketMock!\n    \n    // Constants\n    let kDefaultRef = \"1\"\n    let kDefaultTimeout: TimeInterval = 10.0\n    \n    // Clock\n    var fakeClock: FakeTimerQueue!\n    \n    // UUT\n    var channel: Channel!\n    \n    \n    /// Utility method to easily filter the bindings for a channel by their event\n    func getBindings(_ event: String) -> [Binding]? {\n      return channel.syncBindingsDel.filter({ $0.event == event })\n    }\n    \n    \n    beforeEach {\n      // Any TimeoutTimer that is created will receive the fake clock\n      // when scheduling work items\n      fakeClock = FakeTimerQueue()\n      TimerQueue.main = fakeClock\n      \n      mockClient = PhoenixTransportMock()\n      \n      mockSocket = SocketMock(endPoint: \"/socket\", transport: { _ in mockClient })\n      mockSocket.connection = mockClient\n      mockSocket.timeout = kDefaultTimeout\n      mockSocket.makeRefReturnValue = kDefaultRef\n      mockSocket.reconnectAfter = { tries -> TimeInterval in\n        return tries > 3 ? 10 : [1, 2, 5, 10][tries - 1]\n      }\n    \n      mockSocket.rejoinAfter = Defaults.rejoinSteppedBackOff\n        \n      \n      channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: mockSocket)\n      mockSocket.channelParamsReturnValue = channel\n    }\n    \n    afterEach {\n      fakeClock.reset()\n    }\n    \n    describe(\"constructor\") {\n      it(\"sets defaults\", closure: {\n        channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: mockSocket)\n        \n        expect(channel.state).to(equal(ChannelState.closed))\n        expect(channel.topic).to(equal(\"topic\"))\n        expect(channel.params[\"one\"] as? String).to(equal(\"two\"))\n        expect(channel.socket === mockSocket).to(beTrue())\n        expect(channel.timeout).to(equal(10))\n        expect(channel.joinedOnce).to(beFalse())\n        expect(channel.joinPush).toNot(beNil())\n        expect(channel.pushBuffer).to(beEmpty())\n      })\n      \n      it(\"sets up joinPush with literal params\", closure: {\n        channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: mockSocket)\n        let joinPush = channel.joinPush\n        \n        expect(joinPush?.channel === channel).to(beTrue())\n        expect(joinPush?.payload[\"one\"] as? String).to(equal(\"two\"))\n        expect(joinPush?.event).to(equal(\"phx_join\"))\n        expect(joinPush?.timeout).to(equal(10))\n      })\n      \n      it(\"should not introduce any retain cycles\", closure: {\n        weak var weakChannel = Channel(topic: \"topic\",\n                                       params: [\"one\": 2],\n                                       socket: mockSocket)\n        expect(weakChannel).to(beNil())\n      })\n    }\n    \n    describe(\"onMessage\") {\n      it(\"returns message by default\", closure: {\n        let message = channel.onMessage(Message(ref: \"original\"))\n        expect(message.ref).to(equal(\"original\"))\n      })\n      \n      it(\"can be overridden\", closure: {\n        channel.onMessage = { message in\n          return Message(ref: \"modified\")\n        }\n        \n        let message = channel.onMessage(Message(ref: \"original\"))\n        expect(message.ref).to(equal(\"modified\"))\n      })\n    }\n    \n    describe(\"updating join params\") {\n      it(\"can update join params\", closure: {\n        let params: Payload = [\"value\": 1]\n        let change: Payload = [\"value\": 2]\n        \n        channel = Channel(topic: \"topic\", params: params, socket: mockSocket)\n        let joinPush = channel.joinPush\n        \n        expect(joinPush?.channel === channel).to(beTrue())\n        expect(joinPush?.payload[\"value\"] as? Int).to(equal(1))\n        expect(joinPush?.event).to(equal(ChannelEvent.join))\n        expect(joinPush?.timeout).to(equal(10))\n        \n        channel.params = change\n        \n        expect(joinPush?.channel === channel).to(beTrue())\n        expect(joinPush?.payload[\"value\"] as? Int).to(equal(2))\n        expect(channel?.params[\"value\"] as? Int).to(equal(2))\n        expect(joinPush?.event).to(equal(ChannelEvent.join))\n        expect(joinPush?.timeout).to(equal(10))\n      })\n    }\n    \n    \n    describe(\"join\") {\n      it(\"sets state to joining\", closure: {\n        channel.join()\n        expect(channel.state.rawValue).to(equal(\"joining\"))\n      })\n      \n      it(\"sets joinedOnce to true\", closure: {\n        expect(channel.joinedOnce).to(beFalse())\n        \n        channel.join()\n        expect(channel.joinedOnce).to(beTrue())\n      })\n      \n      it(\"throws if attempting to join multiple times\", closure: {\n        channel.join()\n        \n        // Method is not marked to throw\n        expect { channel.join() }.to(throwAssertion())\n      })\n      \n      it(\"triggers socket push with channel params\", closure: {\n        channel.join()\n        \n        expect(mockSocket.pushTopicEventPayloadRefJoinRefCalled).to(beTrue())\n        \n        let args = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args?.topic).to(equal(\"topic\"))\n        expect(args?.event).to(equal(\"phx_join\"))\n        expect(args?.payload[\"one\"] as? String).to(equal(\"two\"))\n        expect(args?.ref).to(equal(kDefaultRef))\n        expect(args?.joinRef).to(equal(channel.joinRef))\n      })\n      \n      it(\"can set timeout on joinPush\", closure: {\n        let newTimeout: TimeInterval = 2.0\n        let joinPush = channel.joinPush\n        \n        expect(joinPush?.timeout).to(equal(kDefaultTimeout))\n        \n        let _ = channel.join(timeout: newTimeout)\n        expect(joinPush?.timeout).to(equal(newTimeout))\n      })\n      \n      it(\"leaves existing duplicate topic on new join\") {\n        let transport: ((URL) -> PhoenixTransport) = { _ in return mockClient }\n        let spySocket = SocketSpy(endPoint: \"/socket\", transport: transport)\n        let channel = spySocket.channel(\"topic\", params: [\"one\": \"two\"])\n        \n        mockClient.readyState = .open\n        spySocket.onConnectionOpen()\n        \n        channel.join()\n          .receive(\"ok\") { (message) in\n            let newChannel = spySocket.channel(\"topic\")\n            expect(channel.isJoined).to(beTrue())\n            newChannel.join()\n            \n            expect(channel.isJoined).to(beFalse())\n          }\n        \n        channel.joinPush.trigger(\"ok\", payload: [:])\n      }\n    }\n    \n    \n    describe(\"timeout behavior\") {\n      \n      var spySocket: SocketSpy!\n      var joinPush: Push!\n      var timeout: TimeInterval!\n      \n      func receiveSocketOpen() {\n        mockClient.readyState = .open\n        spySocket.onConnectionOpen()\n      }\n      \n      beforeEach {\n        mockClient.readyState = .closed\n        let transport: ((URL) -> PhoenixTransport) = { _ in return mockClient }\n        spySocket = SocketSpy(endPoint: \"/socket\", transport: transport)\n        channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: spySocket)\n        \n        joinPush = channel.joinPush\n        timeout = joinPush.timeout\n      }\n      \n      it(\"succeeds before timeout\", closure: {\n        spySocket.connect()\n        receiveSocketOpen()\n        \n        channel.join()\n        expect(spySocket.pushCalled).to(beTrue())\n        expect(channel.timeout).to(equal(10.0))\n\n        fakeClock.tick(0.100)\n        joinPush.trigger(\"ok\", payload: [:])\n        expect(channel.state).to(equal(.joined))\n        \n        fakeClock.tick(timeout)\n        expect(spySocket.pushCallCount).to(equal(1))\n      })\n      \n      it(\"retries with backoff after timeout\", closure: {\n        spySocket.connect()\n        receiveSocketOpen()\n        \n        var timeoutCallCount = 0\n        channel.join().receive(\"timeout\", callback: { (_) in\n          timeoutCallCount += 1\n        })\n        \n        expect(spySocket.pushCallCount).to(equal(1))\n        expect(spySocket.pushArgs[1]?.event).to(equal(\"phx_join\"))\n        expect(timeoutCallCount).to(equal(0))\n        \n        fakeClock.tick(timeout) // leave pushed to server\n        expect(spySocket.pushCallCount).to(equal(2))\n        expect(spySocket.pushArgs[2]?.event).to(equal(\"phx_leave\"))\n        expect(timeoutCallCount).to(equal(1))\n        \n        fakeClock.tick(timeout + 1) // rejoin\n        expect(spySocket.pushCallCount).to(equal(4))\n        expect(spySocket.pushArgs[3]?.event).to(equal(\"phx_join\"))\n        expect(spySocket.pushArgs[4]?.event).to(equal(\"phx_leave\"))\n        expect(timeoutCallCount).to(equal(2))\n        \n        fakeClock.tick(10)\n        joinPush.trigger(\"ok\", payload: [:])\n        expect(spySocket.pushCallCount).to(equal(5))\n        expect(spySocket.pushArgs[5]?.event).to(equal(\"phx_join\"))\n        expect(channel.state).to(equal(.joined))\n      })\n\n      it(\"with socket and join delay\", closure: {\n        channel.join()\n        expect(spySocket.pushCallCount).to(equal(1))\n\n        // Open the socket after a delay\n        fakeClock.tick(9.0)\n        expect(spySocket.pushCallCount).to(equal(1))\n        \n        // join request returns between timeouts\n        fakeClock.tick(1.0)\n        spySocket.connect()\n        \n        expect(channel.state).to(equal(.errored))\n        receiveSocketOpen()\n        joinPush.trigger(\"ok\", payload: [:])\n        \n        fakeClock.tick(1.0)\n        expect(channel.state).to(equal(.joined))\n        expect(spySocket.pushCallCount).to(equal(3))\n      })\n\n      it(\"with socket delay only\", closure: {\n        channel.join()\n        expect(channel.state).to(equal(.joining))\n        \n        // connect socket after a delay\n        fakeClock.tick(6.0)\n        spySocket.connect()\n        \n        // open Socket after delay\n        fakeClock.tick(5.0)\n        receiveSocketOpen()\n        joinPush.trigger(\"ok\", payload: [:])\n        \n        joinPush.trigger(\"ok\", payload: [:])\n        expect(channel.state).to(equal(.joined))\n      })\n    }\n    \n    describe(\"joinPush\") {\n      var spySocket: SocketSpy!\n      var joinPush: Push!\n      \n      beforeEach {\n        mockClient.readyState = .open\n        spySocket = SocketSpy(endPoint: \"/socket\",\n                              transport: { _ in return mockClient })\n        spySocket.connect()\n        \n        channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: spySocket)\n        joinPush = channel.joinPush\n        \n        channel.join()\n      }\n      \n      func receivesOk() {\n        fakeClock.tick(joinPush.timeout / 2)\n        joinPush.trigger(\"ok\", payload: [\"a\": \"b\"])\n      }\n      \n      func receivesTimeout() {\n        fakeClock.tick(joinPush.timeout * 2)\n      }\n      \n      func receiveError() {\n        fakeClock.tick(joinPush.timeout / 2)\n        joinPush.trigger(\"error\", payload: [\"a\": \"b\"])\n      }\n      \n      \n      describe(\"receives 'ok'\", {\n        it(\"sets channel state to joined\", closure: {\n          expect(channel.state).toNot(equal(.joined))\n          \n          receivesOk()\n          expect(channel.state).to(equal(.joined))\n        })\n        \n        it(\"triggers receive(ok) callback after ok response\", closure: {\n          var callbackCallCount: Int = 0\n          joinPush.receive(\"ok\", callback: {_ in callbackCallCount += 1})\n          \n          receivesOk()\n          expect(callbackCallCount).to(equal(1))\n        })\n        \n        it(\"triggers receive('ok') callback if ok response already received\", closure: {\n          receivesOk()\n          \n          var callbackCallCount: Int = 0\n          joinPush.receive(\"ok\", callback: {_ in callbackCallCount += 1})\n          \n          expect(callbackCallCount).to(equal(1))\n        })\n        \n        it(\"does not trigger other receive callbacks after ok response\", closure: {\n          var callbackCallCount: Int = 0\n          joinPush\n            .receive(\"error\", callback: {_ in callbackCallCount += 1})\n            .receive(\"timeout\", callback: {_ in callbackCallCount += 1})\n          \n          receivesOk()\n          receivesTimeout()\n          \n          expect(callbackCallCount).to(equal(0))\n          \n        })\n        \n        it(\"clears timeoutTimer workItem\", closure: {\n          expect(joinPush.timeoutWorkItem).toNot(beNil())\n          \n          receivesOk()\n          expect(joinPush.timeoutWorkItem).to(beNil())\n        })\n        \n        it(\"sets receivedMessage\", closure: {\n          expect(joinPush.receivedMessage).to(beNil())\n          \n          receivesOk()\n          expect(joinPush.receivedMessage).toNot(beNil())\n          expect(joinPush.receivedMessage?.status).to(equal(\"ok\"))\n          expect(joinPush.receivedMessage?.payload[\"a\"] as? String).to(equal(\"b\"))\n        })\n        \n        it(\"removes channel binding\", closure: {\n          var bindings = getBindings(\"chan_reply_3\")\n          expect(bindings).to(haveCount(1))\n          \n          receivesOk()\n          bindings = getBindings(\"chan_reply_3\")\n          expect(bindings).to(haveCount(0))\n        })\n        \n        it(\"sets channel state to joined\", closure: {\n          receivesOk()\n          expect(channel.state).to(equal(.joined))\n        })\n        \n        it(\"resets channel rejoinTimer\", closure: {\n          let mockRejoinTimer = TimeoutTimerMock()\n          channel.rejoinTimer = mockRejoinTimer\n          \n          receivesOk()\n          expect(mockRejoinTimer.resetCallsCount).to(equal(1))\n        })\n        \n        it(\"sends and empties channel's buffered pushEvents\", closure: {\n          let mockPush = PushMock(channel: channel, event: \"new:msg\")\n          channel.pushBuffer.append(mockPush)\n          \n          receivesOk()\n          expect(mockPush.sendCalled).to(beTrue())\n          expect(channel.pushBuffer).to(haveCount(0))\n        })\n      })\n      \n      describe(\"receives 'timeout'\", {\n        it(\"sets channel state to errored\", closure: {\n          var timeoutReceived = false\n          joinPush.receive(\"timeout\", callback: { (_) in\n            timeoutReceived = true\n            expect(channel.state).to(equal(.errored))\n          })\n        \n          receivesTimeout()\n          expect(timeoutReceived).to(beTrue())\n        })\n        \n        it(\"triggers receive('timeout') callback after ok response\", closure: {\n          var receiveTimeoutCallCount = 0\n          joinPush.receive(\"timeout\", callback: { (_) in\n            receiveTimeoutCallCount += 1\n          })\n          \n          receivesTimeout()\n          expect(receiveTimeoutCallCount).to(equal(1))\n        })\n        \n        it(\"does not trigger other receive callbacks after timeout response\", closure: {\n          var receiveOkCallCount = 0\n          var receiveErrorCallCount = 0\n          var timeoutReceived = false\n          \n          joinPush\n            .receive(\"ok\") {_ in receiveOkCallCount += 1 }\n            .receive(\"error\") {_ in receiveErrorCallCount += 1 }\n            .receive(\"timeout\", callback: { (_) in\n              expect(receiveOkCallCount).to(equal(0))\n              expect(receiveErrorCallCount).to(equal(0))\n              timeoutReceived = true\n            })\n          \n          receivesTimeout()\n          receivesOk()\n          \n          expect(timeoutReceived).to(beTrue())\n        })\n        \n        it(\"schedules rejoinTimer timeout\", closure: {\n          let mockRejoinTimer = TimeoutTimerMock()\n          channel.rejoinTimer = mockRejoinTimer\n          \n          receivesTimeout()\n          expect(mockRejoinTimer.scheduleTimeoutCalled).to(beTrue())\n        })\n      })\n      \n      describe(\"receives `error`\", {\n        it(\"triggers receive('error') callback after error response\", closure: {\n          expect(channel.state).to(equal(.joining))\n\n          var errorCallsCount = 0\n          joinPush.receive(\"error\") { (_) in errorCallsCount += 1 }\n          \n          receiveError()\n          joinPush.trigger(\"error\", payload: [:])\n          expect(errorCallsCount).to(equal(1))\n        })\n        \n        it(\"triggers receive('error') callback if error response already received\", closure: {\n          receiveError()\n          \n          var errorCallsCount = 0\n          joinPush.receive(\"error\") { (_) in errorCallsCount += 1 }\n          \n          expect(errorCallsCount).to(equal(1))\n        })\n        \n        it(\"does not trigger other receive callbacks after ok response\", closure: {\n          var receiveOkCallCount = 0\n          var receiveTimeoutCallCount = 0\n          var receiveErrorCallCount = 0\n          joinPush\n            .receive(\"ok\") {_ in receiveOkCallCount += 1 }\n            .receive(\"error\", callback: { (_) in\n              receiveErrorCallCount += 1\n              channel.leave()\n            })\n            .receive(\"timeout\") {_ in receiveTimeoutCallCount += 1 }\n          \n          receiveError()\n          receivesTimeout()\n          \n          expect(receiveErrorCallCount).to(equal(1))\n          expect(receiveOkCallCount).to(equal(0))\n          expect(receiveTimeoutCallCount).to(equal(0))\n        })\n        \n        it(\"clears timeoutTimer workItem\", closure: {\n          expect(joinPush.timeoutWorkItem).toNot(beNil())\n          \n          receiveError()\n          expect(joinPush.timeoutWorkItem).to(beNil())\n        })\n        \n        it(\"sets receivedMessage\", closure: {\n          expect(joinPush.receivedMessage).to(beNil())\n          \n          receiveError()\n          expect(joinPush.receivedMessage).toNot(beNil())\n          expect(joinPush.receivedMessage?.status).to(equal(\"error\"))\n          expect(joinPush.receivedMessage?.payload[\"a\"] as? String).to(equal(\"b\"))\n        })\n        \n        it(\"removes channel binding\", closure: {\n          var bindings = getBindings(\"chan_reply_3\")\n          expect(bindings).to(haveCount(1))\n          \n          receiveError()\n          bindings = getBindings(\"chan_reply_3\")\n          expect(bindings).to(haveCount(0))\n        })\n        \n        it(\"does not sets channel state to joined\", closure: {\n          receiveError()\n          expect(channel.state).toNot(equal(.joined))\n        })\n        \n        it(\"does not trigger channel's buffered pushEvents\", closure: {\n          let mockPush = PushMock(channel: channel, event: \"new:msg\")\n          channel.pushBuffer.append(mockPush)\n          \n          receiveError()\n          expect(mockPush.sendCalled).to(beFalse())\n          expect(channel.pushBuffer).to(haveCount(1))\n        })\n      })\n    }\n    \n    describe(\"onError\") {\n      \n      var spySocket: SocketSpy!\n      var joinPush: Push!\n      \n      beforeEach {\n        mockClient.readyState = .open\n        spySocket = SocketSpy(endPoint: \"/socket\",\n                              transport: { _ in return mockClient })\n        spySocket.connect()\n        \n        channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: spySocket)\n        joinPush = channel.joinPush\n        \n        channel.join()\n        joinPush.trigger(\"ok\", payload: [:])\n      }\n      \n      \n      \n      it(\"does not trigger redundant errors during backoff\", closure: {\n        // Spy the channel's Join Push\n        let mockPush = PushMock(channel: channel, event: \"event\")\n        channel.joinPush = mockPush\n        \n        expect(mockPush.resendCalled).to(beFalse())\n        channel.trigger(event: ChannelEvent.error)\n        \n        fakeClock.tick(1.0)\n        expect(mockPush.resendCalled).to(beTrue())\n        expect(mockPush.resendCallsCount).to(equal(1))\n\n        channel.trigger(event: \"error\")\n        fakeClock.tick(1.0)\n        expect(mockPush.resendCallsCount).to(equal(1))\n      })\n      \n      describe(\"while joining\") {\n        \n        var mockPush: PushMock!\n        \n        beforeEach {\n          channel = Channel(topic: \"topic\", params: [\"one\": \"two\"], socket: mockSocket)\n          \n          // Spy the channel's Join Push\n          mockPush = PushMock(channel: channel, event: \"event\")\n          mockPush.ref = \"10\"\n          channel.joinPush = mockPush\n          channel.state = .joining\n        }\n        \n        it(\"removes the joinPush message from send buffer\") {\n          channel.trigger(event: ChannelEvent.error)\n          expect(mockSocket.removeFromSendBufferRefCalled).to(beTrue())\n          expect(mockSocket.removeFromSendBufferRefReceivedRef).to(equal(\"10\"))\n        }\n        \n        it(\"resets the joinPush\") {\n          channel.trigger(event: ChannelEvent.error)\n          expect(mockPush.resetCalled).to(beTrue())\n        }\n      }\n      \n      it(\"sets channel state to .errored\", closure: {\n        expect(channel.state).toNot(equal(.errored))\n        \n        channel.trigger(event: ChannelEvent.error)\n        expect(channel.state).to(equal(.errored))\n      })\n      \n      it(\"tries to rejoin with backoff\", closure: {\n        let mockRejoinTimer = TimeoutTimerMock()\n        channel.rejoinTimer = mockRejoinTimer\n        \n        channel.trigger(event: ChannelEvent.error)\n        expect(mockRejoinTimer.scheduleTimeoutCalled).to(beTrue())\n      })\n      \n      it(\"does not rejoin if channel leaving\", closure: {\n        channel.state = .leaving\n        \n        let mockPush = PushMock(channel: channel, event: \"event\")\n        channel.joinPush = mockPush\n        \n        spySocket.onConnectionError(TestError.stub, response: nil)\n        \n        fakeClock.tick(1.0)\n        expect(mockPush.sendCallsCount).to(equal(0))\n        \n        fakeClock.tick(2.0)\n        expect(mockPush.sendCallsCount).to(equal(0))\n        \n        expect(channel.state).to(equal(.leaving))\n      })\n      \n      it(\"does nothing if channel is closed\", closure: {\n        channel.state = .closed\n        \n        let mockPush = PushMock(channel: channel, event: \"event\")\n        channel.joinPush = mockPush\n        \n        spySocket.onConnectionError(TestError.stub, response: nil)\n        \n        fakeClock.tick(1.0)\n        expect(mockPush.sendCallsCount).to(equal(0))\n        \n        fakeClock.tick(2.0)\n        expect(mockPush.sendCallsCount).to(equal(0))\n        \n        expect(channel.state).to(equal(.closed))\n      })\n      \n      it(\"triggers additional callbacks\", closure: {\n        var onErrorCallCount = 0\n        channel.onError({ (_) in onErrorCallCount += 1 })\n        joinPush.trigger(\"ok\", payload: [:])\n        \n        expect(channel.state).to(equal(.joined))\n        expect(onErrorCallCount).to(equal(0))\n\n        channel.trigger(event: ChannelEvent.error)\n        expect(onErrorCallCount).to(equal(1))\n      })\n    }\n    \n    describe(\"onClose\") {\n      \n      beforeEach {\n        mockClient.readyState = .open\n        channel.join()\n      }\n      \n      it(\"sets state to closed\", closure: {\n        expect(channel.state).toNot(equal(.closed))\n        channel.trigger(event: ChannelEvent.close)\n        expect(channel.state).to(equal(.closed))\n      })\n      \n      it(\"does not rejoin\", closure: {\n        let mockJoinPush = PushMock(channel: channel, event: \"phx_join\")\n        channel.joinPush = mockJoinPush\n        \n        channel.trigger(event: ChannelEvent.close)\n        \n        fakeClock.tick(1.0)\n        expect(mockJoinPush.sendCalled).to(beFalse())\n        \n        fakeClock.tick(2.0)\n        expect(mockJoinPush.sendCalled).to(beFalse())\n      })\n      \n      it(\"resets the rejoin timer\", closure: {\n        let mockRejoinTimer = TimeoutTimerMock()\n        channel.rejoinTimer = mockRejoinTimer\n        \n        channel.trigger(event: ChannelEvent.close)\n        expect(mockRejoinTimer.resetCalled).to(beTrue())\n      })\n      \n      it(\"removes self from socket\", closure: {\n        channel.trigger(event: ChannelEvent.close)\n        expect(mockSocket.removeCalled).to(beTrue())\n        \n        let removedChannel = mockSocket.removeReceivedChannel\n        expect(removedChannel === channel).to(beTrue())\n      })\n      \n      it(\"triggers additional callbacks\", closure: {\n        var onCloseCallCount = 0\n        channel.onClose({ (_) in\n          onCloseCallCount += 1\n        })\n        \n        channel.trigger(event: ChannelEvent.close)\n        expect(onCloseCallCount).to(equal(1))\n      })\n    }\n    \n    describe(\"canPush\") {\n      it(\"returns true when socket connected and channel joined\", closure: {\n        channel.state = .joined\n        mockClient.readyState = .open\n        expect(channel.canPush).to(beTrue())\n      })\n      \n      it(\"otherwise returns false\", closure: {\n        channel.state = .joined\n        mockClient.readyState = .closed\n        expect(channel.canPush).to(beFalse())\n        \n        channel.state = .joining\n        mockClient.readyState = .open\n        expect(channel.canPush).to(beFalse())\n        \n        channel.state = .joining\n        mockClient.readyState = .closed\n        expect(channel.canPush).to(beFalse())\n      })\n    }\n    \n    describe(\"on\") {\n      beforeEach {\n        mockSocket.makeRefClosure = nil\n        mockSocket.makeRefReturnValue = kDefaultRef\n      }\n      \n      it(\"sets up callback for event\", closure: {\n        var onCallCount = 0\n        \n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        expect(onCallCount).to(equal(0))\n        \n        channel.on(\"event\", callback: { (_) in\n          onCallCount += 1\n        })\n        \n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        expect(onCallCount).to(equal(1))\n      })\n      \n      it(\"other event callbacks are ignored\", closure: {\n        var onCallCount = 0\n        let ignoredOnCallCount = 0\n        \n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        expect(ignoredOnCallCount).to(equal(0))\n        \n        channel.on(\"event\", callback: { (_) in\n          onCallCount += 1\n        })\n        \n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        expect(ignoredOnCallCount).to(equal(0))\n      })\n      \n      it(\"generates unique refs for callbacks \", closure: {\n        let ref1 = channel.on(\"event1\", callback: { _ in })\n        let ref2 = channel.on(\"event2\", callback: { _ in })\n        expect(ref1).toNot(equal(ref2))\n        expect(ref1 + 1).to(equal(ref2))\n        \n      })\n    }\n    \n    describe(\"off\") {\n      beforeEach {\n        mockSocket.makeRefClosure = nil\n        mockSocket.makeRefReturnValue = kDefaultRef\n      }\n      \n      it(\"removes all callbacks for event\", closure: {\n        var callCount1 = 0\n        var callCount2 = 0\n        var callCount3 = 0\n        \n        channel.on(\"event\", callback: { _ in callCount1 += 1})\n        channel.on(\"event\", callback: { _ in callCount2 += 1})\n        channel.on(\"other\", callback: { _ in callCount3 += 1})\n        \n        channel.off(\"event\")\n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        channel.trigger(event: \"other\", ref: kDefaultRef)\n        \n        expect(callCount1).to(equal(0))\n        expect(callCount2).to(equal(0))\n        expect(callCount3).to(equal(1))\n      })\n      \n      it(\"removes callback by ref\", closure: {\n        var callCount1 = 0\n        var callCount2 = 0\n        \n        let ref1 = channel.on(\"event\", callback: { _ in callCount1 += 1})\n        let _ = channel.on(\"event\", callback: { _ in callCount2 += 1})\n        \n        channel.off(\"event\", ref: ref1)\n        channel.trigger(event: \"event\", ref: kDefaultRef)\n        \n        expect(callCount1).to(equal(0))\n        expect(callCount2).to(equal(1))\n      })\n    }\n    \n    describe(\"push\") {\n      \n      beforeEach {\n        mockSocket.makeRefClosure = nil\n        mockSocket.makeRefReturnValue = kDefaultRef\n        mockClient.readyState = .open\n      }\n      \n      it(\"sends push event when successfully joined\", closure: {\n        channel.join().trigger(\"ok\", payload: [:])\n        channel.push(\"event\", payload: [\"foo\": \"bar\"])\n        \n        expect(mockSocket.pushTopicEventPayloadRefJoinRefCalled).to(beTrue())\n        let args = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args?.topic).to(equal(\"topic\"))\n        expect(args?.event).to(equal(\"event\"))\n        expect(args?.payload[\"foo\"] as? String).to(equal(\"bar\"))\n        expect(args?.joinRef).to(equal(channel.joinRef))\n        expect(args?.ref).to(equal(kDefaultRef))\n      })\n      \n      it(\"enqueues push event to be sent once join has succeeded\", closure: {\n        let joinPush = channel.join()\n        channel.push(\"event\", payload: [\"foo\": \"bar\"])\n        \n        let args = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args?.payload[\"foo\"]).to(beNil())\n        \n        fakeClock.tick(channel.timeout / 2)\n        joinPush.trigger(\"ok\", payload: [:])\n         \n        expect(mockSocket.pushTopicEventPayloadRefJoinRefCalled).to(beTrue())\n        let args2 = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args2?.payload[\"foo\"] as? String).to(equal(\"bar\"))\n      })\n      \n      it(\"does not push if channel join times out\", closure: {\n        let joinPush = channel.join()\n        channel.push(\"event\", payload: [\"foo\": \"bar\"])\n        \n        let args = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args?.payload[\"foo\"]).to(beNil())\n        \n        fakeClock.tick(channel.timeout * 2)\n        joinPush.trigger(\"ok\", payload: [:])\n        \n        expect(mockSocket.pushTopicEventPayloadRefJoinRefCalled).to(beTrue())\n        let args2 = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args2?.payload[\"foo\"]).to(beNil())\n      })\n      \n      it(\"uses channel timeout by default\", closure: {\n        channel.join().trigger(\"ok\", payload: [:])\n        \n        var timeoutCallsCount = 0\n        channel\n          .push(\"event\", payload: [\"foo\": \"bar\"])\n          .receive(\"timeout\", callback: { (_) in\n            timeoutCallsCount += 1\n          })\n        \n        fakeClock.tick(channel.timeout / 2)\n        expect(timeoutCallsCount).to(equal(0))\n        \n        fakeClock.tick(channel.timeout)\n        expect(timeoutCallsCount).to(equal(1))\n      })\n      \n      it(\"accepts timeout arg\", closure: {\n        channel.join().trigger(\"ok\", payload: [:])\n        \n        var timeoutCallsCount = 0\n        channel\n          .push(\"event\", payload: [\"foo\": \"bar\"], timeout: channel.timeout * 2)\n          .receive(\"timeout\", callback: { (_) in\n            timeoutCallsCount += 1\n          })\n        \n        fakeClock.tick(channel.timeout)\n        expect(timeoutCallsCount).to(equal(0))\n        \n        fakeClock.tick(channel.timeout * 2)\n        expect(timeoutCallsCount).to(equal(1))\n      })\n      \n      it(\"does not time out after receiving 'ok'\", closure: {\n        channel.join().trigger(\"ok\", payload: [:])\n        \n        var timeoutCallsCount = 0\n        let push = channel.push(\"event\", payload: [\"foo\": \"bar\"])\n        push.receive(\"timeout\", callback: { (_) in\n          timeoutCallsCount += 1\n        })\n        \n        fakeClock.tick(channel.timeout / 2)\n        expect(timeoutCallsCount).to(equal(0))\n        \n        push.trigger(\"ok\", payload: [:])\n        \n        fakeClock.tick(channel.timeout)\n        expect(timeoutCallsCount).to(equal(0))\n      })\n      \n      it(\"throws if channel has not been joined\", closure: {\n        expect { channel.push(\"event\", payload: [:]) }.to(throwAssertion())\n      })\n    }\n    \n    describe(\"leave\") {\n      beforeEach {\n        mockClient.readyState = .open\n        channel.join().trigger(\"ok\", payload: [:])\n      }\n      \n      it(\"unsubscribes from server events\", closure: {\n        mockSocket.makeRefClosure = nil\n        mockSocket.makeRefReturnValue = kDefaultRef\n        \n        let joinRef = channel.joinRef\n        channel.leave()\n        \n        expect(mockSocket.pushTopicEventPayloadRefJoinRefCalled).to(beTrue())\n        let args = mockSocket.pushTopicEventPayloadRefJoinRefReceivedArguments\n        expect(args?.topic).to(equal(\"topic\"))\n        expect(args?.event).to(equal(\"phx_leave\"))\n        expect(args?.payload).to(beEmpty())\n        expect(args?.joinRef).to(equal(joinRef))\n        expect(args?.ref).to(equal(kDefaultRef))\n      })\n      \n      it(\"closes channel on 'ok' from server\", closure: {\n        let socket = Socket(endPoint: \"/socket\", transport: { _ in return mockClient })\n        \n        let channel = socket.channel(\"topic\", params: [\"one\": \"two\"])\n        channel.join().trigger(\"ok\", payload: [:])\n        \n        let anotherChannel = socket.channel(\"another\", params: [\"three\": \"four\"])\n        \n        expect(socket.channels).to(haveCount(2))\n        \n        channel.leave().trigger(\"ok\", payload: [:])\n        expect(socket.channels).to(haveCount(1))\n        expect(socket.channels.first === anotherChannel).to(beTrue())\n      })\n    }\n    \n    \n    describe(\"isMemeber\") {\n      it(\"returns false if the message topic does not match the channel\") {\n        let message = Message(topic: \"other\")\n        expect(channel.isMember(message)).to(beFalse())\n      }\n\n      it(\"returns true if topics match but the message doesn't have a join ref\") {\n        let message = Message(topic: \"topic\", event: ChannelEvent.close, joinRef: nil)\n        expect(channel.isMember(message)).to(beTrue())\n      }\n      \n      it(\"returns true if topics and join refs match\") {\n        channel.joinPush.ref = \"2\"\n        let message = Message(topic: \"topic\", event: ChannelEvent.close, joinRef: \"2\")\n        expect(channel.isMember(message)).to(beTrue())\n      }\n      \n      it(\"returns true if topics and join refs match but event is not lifecycle\") {\n        channel.joinPush.ref = \"2\"\n        let message = Message(topic: \"topic\", event: \"event\", joinRef: \"2\")\n        expect(channel.isMember(message)).to(beTrue())\n      }\n      \n      it(\"returns false topics match and is a lifecycle event but join refs do not match \") {\n        channel.joinPush.ref = \"2\"\n        let message = Message(topic: \"topic\", event: ChannelEvent.close, joinRef: \"1\")\n        expect(channel.isMember(message)).to(beFalse())\n      }\n    }\n    \n    describe(\"isClosed\") {\n      it(\"returns true if state is .closed\", closure: {\n        channel.state = .joined\n        expect(channel.isClosed).to(beFalse())\n        \n        channel.state = .closed\n        expect(channel.isClosed).to(beTrue())\n      })\n    }\n    \n    describe(\"isErrored\") {\n      it(\"returns true if state is .errored\", closure: {\n        channel.state = .joined\n        expect(channel.isErrored).to(beFalse())\n        \n        channel.state = .errored\n        expect(channel.isErrored).to(beTrue())\n      })\n    }\n    \n    describe(\"isJoined\") {\n      it(\"returns true if state is .joined\", closure: {\n        channel.state = .leaving\n        expect(channel.isJoined).to(beFalse())\n        \n        channel.state = .joined\n        expect(channel.isJoined).to(beTrue())\n      })\n    }\n    \n    describe(\"isJoining\") {\n      it(\"returns true if state is .joining\", closure: {\n        channel.state = .joined\n        expect(channel.isJoining).to(beFalse())\n        \n        channel.state = .joining\n        expect(channel.isJoining).to(beTrue())\n      })\n    }\n    \n    describe(\"isLeaving\") {\n      it(\"returns true if state is .leaving\", closure: {\n        channel.state = .joined\n        expect(channel.isLeaving).to(beFalse())\n        \n        channel.state = .leaving\n        expect(channel.isLeaving).to(beTrue())\n      })\n    }\n    \n  }\n}\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/DefaultSerializerSpec.swift",
    "content": "//\n//  DefaultSerializerSpec.swift\n//  SwiftPhoenixClient\n//\n//  Created by Daniel Rees on 1/17/19.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\nclass DefaultSerializerSpec: QuickSpec {\n  \n  override func spec() {\n    describe(\"encode and decode message\") {\n      it(\"converts dictionary to Data and back to Message\", closure: {\n        let body: [Any] = [\"join_ref\", \"ref\", \"topic\", \"event\", [\"user_id\": \"abc123\"]]\n        let data = Defaults.encode(body)\n        expect(String(data: data, encoding: .utf8)).to(equal(\"[\\\"join_ref\\\",\\\"ref\\\",\\\"topic\\\",\\\"event\\\",{\\\"user_id\\\":\\\"abc123\\\"}]\"))\n        \n        let json = Defaults.decode(data) as? [Any]\n        \n        let message = Message(json: json!)\n        expect(message?.ref).to(equal(\"ref\"))\n        expect(message?.joinRef).to(equal(\"join_ref\"))\n        expect(message?.topic).to(equal(\"topic\"))\n        expect(message?.event).to(equal(\"event\"))\n        expect(message?.payload[\"user_id\"] as? String).to(equal(\"abc123\"))\n      })\n    }\n  }\n}\n\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/HeartbeatTimerSpec.swift",
    "content": "//\n//  HeartbeatTimerSpec.swift\n//  SwiftPhoenixClientTests\n//\n//  Created by Daniel Rees on 8/24/21.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\nclass HeartbeatTimerSpec: QuickSpec {\n    \n  override func spec() {\n    \n    let queue = DispatchQueue(label: \"heartbeat.timer.spec\")\n    var timer: HeartbeatTimer!\n    \n    \n    beforeEach {\n      timer = HeartbeatTimer(timeInterval: 10, queue: queue)\n    }\n    \n    describe(\"isValid\") {\n      it(\"returns false if is not started\") {\n        expect(timer.isValid).to(beFalse())\n      }\n      \n      it(\"returns true if the timer has started\") {\n        timer.start { /* no-op */ }\n        expect(timer.isValid).to(beTrue())\n      }\n      \n      it(\"returns false if timer has been stopped\") {\n        timer.start { /* no-op */ }\n        timer.stop()\n        expect(timer.isValid).to(beFalse())\n      }\n    }\n    \n    describe(\"fire\") {\n      it(\"calls the event handler\") {\n        var timerCalled = 0\n        timer.start { timerCalled += 1 }\n        expect(timerCalled).to(equal(0))\n        \n        timer.fire()\n        expect(timerCalled).to(equal(1))\n      }\n      \n      it(\"does not call event handler if stopped\") {\n        var timerCalled = 0\n        timer.start { timerCalled += 1 }\n        expect(timerCalled).to(equal(0))\n        \n        timer.stop()\n        timer.fire()\n        expect(timerCalled).to(equal(0))\n      }\n    }\n    \n    describe(\"equatable\") {\n      it(\"equates different timers correctly\", closure: {\n        let timerA = HeartbeatTimer(timeInterval: 10, queue: queue)\n        let timerB = HeartbeatTimer(timeInterval: 10, queue: queue)\n        \n        expect(timerA).to(equal(timerA))\n        expect(timerA).toNot(equal(timerB))\n        \n      })\n    }\n  }\n}\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/MessageSpec.swift",
    "content": "//\n//  MessageSpec.swift\n//  SwiftPhoenixClientTests\n//\n//  Created by Daniel Rees on 10/27/21.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\n\nclass MessageSpec: QuickSpec {\n  \n  override func spec() {\n    describe(\"json parsing\") {\n      \n      it(\"parses a normal message\") {\n        let json: [Any] = [\"2\", \"6\", \"my-topic\", \"update\", [\"user\": \"James S.\", \"message\": \"This is a test\"]]\n        \n        let message = Message(json: json)\n        expect(message?.ref).to(equal(\"6\"))\n        expect(message?.joinRef).to(equal(\"2\"))\n        expect(message?.topic).to(equal(\"my-topic\"))\n        expect(message?.event).to(equal(\"update\"))\n        expect(message?.payload[\"user\"] as? String).to(equal(\"James S.\"))\n        expect(message?.payload[\"message\"] as? String).to(equal(\"This is a test\"))\n        expect(message?.status).to(beNil())\n      }\n      \n      it(\"parses a reply\") {\n        let json: [Any] = [\"2\", \"6\", \"my-topic\", \"phx_reply\", [\"response\": [\"user\": \"James S.\", \"message\": \"This is a test\"], \"status\": \"ok\"]]\n        \n        let message = Message(json: json)\n        expect(message?.ref).to(equal(\"6\"))\n        expect(message?.joinRef).to(equal(\"2\"))\n        expect(message?.topic).to(equal(\"my-topic\"))\n        expect(message?.event).to(equal(\"phx_reply\"))\n        expect(message?.payload[\"user\"] as? String).to(equal(\"James S.\"))\n        expect(message?.payload[\"message\"] as? String).to(equal(\"This is a test\"))\n        expect(message?.status).to(equal(\"ok\"))\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/PresenceSpec.swift",
    "content": "//\n//  PresenceSpec.swift\n//  SwiftPhoenixClient\n//\n//  Created by Simon Bergström on 2018-10-03.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\nclass PresenceSpec: QuickSpec {\n  \n  override func spec() {\n    \n    /// Fixtures\n    let fixJoins: Presence.State = [\"u1\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1.2\"]]]]\n    let fixLeaves: Presence.State = [\"u2\": [\"metas\": [[\"id\":2, \"phx_ref\": \"2\"]]]]\n    let fixState: Presence.State = [\n      \"u1\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1\"]]],\n      \"u2\": [\"metas\": [[\"id\":2, \"phx_ref\": \"2\"]]],\n      \"u3\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]]]\n    ]\n    \n    let listByFirst: (_ key: String, _ presence: Presence.Map) -> Presence.Meta\n      = { key, pres in\n        return pres[\"metas\"]!.first!\n    }\n    \n    /// Mocks\n    var mockSocket: SocketMock!\n    var channel: Channel!\n    \n    /// UUT\n    var presence: Presence!\n    \n    beforeEach {\n      let mockTransport = PhoenixTransportMock()\n      mockSocket = SocketMock(endPoint: \"/socket\", transport: { _ in mockTransport })\n      mockSocket.timeout = 10.0\n      mockSocket.makeRefReturnValue = \"1\"\n      mockSocket.reconnectAfter = { _ in return 1 }\n      \n      channel = Channel(topic: \"topic\", params: [:], socket: mockSocket)\n      channel.joinPush.ref = \"1\"\n      \n      presence = Presence(channel: channel)\n    }\n    \n    \n    describe(\"init\") {\n      \n      it(\"sets defaults\", closure: {\n        expect(presence.state).to(beEmpty())\n        expect(presence.pendingDiffs).to(beEmpty())\n        expect(presence.channel === channel).to(beTrue())\n        expect(presence.joinRef).to(beNil())\n      })\n      \n      it(\"binds to channel with default options\", closure: {\n        expect(presence.channel?.getBindings(\"presence_state\")).to(haveCount(1))\n        expect(presence.channel?.getBindings(\"presence_diff\")).to(haveCount(1))\n      })\n      \n      it(\"binds to channel with custom options \", closure: {\n        let channel = Channel(topic: \"topic\", socket: mockSocket)\n        let customOptions\n          = Presence.Options(events: [.state: \"custom_state\",\n                                      .diff: \"custom_diff\"])\n        let p = Presence(channel: channel, opts: customOptions)\n        \n        expect(p.channel?.getBindings(\"presence_state\")).to(beEmpty())\n        expect(p.channel?.getBindings(\"presence_diff\")).to(beEmpty())\n        expect(p.channel?.getBindings(\"custom_state\")).to(haveCount(1))\n        expect(p.channel?.getBindings(\"custom_diff\")).to(haveCount(1))\n      })\n      \n      it(\"syncs state and diffs\", closure: {\n        let user1: Presence.Map = [\"metas\": [[\"id\": 1, \"phx_ref\": \"1\"]]]\n        let user2: Presence.Map = [\"metas\": [[\"id\": 2, \"phx_ref\": \"2\"]]]\n        let newState: Presence.State = [\"u1\": user1, \"u2\": user2]\n        \n        \n        channel.trigger(event: \"presence_state\",\n                        payload: newState,\n                        ref: \"1\")\n        let s = presence.list(by: listByFirst)\n        expect(s).to(haveCount(2))\n        // can't check values because maps are lazy\n        //                expect(s[0][\"id\"] as? Int).to(equal(1))\n        //                expect(s[0][\"phx_ref\"] as? String).to(equal(\"1\"))\n        //\n        //                expect(s[1][\"id\"] as? Int).to(equal(2))\n        //                expect(s[1][\"phx_ref\"] as? String).to(equal(\"2\"))\n        \n        channel.trigger(event: \"presence_diff\",\n                        payload: [\"joins\": [:], \"leaves\": [\"u1\": user1]],\n                        ref: \"2\")\n        \n        let l = presence.list(by: listByFirst)\n        expect(l).to(haveCount(1))\n        expect(l[0][\"id\"] as? Int).to(equal(2))\n        expect(l[0][\"phx_ref\"] as? String).to(equal(\"2\"))\n      })\n      \n      it(\"applies pending diff if state is not yet synced\", closure: {\n        var onJoins: [(id: String, current: Presence.Map?, new: Presence.Map)] = []\n        var onLeaves: [(id: String, current: Presence.Map, left: Presence.Map)] = []\n        \n        presence.onJoin({ (key, current, new) in\n          onJoins.append((key, current, new))\n        })\n        \n        presence.onLeave({ (key, current, left) in\n          onLeaves.append((key, current, left))\n        })\n        \n        let user1 = [\"metas\": [[\"id\": 1, \"phx_ref\": \"1\"]]]\n        let user2 = [\"metas\": [[\"id\": 2, \"phx_ref\": \"2\"]]]\n        let user3 = [\"metas\": [[\"id\": 3, \"phx_ref\": \"3\"]]]\n        \n        let newState = [\"u1\": user1, \"u2\": user2]\n        let leaves = [\"u2\": user2]\n        \n        let payload1 = [\"joins\": [:], \"leaves\": leaves]\n        channel.trigger(event: \"presence_diff\", payload: payload1, ref: \"\")\n        \n        // there is no state\n        expect(presence.list(by: listByFirst)).to(beEmpty())\n        \n        // pending diffs 1\n        expect(presence.pendingDiffs).to(haveCount(1))\n        expect(presence.pendingDiffs[0][\"joins\"]).to(beEmpty())\n        let t1 = transform(presence.pendingDiffs[0][\"leaves\"]!, and: leaves)\n        expect(t1.lhs).to(equal(t1.rhs))\n        \n        \n        channel.trigger(event: \"presence_state\", payload: newState, ref: \"\")\n        expect(onLeaves).to(haveCount(1))\n        expect(onLeaves[0].id).to(equal(\"u2\"))\n        expect(onLeaves[0].current[\"metas\"]).to(beEmpty())\n        expect(onLeaves[0].left[\"metas\"]?[0][\"id\"] as? Int).to(equal(2))\n        \n        \n        let s = presence.list(by: listByFirst)\n        expect(s).to(haveCount(1))\n        expect(s[0][\"id\"] as? Int).to(equal(1))\n        expect(s[0][\"phx_ref\"] as? String).to(equal(\"1\"))\n        expect(presence.pendingDiffs).to(beEmpty())\n        \n        expect(onJoins).to(haveCount(2))\n        // can't check values because maps are lazy\n        //                expect(onJoins[0].id).to(equal(\"u1\"))\n        //                expect(onJoins[0].current).to(beNil())\n        //                expect(onJoins[0].new[\"metas\"]?[0][\"id\"] as? Int).to(equal(1))\n        //\n        //                expect(onJoins[1].id).to(equal(\"u2\"))\n        //                expect(onJoins[1].current).to(beNil())\n        //                expect(onJoins[1].new[\"metas\"]?[0][\"id\"] as? Int).to(equal(2))\n        \n        \n        // disconnect then reconnect\n        expect(presence.isPendingSyncState).to(beFalse())\n        channel.joinPush.ref = \"2\"\n        expect(presence.isPendingSyncState).to(beTrue())\n        \n        \n        channel.trigger(event: \"presence_diff\",\n                        payload: [\"joins\": [:], \"leaves\": [\"u1\": user1]],\n                        ref: \"\")\n        let d = presence.list(by: listByFirst)\n        expect(d).to(haveCount(1))\n        expect(d[0][\"id\"] as? Int).to(equal(1))\n        expect(d[0][\"phx_ref\"] as? String).to(equal(\"1\"))\n        \n        channel.trigger(event: \"presence_state\",\n                        payload: [\"u1\": user1, \"u3\": user3],\n                        ref: \"\")\n        let s2 = presence.list(by: listByFirst)\n        expect(s2).to(haveCount(1))\n        expect(s2[0][\"id\"] as? Int).to(equal(3))\n        expect(s2[0][\"phx_ref\"] as? String).to(equal(\"3\"))\n        \n      })\n      \n      \n      it(\"allows custom states\", closure: {\n        let channel = Channel(topic: \"topic\", socket: mockSocket)\n        channel.joinPush.ref = \"1\"\n        let customOptions\n          = Presence.Options(events: [.state: \"the_state\",\n                                      .diff: \"the_diff\"])\n        let presence = Presence(channel: channel, opts: customOptions)\n        \n        \n        let user1: Presence.Map = [\"metas\": [[\"id\": 1, \"phx_ref\": \"1\"]]]\n        channel.trigger(event: \"the_state\", payload: [\"user1\": user1], ref: \"\")\n        \n        let s = presence.list(by: listByFirst)\n        expect(s).to(haveCount(1))\n        expect(s[0][\"id\"] as? Int).to(equal(1))\n        expect(s[0][\"phx_ref\"] as? String).to(equal(\"1\"))\n        \n        channel.trigger(event: \"the_diff\",\n                        payload: [\"joins\": [:], \"leaves\": [\"user1\": user1]],\n                        ref: \"2\")\n        \n        expect(presence.list(by: listByFirst)).to(beEmpty())\n      })\n    }\n    \n    \n    describe(\"syncState\") {\n      it(\"syncs empty state\", closure: {\n        let newState: Presence.State = [\"u1\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1\"]]]]\n        var state: Presence.State = [:]\n        let stateBefore = state\n        \n        Presence.syncState(state, newState: newState)\n        \n        let t1 = transform(state, and: stateBefore)\n        expect(t1.lhs).to(equal(t1.rhs))\n        \n        state = Presence.syncState(state, newState: newState)\n        let t2 = transform(state, and: newState)\n        expect(t2.lhs).to(equal(t2.rhs))\n      })\n      \n      it(\"onJoins new presences and onLeave's left presences\", closure: {\n        let newState = fixState\n        var state = [\"u4\": [\"metas\": [[\"id\":4, \"phx_ref\": \"4\"]]]]\n        var joined: Presence.Diff = [:]\n        var left: Presence.Diff = [:]\n        let onJoin: Presence.OnJoin = { key, current, newPres in\n          var state: Presence.State = [\"newPres\": newPres]\n          if let c = current {\n            state[\"current\"] = c\n          }\n          \n          // Diff = [String: Presence.State]\n          joined[key] = state\n        }\n        \n        let onLeave: Presence.OnLeave = { key, current, leftPres in\n          // Diff = [String: Presence.State]\n          left[key] = [\"current\": current, \"leftPres\": leftPres]\n        }\n        \n        let stateBefore = state\n        Presence.syncState(state, newState: newState,\n                           onJoin: onJoin, onLeave: onLeave)\n        let t1 = transform(state, and: stateBefore)\n        expect(t1.lhs).to(equal(t1.rhs))\n        \n        state = Presence.syncState(state, newState: newState,\n                                   onJoin: onJoin, onLeave: onLeave)\n        let t2 = transform(state, and: newState)\n        expect(t2.lhs).to(equal(t2.rhs))\n        \n        // assert equality in joined\n        let joinedExpectation: Presence.Diff = [\n          \"u1\": [\"newPres\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1\"]] ]],\n          \"u2\": [\"newPres\": [\"metas\": [[\"id\":2, \"phx_ref\": \"2\"]] ]],\n          \"u3\": [\"newPres\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]] ]]\n        ]\n        let tJoin = transform(joined, and: joinedExpectation)\n        expect(tJoin.lhs).to(equal(tJoin.rhs))\n        \n        // assert equality in left\n        let leftExpectation: Presence.Diff = [\"u4\": [\n          \"current\": [\"metas\": [] ],\n          \"leftPres\": [\"metas\": [[\"id\":4, \"phx_ref\": \"4\"]] ]\n          ] ]\n        let tLeft = transform(left, and: leftExpectation)\n        expect(tLeft.lhs).to(equal(tLeft.rhs))\n      })\n      \n      \n      it(\"onJoins only newly added metas\", closure: {\n        var state = [\"u3\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]]]]\n        let newState = [\"u3\": [\n          \"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.new\"]]\n          ]]\n        \n        var joined: Presence.Diff = [:]\n        var left: Presence.Diff = [:]\n        let onJoin: Presence.OnJoin = { key, current, newPres in\n          var state: Presence.State = [\"newPres\": newPres]\n          if let c = current {\n            state[\"current\"] = c\n          }\n          \n          // Diff = [String: Presence.State]\n          joined[key] = state\n        }\n        \n        let onLeave: Presence.OnLeave = { key, current, leftPres in\n          // Diff = [String: Presence.State]\n          left[key] = [\"current\": current, \"leftPres\": leftPres]\n        }\n        \n        state = Presence.syncState(state, newState: newState,\n                                   onJoin: onJoin, onLeave: onLeave)\n        let t2 = transform(state, and: newState)\n        expect(t2.lhs).to(equal(t2.rhs))\n        \n        // assert equality in joined\n        let joinedExpectation: Presence.Diff = [\n          \"u3\": [\"current\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]] ],\n                 \"newPres\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3.new\"]] ]\n          ]\n        ]\n        \n        let tJoin = transform(joined, and: joinedExpectation)\n        expect(tJoin.lhs).to(equal(tJoin.rhs))\n        \n        // assert equality in left\n        expect(left).to(beEmpty())\n      })\n      \n      it(\"onLeaves only newly removed metas\", closure: {\n        let newState = [\"u3\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]]]]\n        var state = [\"u3\": [\n          \"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.left\"]]\n          ]]\n        \n        var joined: Presence.Diff = [:]\n        var left: Presence.Diff = [:]\n        let onJoin: Presence.OnJoin = { key, current, newPres in\n          var state: Presence.State = [\"newPres\": newPres]\n          if let c = current {\n            state[\"current\"] = c\n          }\n          \n          // Diff = [String: Presence.State]\n          joined[key] = state\n        }\n        \n        let onLeave: Presence.OnLeave = { key, current, leftPres in\n          // Diff = [String: Presence.State]\n          left[key] = [\"current\": current, \"leftPres\": leftPres]\n        }\n        \n        state = Presence.syncState(state, newState: newState,\n                                   onJoin: onJoin, onLeave: onLeave)\n        let t2 = transform(state, and: newState)\n        expect(t2.lhs).to(equal(t2.rhs))\n        \n        // assert equality in joined\n        let leftExpectation: Presence.Diff = [\n          \"u3\": [\"current\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]] ],\n                 \"leftPres\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3.left\"]] ]\n          ]\n        ]\n        \n        let tLeft = transform(left, and: leftExpectation)\n        expect(tLeft.lhs).to(equal(tLeft.rhs))\n        \n        // assert equality in left\n        expect(joined).to(beEmpty())\n      })\n      \n      it(\"syncs both joined and left metas\", closure: {\n        let newState = [\"u3\": [\n          \"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.new\"]]\n          ]]\n        var state = [\"u3\": [\n          \"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.left\"]]\n          ]]\n        \n        var joined: Presence.Diff = [:]\n        var left: Presence.Diff = [:]\n        let onJoin: Presence.OnJoin = { key, current, newPres in\n          var state: Presence.State = [\"newPres\": newPres]\n          if let c = current {\n            state[\"current\"] = c\n          }\n          \n          // Diff = [String: Presence.State]\n          joined[key] = state\n        }\n        \n        let onLeave: Presence.OnLeave = { key, current, leftPres in\n          // Diff = [String: Presence.State]\n          left[key] = [\"current\": current, \"leftPres\": leftPres]\n        }\n        \n        state = Presence.syncState(state, newState: newState,\n                                   onJoin: onJoin, onLeave: onLeave)\n        let t2 = transform(state, and: newState)\n        expect(t2.lhs).to(equal(t2.rhs))\n        \n        // assert equality in joined\n        let joinedExpectation: Presence.Diff = [\n          \"u3\": [\"current\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.left\"]] ],\n                 \"newPres\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3.new\"]] ]\n          ]\n        ]\n        \n        let tJoin = transform(joined, and: joinedExpectation)\n        expect(tJoin.lhs).to(equal(tJoin.rhs))\n        \n        // assert equality in left\n        let leftExpectation: Presence.Diff = [\n          \"u3\": [\"current\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"], [\"id\":3, \"phx_ref\": \"3.new\"]] ],\n                 \"leftPres\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3.left\"]] ]\n          ]\n        ]\n        \n        let tLeft = transform(left, and: leftExpectation)\n        expect(tLeft.lhs).to(equal(tLeft.rhs))\n      })\n    }\n    \n    describe(\"syncDiff\") {\n      it(\"syncs empty state\", closure: {\n        let joins: Presence.State = [\"u1\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1\"]]]]\n        var state: Presence.State = [:]\n        \n        Presence.syncDiff(state, diff: [\"joins\": joins, \"leaves\": [:]])\n        expect(state).to(beEmpty())\n        \n        state = Presence.syncDiff(state, diff: [\"joins\": joins, \"leaves\": [:]])\n        let t1 = transform(state, and: joins)\n        expect(t1.lhs).to(equal(t1.rhs))\n      })\n      \n      it(\"removes presence when meta is empty and adds additional meta\", closure: {\n        var state = fixState\n        let diff: Presence.Diff = [\"joins\": fixJoins, \"leaves\": fixLeaves]\n        state = Presence.syncDiff(state, diff: diff)\n        \n        let expectation: Presence.State = [\n          \"u1\": [\"metas\": [\n            [\"id\":1, \"phx_ref\": \"1\"],\n            [\"id\":1, \"phx_ref\": \"1.2\"]]\n          ],\n          \"u3\": [\"metas\": [[\"id\":3, \"phx_ref\": \"3\"]] ]\n        ]\n        \n        let t1 = transform(state, and: expectation)\n        expect(t1.lhs).to(equal(t1.rhs))\n      })\n      \n      it(\"removes meta while leaving key if other metas exist\", closure: {\n        var state: Presence.State = [\n          \"u1\": [\"metas\": [\n            [\"id\":1, \"phx_ref\": \"1\"],\n            [\"id\":1, \"phx_ref\": \"1.2\"]]\n          ]]\n        \n        let leaves: Presence.State = [\"u1\": [\"metas\": [[\"id\":1, \"phx_ref\": \"1\"]]]]\n        let diff: Presence.Diff = [\"joins\": [:], \"leaves\": leaves]\n        state = Presence.syncDiff(state, diff: diff)\n      })\n    }\n  }\n}\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/SocketSpec.swift",
    "content": "//\n//  SocketSpec.swift\n//  SwiftPhoenixClient\n//\n//  Created by Daniel Rees on 2/10/18.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\n@available(iOS 13, *)\nclass SocketSpec: QuickSpec {\n  \n  let encode = Defaults.encode\n  let decode = Defaults.decode\n  \n  override func spec() {\n    \n    describe(\"constructor\") {\n      it(\"sets defaults\", closure: {\n        let socket = Socket(\"wss://localhost:4000/socket\")\n        \n        expect(socket.channels).to(haveCount(0))\n        expect(socket.sendBuffer).to(haveCount(0))\n        expect(socket.ref).to(equal(0))\n        expect(socket.endPoint).to(equal(\"wss://localhost:4000/socket\"))\n        expect(socket.stateChangeCallbacks.open).to(beEmpty())\n        expect(socket.stateChangeCallbacks.close).to(beEmpty())\n        expect(socket.stateChangeCallbacks.error).to(beEmpty())\n        expect(socket.stateChangeCallbacks.message).to(beEmpty())\n        expect(socket.timeout).to(equal(Defaults.timeoutInterval))\n        expect(socket.heartbeatInterval).to(equal(Defaults.heartbeatInterval))\n        expect(socket.logger).to(beNil())\n        expect(socket.reconnectAfter(1)).to(equal(0.010)) // 10ms\n        expect(socket.reconnectAfter(2)).to(equal(0.050)) // 50ms\n        expect(socket.reconnectAfter(3)).to(equal(0.100)) // 100ms\n        expect(socket.reconnectAfter(4)).to(equal(0.150)) // 150ms\n        expect(socket.reconnectAfter(5)).to(equal(0.200)) // 200ms\n        expect(socket.reconnectAfter(6)).to(equal(0.250)) // 250ms\n        expect(socket.reconnectAfter(7)).to(equal(0.500)) // 500ms\n        expect(socket.reconnectAfter(8)).to(equal(1.000)) // 1_000ms (1s)\n        expect(socket.reconnectAfter(9)).to(equal(2.000)) // 2_000ms (2s)\n        expect(socket.reconnectAfter(10)).to(equal(5.00)) // 5_000ms (5s)\n        expect(socket.reconnectAfter(11)).to(equal(5.00)) // 5_000ms (5s)\n      })\n      \n      it(\"overrides some defaults\", closure: {\n        let socket = Socket(\"wss://localhost:4000/socket\", paramsClosure: { [\"one\": 2] })\n        socket.timeout = 40000\n        socket.heartbeatInterval = 60000\n        socket.logger = { _ in }\n        socket.reconnectAfter = { _ in return 10 }\n        \n        expect(socket.timeout).to(equal(40000))\n        expect(socket.heartbeatInterval).to(equal(60000))\n        expect(socket.logger).toNot(beNil())\n        expect(socket.reconnectAfter(1)).to(equal(10))\n        expect(socket.reconnectAfter(2)).to(equal(10))\n      })\n      \n//      it(\"sets queue for underlying transport\", closure: {\n//        let socket = Socket(endPoint: \"wss://localhost:4000/socket\", transport: { (url) -> WebSocketClient in\n//            let webSocket = WebSocket(url: url)\n//            webSocket.callbackQueue = DispatchQueue(label: \"test_queue\")\n//            return webSocket\n//        })\n//        socket.timeout = 40000\n//        socket.heartbeatInterval = 60000\n//        socket.logger = { _ in }\n//        socket.reconnectAfter = { _ in return 10 }\n//        socket.connect()\n//        expect(socket.connection).to(beAKindOf(Transport.self))\n//        expect((socket.connection as! WebSocket).callbackQueue.label).to(equal(\"test_queue\"))\n//      })\n      \n      it(\"should construct a valid URL\", closure: {\n        \n        // test vsn\n        expect(Socket(\"http://localhost:4000/socket/websocket\",\n                      paramsClosure: { [\"token\": \"abc123\"] },\n                      vsn: \"1.0.0\")\n          .endPointUrl\n          .absoluteString)\n          .to(equal(\"http://localhost:4000/socket/websocket?vsn=1.0.0&token=abc123\"))\n        \n        // test params\n        expect(Socket(\"http://localhost:4000/socket/websocket\",\n                      paramsClosure: { [\"token\": \"abc123\"] })\n          .endPointUrl\n          .absoluteString)\n          .to(equal(\"http://localhost:4000/socket/websocket?vsn=2.0.0&token=abc123\"))\n        \n        expect(Socket(\"ws://localhost:4000/socket/websocket\",\n                      paramsClosure: { [\"token\": \"abc123\", \"user_id\": 1] })\n          .endPointUrl\n          .absoluteString)\n          .to(satisfyAnyOf(\n            // absoluteString does not seem to return a string with the params in a deterministic order\n            equal(\"ws://localhost:4000/socket/websocket?vsn=2.0.0&token=abc123&user_id=1\"),\n            equal(\"ws://localhost:4000/socket/websocket?vsn=2.0.0&user_id=1&token=abc123\")\n            )\n        )\n        \n        \n        // test params with spaces\n        expect(Socket(\"ws://localhost:4000/socket/websocket\",\n                      paramsClosure: { [\"token\": \"abc 123\", \"user_id\": 1] })\n          .endPointUrl\n          .absoluteString)\n          .to(satisfyAnyOf(\n            // absoluteString does not seem to return a string with the params in a deterministic order\n            equal(\"ws://localhost:4000/socket/websocket?vsn=2.0.0&token=abc%20123&user_id=1\"),\n            equal(\"ws://localhost:4000/socket/websocket?vsn=2.0.0&user_id=1&token=abc%20123\")\n            )\n        )\n      })\n      \n      it(\"should not introduce any retain cycles\", closure: {\n        // Must remain as a weak var in order to deallocate the socket. This tests that the\n        // reconnect timer does not old on to the Socket causing a memory leak.\n        weak var socket = Socket(\"http://localhost:4000/socket/websocket\")\n        expect(socket).to(beNil())\n      })\n    }\n\n    describe(\"params\") {\n      it(\"changes dynamically with a closure\") {\n        var authToken = \"abc123\"\n        let socket = Socket(\"ws://localhost:4000/socket/websocket\", paramsClosure: { [\"token\": authToken] })\n        \n        expect(socket.params?[\"token\"] as? String).to(equal(\"abc123\"))\n        authToken = \"xyz987\"\n        expect(socket.params?[\"token\"] as? String).to(equal(\"xyz987\"))\n      }\n    }\n\n    describe(\"websocketProtocol\") {\n      it(\"returns wss when protocol is https\", closure: {\n        let socket = Socket(\"https://example.com/\")\n        expect(socket.websocketProtocol).to(equal(\"wss\"))\n      })\n      \n      it(\"returns wss when protocol is wss\", closure: {\n        let socket = Socket(\"wss://example.com/\")\n        expect(socket.websocketProtocol).to(equal(\"wss\"))\n      })\n      \n      it(\"returns ws when protocol is http\", closure: {\n        let socket = Socket(\"http://example.com/\")\n        expect(socket.websocketProtocol).to(equal(\"ws\"))\n      })\n      \n      it(\"returns ws when protocol is ws\", closure: {\n        let socket = Socket(\"ws://example.com/\")\n        expect(socket.websocketProtocol).to(equal(\"ws\"))\n      })\n      \n      it(\"returns empty if there is no scheme\", closure: {\n        let socket = Socket(\"example.com/\")\n        expect(socket.websocketProtocol).to(beEmpty())\n      })\n    }\n    \n//    describe(\"endPointUrl\") {\n//      it(\"does nothing with the url\", closure: {\n//        let socket = Socket(\"http://example.com/websocket\")\n//        expect(socket.endPointUrl.absoluteString).to(equal(\"http://example.com/websocket\"))\n//      })\n//      \n//      it(\"appends /websocket correctly\", closure: {\n//        let socketA = Socket(\"wss://example.org/chat/\")\n//        expect(socketA.endPointUrl.absoluteString).to(equal(\"wss://example.org/chat/websocket\"))\n//        \n//        let socketB = Socket(\"ws://example.org/chat\")\n//        expect(socketB.endPointUrl.absoluteString).to(equal(\"ws://example.org/chat/websocket\"))\n//      })\n//    }\n    \n    describe(\"connect with Websocket\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n        socket.skipHeartbeat = true\n      }\n      \n      it(\"establishes websocket connection with endpoint\", closure: {\n        socket.connect()\n        \n        expect(socket.connection).toNot(beNil())\n      })\n      \n      it(\"set callbacks for connection\", closure: {\n        var open = 0\n        socket.onOpen { open += 1 }\n        \n        var close = 0\n        socket.onClose { close += 1 }\n        \n        var lastError: (Error, URLResponse?)?\n        socket.onError(callback: { (error) in lastError = error })\n        \n        var lastMessage: Message?\n        socket.onMessage(callback: { (message) in lastMessage = message })\n        \n        mockWebSocket.readyState = .closed\n        socket.connect()\n        \n        mockWebSocket.delegate?.onOpen()\n        expect(open).to(equal(1))\n        \n        mockWebSocket.delegate?.onClose(code: 1000, reason: nil)\n        expect(close).to(equal(1))\n        \n        mockWebSocket.delegate?.onError(error: TestError.stub, response: nil)\n        expect(lastError).toNot(beNil())\n        \n        let data: [Any] = [\"2\", \"6\", \"topic\", \"event\", [\"response\": [\"go\": true], \"status\": \"ok\"]]\n        let text = toWebSocketText(data: data)\n        mockWebSocket.delegate?.onMessage(message: text)\n        expect(lastMessage?.payload[\"go\"] as? Bool).to(beTrue())\n      })\n      \n      it(\"removes callbacks\", closure: {\n        var open = 0\n        socket.onOpen { open += 1 }\n        \n        var close = 0\n        socket.onClose { close += 1 }\n        \n        var lastError: (Error, URLResponse?)?\n        socket.onError(callback: { (error) in lastError = error })\n        \n        var lastMessage: Message?\n        socket.onMessage(callback: { (message) in lastMessage = message })\n        \n        mockWebSocket.readyState = .closed\n        socket.releaseCallbacks()\n        socket.connect()\n        \n        mockWebSocket.delegate?.onOpen()\n        expect(open).to(equal(0))\n        \n        mockWebSocket.delegate?.onClose(code: 1000, reason: nil)\n        expect(close).to(equal(0))\n        \n        mockWebSocket.delegate?.onError(error: TestError.stub, response: nil)\n        expect(lastError).to(beNil())\n        \n        let data: [Any] = [\"2\", \"6\", \"topic\", \"event\", [\"response\": [\"go\": true], \"status\": \"ok\"]]\n        let text = toWebSocketText(data: data)\n        mockWebSocket.delegate?.onMessage(message: text)\n        expect(lastMessage).to(beNil())\n      })\n      \n      it(\"does not connect if already connected\", closure: {\n        mockWebSocket.readyState = .open\n        \n        socket.connect()\n        socket.connect()\n        \n        expect(mockWebSocket.connectCallsCount).to(equal(1))\n      })\n    }\n    \n    \n    describe(\"disconnect\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n      }\n      \n      it(\"removes existing connection\", closure: {\n        socket.connect()\n        socket.disconnect()\n        \n        expect(socket.connection).to(beNil())\n        expect(mockWebSocket.disconnectCodeReasonReceivedArguments?.code)\n          .to(equal(Socket.CloseCode.normal.rawValue))\n      })\n      \n      it(\"flags the socket as closed cleanly\", closure: {\n        expect(socket.closeStatus).to(equal(.unknown))\n        \n        socket.disconnect()\n        expect(socket.closeStatus).to(equal(.clean))\n      })\n      \n      it(\"calls callback\", closure: {\n        var callCount = 0\n        socket.connect()\n        socket.disconnect(code: .goingAway) {\n          callCount += 1\n        }\n        \n        expect(mockWebSocket.disconnectCodeReasonCalled).to(beTrue())\n        expect(mockWebSocket.disconnectCodeReasonReceivedArguments?.reason).to(beNil())\n        expect(mockWebSocket.disconnectCodeReasonReceivedArguments?.code)\n          .to(equal(Socket.CloseCode.goingAway.rawValue))\n        expect(callCount).to(equal(1))\n        \n      })\n      \n      it(\"calls onClose for all state callbacks\", closure: {\n        var callCount = 0\n        socket.onClose {\n          callCount += 1\n        }\n        \n        socket.disconnect()\n        expect(callCount).to(equal(1))\n        \n      })\n      \n      it(\"invalidates and invalidates the heartbeat timer\", closure: {\n        var timerCalled = 0\n        let queue = DispatchQueue(label: \"test.heartbeat\")\n        let timer = HeartbeatTimer(timeInterval: 10, queue: queue)\n      \n        timer.start { timerCalled += 1 }\n\n        socket.heartbeatTimer = timer\n        \n        socket.disconnect()\n        expect(socket.heartbeatTimer?.isValid).to(beFalse())\n        timer.fire()\n        expect(timerCalled).to(equal(0))\n      })\n      \n      it(\"does nothing if not connected\", closure: {\n        socket.disconnect()\n        expect(mockWebSocket.disconnectCodeReasonCalled).to(beFalse())\n      })\n    }\n    \n    \n    describe(\"channel\") {\n      var socket: Socket!\n      \n      beforeEach {\n        socket = Socket(\"/socket\")\n      }\n      \n      it(\"returns channel with given topic and params\", closure: {\n        let channel = socket.channel(\"topic\", params: [\"one\": \"two\"])\n        socket.ref = 1006\n        \n        // No deep equal, so hack it\n        expect(channel.socket?.ref).to(equal(socket.ref))\n        expect(channel.topic).to(equal(\"topic\"))\n        expect(channel.params[\"one\"] as? String).to(equal(\"two\"))\n      })\n      \n      it(\"adds channel to sockets channel list\", closure: {\n        expect(socket.channels).to(beEmpty())\n        \n        let channel = socket.channel(\"topic\", params: [\"one\": \"two\"])\n        \n        expect(socket.channels).to(haveCount(1))\n        expect(socket.channels[0].topic).to(equal(channel.topic))\n      })\n    }\n    \n    describe(\"remove\") {\n      var socket: Socket!\n      \n      beforeEach {\n        socket = Socket(\"/socket\")\n      }\n      \n      it(\"removes given channel from channels\", closure: {\n        let channel1 = socket.channel(\"topic-1\")\n        let channel2 = socket.channel(\"topic-2\")\n        \n        channel1.joinPush.ref = \"1\"\n        channel2.joinPush.ref = \"2\"\n        \n        socket.remove(channel1)\n        expect(socket.channels).to(haveCount(1))\n        expect(socket.channels[0].topic).to(equal(channel2.topic))\n      })\n    }\n    \n    \n    describe(\"push\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n      }\n      \n      it(\"sends data to connection when connected\", closure: {\n        mockWebSocket.readyState = .open\n        socket.connect()\n        socket.push(topic: \"topic\", event: \"event\", payload: [\"one\": \"two\"], ref: \"6\", joinRef: \"2\")\n        \n        expect(mockWebSocket.sendDataCalled).to(beTrue())\n        let json = self.decode(mockWebSocket.sendDataReceivedData!) as! [Any]\n        expect(json[0] as? String).to(equal(\"2\"))\n        expect(json[1] as? String).to(equal(\"6\"))\n        expect(json[2] as? String).to(equal(\"topic\"))\n        expect(json[3] as? String).to(equal(\"event\"))\n        expect(json[4] as? [String: String]).to(equal([\"one\": \"two\"]))\n        \n        expect(String(data: mockWebSocket.sendDataReceivedData!, encoding: .utf8))\n          .to(equal(\"[\\\"2\\\",\\\"6\\\",\\\"topic\\\",\\\"event\\\",{\\\"one\\\":\\\"two\\\"}]\"))\n      })\n      \n      it(\"excludes ref information if not passed\", closure: {\n        mockWebSocket.readyState = .open\n        socket.connect()\n        socket.push(topic: \"topic\", event: \"event\", payload: [\"one\": \"two\"])\n        \n        let json = self.decode(mockWebSocket.sendDataReceivedData!) as! [Any?]\n        expect(json[0] as? String).to(beNil())\n        expect(json[1] as? String).to(beNil())\n        expect(json[2] as? String).to(equal(\"topic\"))\n        expect(json[3] as? String).to(equal(\"event\"))\n        expect(json[4] as? [String: String]).to(equal([\"one\": \"two\"]))\n        \n        expect(String(data: mockWebSocket.sendDataReceivedData!, encoding: .utf8))\n          .to(equal(\"[null,null,\\\"topic\\\",\\\"event\\\",{\\\"one\\\":\\\"two\\\"}]\"))\n      })\n      \n      it(\"buffers data when not connected\", closure: {\n        mockWebSocket.readyState = .closed\n        socket.connect()\n        \n        expect(socket.sendBuffer).to(beEmpty())\n        \n        socket.push(topic: \"topic1\", event: \"event1\", payload: [\"one\": \"two\"])\n        expect(mockWebSocket.sendDataCalled).to(beFalse())\n        expect(socket.sendBuffer).to(haveCount(1))\n        \n        socket.push(topic: \"topic2\", event: \"event2\", payload: [\"one\": \"two\"])\n        expect(mockWebSocket.sendDataCalled).to(beFalse())\n        expect(socket.sendBuffer).to(haveCount(2))\n        \n        socket.sendBuffer.forEach( { try? $0.callback() } )\n        expect(mockWebSocket.sendDataCalled).to(beTrue())\n        expect(mockWebSocket.sendDataCallsCount).to(equal(2))\n      })\n    }\n    \n    describe(\"makeRef\") {\n      var socket: Socket!\n      \n      beforeEach {\n        socket = Socket(\"/socket\")\n      }\n      \n      it(\"returns next message ref\", closure: {\n        expect(socket.ref).to(equal(0))\n        expect(socket.makeRef()).to(equal(\"1\"))\n        expect(socket.ref).to(equal(1))\n        expect(socket.makeRef()).to(equal(\"2\"))\n        expect(socket.ref).to(equal(2))\n      })\n      \n      it(\"resets to 0 if it hits max int\", closure: {\n        socket.ref = UInt64.max\n        \n        expect(socket.makeRef()).to(equal(\"0\"))\n        expect(socket.ref).to(equal(0))\n      })\n    }\n    \n    describe(\"sendHeartbeat v1\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(\"/socket\")\n        socket.connection = mockWebSocket\n      }\n      \n      it(\"closes socket when heartbeat is not ack'd within heartbeat window\", closure: {\n        mockWebSocket.readyState = .open\n        socket.sendHeartbeat()\n        expect(mockWebSocket.disconnectCodeReasonCalled).to(beFalse())\n        expect(socket.pendingHeartbeatRef).toNot(beNil())\n        \n        socket.sendHeartbeat()\n        expect(mockWebSocket.disconnectCodeReasonCalled).to(beTrue())\n        expect(socket.pendingHeartbeatRef).to(beNil())\n      })\n      \n      it(\"pushes heartbeat data when connected\", closure: {\n        mockWebSocket.readyState = .open\n        \n        socket.sendHeartbeat()\n        \n        expect(socket.pendingHeartbeatRef).to(equal(String(socket.ref)))\n        expect(mockWebSocket.sendDataCalled).to(beTrue())\n        \n        let json = self.decode(mockWebSocket.sendDataReceivedData!) as? [Any?]\n        expect(json?[0] as? String).to(beNil())\n        expect(json?[1] as? String).to(equal(socket.pendingHeartbeatRef))\n        expect(json?[2] as? String).to(equal(\"phoenix\"))\n        expect(json?[3] as? String).to(equal(\"heartbeat\"))\n        expect(json?[4] as? [String: String]).to(beEmpty())\n        \n        expect(String(data: mockWebSocket.sendDataReceivedData!, encoding: .utf8))\n          .to(equal(\"[null,\\\"1\\\",\\\"phoenix\\\",\\\"heartbeat\\\",{}]\"))\n      })\n      \n      it(\"does nothing when not connected\", closure: {\n        mockWebSocket.readyState = .closed\n        socket.sendHeartbeat()\n        \n        expect(mockWebSocket.disconnectCodeReasonCalled).to(beFalse())\n        expect(mockWebSocket.sendDataCalled).to(beFalse())\n      })\n    }\n    \n    \n    describe(\"flushSendBuffer\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(\"/socket\")\n        socket.connection = mockWebSocket\n      }\n      \n      it(\"calls callbacks in buffer when connected\", closure: {\n        var oneCalled = 0\n        socket.sendBuffer.append((\"0\", { oneCalled += 1 }))\n        var twoCalled = 0\n        socket.sendBuffer.append((\"1\", { twoCalled += 1 }))\n        let threeCalled = 0\n        \n        mockWebSocket.readyState = .open\n        socket.flushSendBuffer()\n        expect(oneCalled).to(equal(1))\n        expect(twoCalled).to(equal(1))\n        expect(threeCalled).to(equal(0))\n      })\n      \n      it(\"empties send buffer\", closure: {\n        socket.sendBuffer.append((nil, { }))\n        mockWebSocket.readyState = .open\n        socket.flushSendBuffer()\n        \n        expect(socket.sendBuffer).to(beEmpty())\n      })\n    }\n    \n    describe(\"removeFromSendBuffer\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(\"/socket\")\n        socket.connection = mockWebSocket\n      }\n      \n      it(\"removes a callback with a matching ref\", closure: {\n        var oneCalled = 0\n        socket.sendBuffer.append((\"0\", { oneCalled += 1 }))\n        var twoCalled = 0\n        socket.sendBuffer.append((\"1\", { twoCalled += 1 }))\n        let threeCalled = 0\n        \n        mockWebSocket.readyState = .open\n        \n        socket.removeFromSendBuffer(ref: \"0\")\n        \n        socket.flushSendBuffer()\n        expect(oneCalled).to(equal(0))\n        expect(twoCalled).to(equal(1))\n        expect(threeCalled).to(equal(0))\n      })\n    }\n    \n    describe(\"onConnectionOpen\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      var mockTimeoutTimer: TimeoutTimerMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        mockTimeoutTimer = TimeoutTimerMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n        socket.reconnectAfter = { _ in return 10 }\n        socket.reconnectTimer = mockTimeoutTimer\n        socket.skipHeartbeat = true\n        \n        mockWebSocket.readyState = .open\n        socket.connect()\n      }\n      \n      it(\"flushes the send buffer\", closure: {\n        var oneCalled = 0\n        socket.sendBuffer.append((\"0\", { oneCalled += 1 })) \n        \n        socket.onConnectionOpen()\n        expect(oneCalled).to(equal(1))\n        expect(socket.sendBuffer).to(beEmpty())\n      })\n      \n      it(\"resets reconnectTimer\", closure: {\n        socket.onConnectionOpen()\n        expect(mockTimeoutTimer.resetCalled).to(beTrue())\n      })\n      \n      it(\"triggers onOpen callbacks\", closure: {\n        var oneCalled = 0\n        socket.onOpen { oneCalled += 1 }\n        var twoCalled = 0\n        socket.onOpen { twoCalled += 1 }\n        var threeCalled = 0\n        socket.onClose { threeCalled += 1 }\n        \n        socket.onConnectionOpen()\n        expect(oneCalled).to(equal(1))\n        expect(twoCalled).to(equal(1))\n        expect(threeCalled).to(equal(0))\n      })\n    }\n    \n    describe(\"resetHeartbeat\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n        \n      }\n      \n      it(\"clears any pending heartbeat\", closure: {\n        socket.pendingHeartbeatRef = \"1\"\n        socket.resetHeartbeat()\n        \n        expect(socket.pendingHeartbeatRef).to(beNil())\n      })\n      \n      it(\"does not schedule heartbeat if skipHeartbeat == true\", closure: {\n        socket.skipHeartbeat = true\n        socket.resetHeartbeat()\n        \n        expect(socket.heartbeatTimer).to(beNil())\n      })\n      \n      it(\"creates a timer and sends a heartbeat\", closure: {\n        mockWebSocket.readyState = .open\n        socket.connect()\n        socket.heartbeatInterval = 1\n        \n        expect(socket.heartbeatTimer).to(beNil())\n        socket.resetHeartbeat()\n        \n        expect(socket.heartbeatTimer).toNot(beNil())\n        expect(socket.heartbeatTimer?.timeInterval).to(equal(1))\n        \n        // Fire the timer\n        socket.heartbeatTimer?.fire()\n        expect(mockWebSocket.sendDataCalled).to(beTrue())\n        let json = self.decode(mockWebSocket.sendDataReceivedData!) as? [Any?]\n        expect(json?[0] as? String).to(beNil())\n        expect(json?[1] as? String).to(equal(String(socket.ref)))\n        expect(json?[2] as? String).to(equal(\"phoenix\"))\n        expect(json?[3] as? String).to(equal(ChannelEvent.heartbeat))\n        expect(json?[4] as? [String: Any]).to(beEmpty())\n      })\n      \n      it(\"should invalidate an old timer and create a new one\", closure: {\n        mockWebSocket.readyState = .open\n        let queue = DispatchQueue(label: \"test.heartbeat\")\n        let timer = HeartbeatTimer(timeInterval: 1000, queue: queue)\n        \n        var timerCalled = 0\n        timer.start { timerCalled += 1 }\n        socket.heartbeatTimer = timer\n        \n        expect(timer.isValid).to(beTrue())\n        socket.resetHeartbeat()\n        \n        expect(timer.isValid).to(beFalse())\n        expect(socket.heartbeatTimer).toNot(equal(timer))\n      })\n    }\n    \n    describe(\"onConnectionClosed\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      var mockTimeoutTimer: TimeoutTimerMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        mockTimeoutTimer = TimeoutTimerMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n//        socket.reconnectAfter = { _ in return 10 }\n        socket.reconnectTimer = mockTimeoutTimer\n//        socket.skipHeartbeat = true\n      }\n      \n      it(\"schedules reconnectTimer timeout if normal close\", closure: {\n        socket.onConnectionClosed(code: Socket.CloseCode.normal.rawValue, reason: nil)\n        expect(mockTimeoutTimer.scheduleTimeoutCalled).to(beTrue())\n      })\n      \n      \n      it(\"does not schedule reconnectTimer timeout if normal close after explicit disconnect\", closure: {\n        socket.disconnect()\n        expect(mockTimeoutTimer.scheduleTimeoutCalled).to(beFalse())\n      })\n      \n      it(\"schedules reconnectTimer timeout if not normal close\", closure: {\n        socket.onConnectionClosed(code: 1001, reason: nil)\n        expect(mockTimeoutTimer.scheduleTimeoutCalled).to(beTrue())\n      })\n      \n      it(\"schedules reconnectTimer timeout if connection cannot be made after a previous clean disconnect\", closure: {\n        socket.disconnect()\n        socket.connect()\n        \n        socket.onConnectionClosed(code: 1001, reason: nil)\n        expect(mockTimeoutTimer.scheduleTimeoutCalled).to(beTrue())\n      })\n      \n      it(\"triggers channel error if joining\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join()\n        expect(channel.state).to(equal(.joining))\n\n        socket.onConnectionClosed(code: 1001, reason: nil)\n        expect(errorCalled).to(beTrue())\n      })\n      \n      it(\"triggers channel error if joined\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join().trigger(\"ok\", payload: [:])\n        expect(channel.state).to(equal(.joined))\n        \n        socket.onConnectionClosed(code: 1001, reason: nil)\n        expect(errorCalled).to(beTrue())\n      })\n      \n      it(\"does not trigger channel error after leave\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join().trigger(\"ok\", payload: [:])\n        channel.leave()\n        expect(channel.state).to(equal(.closed))\n        \n        socket.onConnectionClosed(code: 1001, reason: nil)\n        expect(errorCalled).to(beFalse())\n      })\n      \n      \n      it(\"triggers onClose callbacks\", closure: {\n        var oneCalled = 0\n        socket.onClose { oneCalled += 1 }\n        var twoCalled = 0\n        socket.onClose { twoCalled += 1 }\n        var threeCalled = 0\n        socket.onOpen { threeCalled += 1 }\n        \n        socket.onConnectionClosed(code: 1000, reason: nil)\n        expect(oneCalled).to(equal(1))\n        expect(twoCalled).to(equal(1))\n        expect(threeCalled).to(equal(0))\n      })\n    }\n    \n    describe(\"onConnectionError\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      var mockTimeoutTimer: TimeoutTimerMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        mockTimeoutTimer = TimeoutTimerMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n        socket.reconnectAfter = { _ in return 10 }\n        socket.reconnectTimer = mockTimeoutTimer\n        socket.skipHeartbeat = true\n        \n        mockWebSocket.readyState = .open\n        socket.connect()\n      }\n      \n      it(\"triggers onClose callbacks\", closure: {\n        var lastError: (Error, URLResponse?)?\n        socket.onError(callback: { (error) in lastError = error })\n        \n        socket.onConnectionError(TestError.stub, response: nil)\n        expect(lastError).toNot(beNil())\n      })\n      \n      \n      it(\"triggers channel error if joining\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join()\n        expect(channel.state).to(equal(.joining))\n        \n        socket.onConnectionError(TestError.stub, response: nil)\n        expect(errorCalled).to(beTrue())\n      })\n      \n      it(\"triggers channel error if joined\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join().trigger(\"ok\", payload: [:])\n        expect(channel.state).to(equal(.joined))\n        \n        socket.onConnectionError(TestError.stub, response: nil)\n        expect(errorCalled).to(beTrue())\n      })\n      \n      it(\"does not trigger channel error after leave\", closure: {\n        let channel = socket.channel(\"topic\")\n        var errorCalled = false\n        channel.on(ChannelEvent.error, callback: { _ in\n          errorCalled = true\n        })\n        \n        channel.join().trigger(\"ok\", payload: [:])\n        channel.leave()\n        expect(channel.state).to(equal(.closed))\n        \n        socket.onConnectionError(TestError.stub, response: nil)\n        expect(errorCalled).to(beFalse())\n      })\n    }\n    \n    describe(\"onConnectionMessage\") {\n      // Mocks\n      var mockWebSocket: PhoenixTransportMock!\n      var mockTimeoutTimer: TimeoutTimerMock!\n      let mockWebSocketTransport: ((URL) -> PhoenixTransportMock) = { _ in return mockWebSocket }\n      \n      // UUT\n      var socket: Socket!\n      \n      beforeEach {\n        mockWebSocket = PhoenixTransportMock()\n        mockTimeoutTimer = TimeoutTimerMock()\n        socket = Socket(endPoint: \"/socket\", transport: mockWebSocketTransport)\n        socket.reconnectAfter = { _ in return 10 }\n        socket.reconnectTimer = mockTimeoutTimer\n        socket.skipHeartbeat = true\n        \n        mockWebSocket.readyState = .open\n        socket.connect()\n      }\n      \n      it(\"parses raw message and triggers channel event\", closure: {\n        let targetChannel = socket.channel(\"topic\")\n        let otherChannel = socket.channel(\"off-topic\")\n        \n        var targetMessage: Message?\n        targetChannel.on(\"event\", callback: { (msg) in targetMessage = msg })\n        \n        var otherMessage: Message?\n        otherChannel.on(\"event\", callback: { (msg) in otherMessage = msg })\n        \n        \n        let data: [Any?] = [nil, nil, \"topic\", \"event\", [\"status\": \"ok\", \"response\": [\"one\": \"two\"]]]\n        let rawMessage = toWebSocketText(data: data)\n        \n        socket.onConnectionMessage(rawMessage)\n        expect(targetMessage?.topic).to(equal(\"topic\"))\n        expect(targetMessage?.event).to(equal(\"event\"))\n        expect(targetMessage?.payload[\"one\"] as? String).to(equal(\"two\"))\n        expect(otherMessage).to(beNil())\n      })\n      \n      it(\"triggers onMessage callbacks\", closure: {\n        var message: Message?\n        socket.onMessage(callback: { (msg) in message = msg })\n        \n        let data: [Any?] = [nil, nil, \"topic\", \"event\", [\"status\": \"ok\", \"response\": [\"one\": \"two\"]]]\n        let rawMessage = toWebSocketText(data: data)\n        \n        socket.onConnectionMessage(rawMessage)\n        expect(message?.topic).to(equal(\"topic\"))\n        expect(message?.event).to(equal(\"event\"))\n        expect(message?.payload[\"one\"] as? String).to(equal(\"two\"))\n      })\n      \n      it(\"clears pending heartbeat\", closure: {\n        socket.pendingHeartbeatRef = \"5\"\n        let rawMessage = \"[null,\\\"5\\\",\\\"phoenix\\\",\\\"phx_reply\\\",{\\\"response\\\":{},\\\"status\\\":\\\"ok\\\"}]\"\n        socket.onConnectionMessage(rawMessage)\n        expect(socket.pendingHeartbeatRef).to(beNil())\n      })\n    }\n  }\n}\n\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/TimeoutTimerSpec.swift",
    "content": "//\n//  TimeoutTimerSpec.swift\n//  SwiftPhoenixClientTests\n//\n//  Created by Daniel Rees on 2/10/19.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\nclass TimeoutTimerSpec: QuickSpec {\n  \n  public func secondsBetweenDates(_ first: Date, _ second: Date) -> Double {\n    var diff = first.timeIntervalSince1970 - second.timeIntervalSince1970\n    diff = fabs(diff)\n    return diff\n  }\n  \n  \n  override func spec() {\n    \n    let fakeClock = FakeTimerQueue()\n    var timer: TimeoutTimer!\n    \n    \n    beforeEach {\n      fakeClock.reset()\n      \n      timer = TimeoutTimer()\n      timer.queue = fakeClock\n    }\n    \n    describe(\"retain cycles\") {\n      it(\"does not hold any retain cycles\", closure: {\n//        var weakTimer: TimeoutTimer? = TimeoutTimer()\n//        \n//        var weakTimerCalled: Bool = false\n//        timer.callback.delegate(to: weakTimer!) { (_) in\n//          weakTimerCalled = true\n//        }\n//        \n//        timer.timerCalculation.delegate(to: weakTimer!) { _,_ in 1.0 }\n//        \n//        \n//        timer.scheduleTimeout()\n//        fakeClock.tick(600)\n//        weakTimer = nil\n//        \n//        fakeClock.tick(600)\n//        expect(timer.tries).to(equal(1))\n//        expect(weakTimerCalled).to(beFalse())\n      })\n    }\n    \n    \n    describe(\"scheduleTimeout\") {\n      it(\"schedules timeouts, resets the timer, and schedules another timeout\", closure: {\n        var callbackTimes: [Date] = []\n        timer.callback.delegate(to: self) { (_) in\n          callbackTimes.append(Date())\n        }\n        \n        timer.timerCalculation.delegate(to: self) { (_, tries) -> TimeInterval in\n          return tries > 2 ? 10.0 : [1.0, 2.0, 5.0][tries - 1]\n        }\n        \n        timer.scheduleTimeout()\n        fakeClock.tick(1100)\n        expect(timer.tries).to(equal(1))\n        \n        timer.scheduleTimeout()\n        fakeClock.tick(2100)\n        expect(timer.tries).to(equal(2))\n        \n        timer.reset()\n        timer.scheduleTimeout()\n        fakeClock.tick(1100)\n        expect(timer.tries).to(equal(1))\n      })\n      \n      it(\"does not start timer if no interval is provided\", closure: {\n        timer.scheduleTimeout()\n        expect(timer.workItem).to(beNil())\n      })\n    }\n  }\n}\n\n"
  },
  {
    "path": "Tests/SwiftPhoenixClientTests/URLSessionTransportSpec.swift",
    "content": "//\n//  URLSessionTransportSpec.swift\n//  SwiftPhoenixClientTests\n//\n//  Created by Daniel Rees on 4/1/21.\n//  Copyright © 2021 SwiftPhoenixClient. All rights reserved.\n//\n\nimport Quick\nimport Nimble\n@testable import SwiftPhoenixClient\n\nclass URLSessionTransportSpec: QuickSpec {\n  \n  override func spec() {\n    \n    describe(\"init\") {\n      it(\"replaces http with ws protocols\") {\n        if #available(iOS 13, *) {\n          expect(\n            URLSessionTransport(url: URL(string:\"http://localhost:4000/socket/websocket\")!)\n              .url.absoluteString\n          ).to(equal(\"ws://localhost:4000/socket/websocket\"))\n          \n          expect(\n            URLSessionTransport(url: URL(string:\"https://localhost:4000/socket/websocket\")!)\n              .url.absoluteString\n          ).to(equal(\"wss://localhost:4000/socket/websocket\"))\n          \n          expect(\n            URLSessionTransport(url: URL(string:\"ws://localhost:4000/socket/websocket\")!)\n              .url.absoluteString\n          ).to(equal(\"ws://localhost:4000/socket/websocket\"))\n          \n          expect(\n            URLSessionTransport(url: URL(string:\"wss://localhost:4000/socket/websocket\")!)\n              .url.absoluteString\n          ).to(equal(\"wss://localhost:4000/socket/websocket\"))\n          \n        } else {\n          // Fallback on earlier versions\n          expect(\"wrong iOS version\").to(equal(\"You must run this test on an iOS 13 device\"))\n        }\n      }\n        \n      it(\"accepts an override for the configuration\") {\n        if #available(iOS 13, *) {\n          let configuration = URLSessionConfiguration.default\n          expect(\n            URLSessionTransport(url: URL(string:\"wss://localhost:4000\")!, configuration: configuration)\n                .configuration\n          ).to(equal(configuration))\n        } else {\n          // Fallback on earlier versions\n          expect(\"wrong iOS version\").to(equal(\"You must run this test on an iOS 13 device\"))\n        }\n      }\n    }\n  }\n}\n\n"
  },
  {
    "path": "docs/Classes/Channel.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Channel Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Channel\" class=\"dashAnchor\"></a>\n    <a title=\"Channel Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Channel Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Channel</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Channel</span></code></pre>\n\n                </div>\n              </div>\n            <p>Undocumented</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC5topicSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/topic\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC5topicSSvp\">topic</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The topic of the Channel. e.g. &ldquo;rooms:friends&rdquo;</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/params\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\">params</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The params sent when joining the channel</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onMessage\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\">onMessage</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Overridable message hook. Receives all events for specialized message\nhandling before dispatching to the channel callbacks.</p>\n\n<ul>\n<li>return: Must return the message, modified or unmodified</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onMessage</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>msg</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The Message received by the client from the server</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/join(timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\">join(timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Joins the channel</p>\n\n<ul>\n<li>return: Push event</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">join</span><span class=\"p\">(</span><span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Defaults to Channel&rsquo;s timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onClose(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\">onClose(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel is closed. Does not handle retain cycles.\nUse <code>delegateOnClose(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">onClose</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"n\">message</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onClose</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnClose(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\">delegateOnClose(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel is closed. Automatically handles retain\ncycles. Use <code>onClose()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOnClose</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnClose</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onError(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\">onError(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel receives an Error. Does not handle retain\ncycles. Use <code>delegateOnError(to:)</code> for automatic handling of retain\ncycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">onError</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has errored\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onError</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"n\">_</span> <span class=\"nv\">message</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnError(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\">delegateOnError(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel receives an Error. Automatically handles\nretain cycles. Use <code>onError()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOnError</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnError</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\"></a>\n                    <a name=\"//apple_ref/swift/Method/on(_:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\">on(_:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Subscribes on channel events. Does not handle retain cycles. Use\n<code>delegateOn(_:, to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Subscription returns a ref counter, which can be used later to\nunsubscribe the exact event listener</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do other stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Since unsubscription of ref1, &ldquo;do stuff&rdquo; won&rsquo;t print, but &ldquo;do other\nstuff&rdquo; will keep on printing on the &ldquo;event&rdquo;</p>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called with the event&rsquo;s message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOn(_:to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\">delegateOn(_:to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Subscribes on channel events. Automatically handles retain cycles. Use\n<code>on()</code> to handle yourself.</p>\n\n<p>Subscription returns a ref counter, which can be used later to\nunsubscribe the exact event listener</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOn</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOn</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do other stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Since unsubscription of ref1, &ldquo;do stuff&rdquo; won&rsquo;t print, but &ldquo;do other\nstuff&rdquo; will keep on printing on the &ldquo;event&rdquo;</p>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOn</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                                          <span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called with the event&rsquo;s message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/off(_:ref:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\">off(_:ref:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Unsubscribes from a channel event. If a <code>ref</code> is given, only the exact\nlistener will be removed. Else all listeners for the <code>event</code> will be\nremoved.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref1 event\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref2 event\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref3</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref3 other\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref4</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref4 other\"</span> <span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>After this, only &ldquo;ref2 event&rdquo; will be printed if the channel receives\n&ldquo;event&rdquo; and nothing is printed if the channel receives &ldquo;other_event&rdquo;.</p>\n\n<ul>\n<li>paramter ref: Ref counter returned when subscribing. Can be omitted</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"nv\">ref</span><span class=\"p\">:</span> <span class=\"kt\">Int</span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to unsubscribe from</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/push(_:payload:timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\">push(_:payload:timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Push a payload to the Channel</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">push</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"message\"</span><span class=\"p\">:</span> <span class=\"s\">\"hello\"</span><span class=\"p\">)</span>\n    <span class=\"o\">.</span><span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"s\">\"ok\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">{</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"message sent\"</span><span class=\"p\">)</span> <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">push</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                 <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">,</span>\n                 <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to push</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>payload</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Payload to push</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/leave(timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\">leave(timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Leaves the channel</p>\n\n<p>Unsubscribes from server events, and instructs channel to terminate on\n server</p>\n\n<p>Triggers onClose() hooks</p>\n\n<p>To receive leave acknowledgements, use the a <code>receive</code>\n hook to bind to the server ack, ie:</p>\n\n<p>Example:\n/\n     channel.leave().receive(&ldquo;ok&rdquo;) { _ in { print(&ldquo;left&rdquo;) }</p>\n\n<ul>\n<li>return: Push that can add receive hooks</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">leave</span><span class=\"p\">(</span><span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onMessage(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\">onMessage(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Overridable message hook. Receives all events for specialized message\nhandling before dispatching to the channel callbacks.</p>\n\n<ul>\n<li>return: Must return the payload, modified or unmodified</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onMessage</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The event the message was for</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>payload</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The payload for the message</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>ref</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The reference of the message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public%20API\"></a>\n                <a name=\"//apple_ref/swift/Section/Public API\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public%20API\"></a>\n                  <h3 class=\"section-name\"><p>Public API</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isClosed\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\">isClosed</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the Channel has been closed</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isClosed</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isErrored\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\">isErrored</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the Channel experienced an error</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isErrored</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isJoined\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\">isJoined</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has joined</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isJoined</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isJoining\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\">isJoining</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has requested to join</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isJoining</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isLeaving\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\">isLeaving</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has requested to leave</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isLeaving</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Defaults.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Defaults Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Defaults\" class=\"dashAnchor\"></a>\n    <a title=\"Defaults Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Defaults Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Defaults</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Defaults</span></code></pre>\n\n                </div>\n              </div>\n            <p>A collection of default values and behaviors used accross the Client</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/timeoutInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\">timeoutInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default timeout when sending messages</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">timeoutInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/heartbeatInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\">heartbeatInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default interval to send heartbeats on</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">heartbeatInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/reconnectSteppedBackOff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\">reconnectSteppedBackOff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default reconnect algorithm for the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">reconnectSteppedBackOff</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/rejoinSteppedBackOff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\">rejoinSteppedBackOff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default rejoin algorithm for individual channels</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">rejoinSteppedBackOff</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/encode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\">encode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default encode function, utilizing JSONSerialization.data</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">encode</span><span class=\"p\">:</span> <span class=\"p\">([</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/decode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\">decode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default decode function, utilizing JSONSerialization.jsonObject</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">decode</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Message.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Message Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Message\" class=\"dashAnchor\"></a>\n    <a title=\"Message Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Message Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Message</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Message</span></code></pre>\n\n                </div>\n              </div>\n            <p>Data that is received from the Server.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC3refSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/ref\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC3refSSvp\">ref</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Reference number. Empty if missing</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">ref</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC5topicSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/topic\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC5topicSSvp\">topic</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message topic</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC5eventSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/event\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC5eventSSvp\">event</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message event</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\">payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message payload</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/status\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\">status</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convenience accessor. Equivalent to getting the status as such:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">payload</span><span class=\"p\">[</span><span class=\"s\">\"status\"</span><span class=\"p\">]</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">?</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Presence/Events.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Events Enumeration Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../../js/jquery.min.js\" defer></script>\n    <script src=\"../../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Enum/Events\" class=\"dashAnchor\"></a>\n    <a title=\"Events Enumeration Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../../img/carat.png\" />\n        Events Enumeration Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Events</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">Events</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                </div>\n              </div>\n            <p>Presense Events</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/state\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\">state</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">state</span> <span class=\"o\">=</span> <span class=\"s\">\"state\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/diff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\">diff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">diff</span> <span class=\"o\">=</span> <span class=\"s\">\"diff\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Presence/Options.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Options Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../../js/jquery.min.js\" defer></script>\n    <script src=\"../../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/Options\" class=\"dashAnchor\"></a>\n    <a title=\"Options Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../../img/carat.png\" />\n        Options Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Options</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Options</span></code></pre>\n\n                </div>\n              </div>\n            <p>Custom options that can be provided when creating Presence</p>\n<h3 id='example' class='heading'>Example:</h3>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/defaults\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\">defaults</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default set of Options used when creating Presence. Uses the\nphoenix events &ldquo;presence_state&rdquo; and &ldquo;presence_diff&rdquo;</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">defaults</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../../Classes/Presence.html\">Presence</a></span><span class=\"o\">.</span><span class=\"kt\">Options</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Presence.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Presence Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Presence\" class=\"dashAnchor\"></a>\n    <a title=\"Presence Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Presence Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Presence</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">final</span> <span class=\"kd\">class</span> <span class=\"kt\">Presence</span></code></pre>\n\n                </div>\n              </div>\n            <p>The Presence object provides features for syncing presence information from\nthe server with the client and handling presences joining and leaving.</p>\n<h2 id='syncing-state-from-the-server' class='heading'>Syncing state from the server</h2>\n\n<p>To sync presence state from the server, first instantiate an object and pass\nyour channel in to track lifecycle events:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"some:topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>If you have custom syncing state events, you can configure the <code>Presence</code>\nobject to use those instead.</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Next, use the presence.onSync callback to react to state changes from the\nserver. For example, to render the list of users every time the list\nchanges, you could write:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n<h2 id='listing-presences' class='heading'>Listing Presences</h2>\n\n<p>presence.list is used to return a list of presence information based on the\nlocal state of metadata. By default, all presence metadata is returned, but\na listBy function can be supplied to allow the client to select which\nmetadata to use for a given presence. For example, you may have a user\nonline from different devices with a metadata status of &ldquo;online&rdquo;, but they\nhave set themselves to &ldquo;away&rdquo; on another device. In this case, the app may\nchoose to use the &ldquo;away&rdquo; status for what appears on the UI. The example\nbelow defines a listBy function which prioritizes the first metadata which\nwas registered for each user. This could be the first tab they opened, or\nthe first device they came online from:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">listBy</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Map</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">pres</span> <span class=\"k\">in</span>\n    <span class=\"k\">let</span> <span class=\"nv\">first</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">first</span><span class=\"o\">!</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"count\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">count</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"id\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">id</span>\n    <span class=\"k\">return</span> <span class=\"n\">first</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">onlineUsers</span> <span class=\"o\">=</span> <span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">(</span><span class=\"nv\">by</span><span class=\"p\">:</span> <span class=\"n\">listBy</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>(NOTE: The underlying behavior is a <code>map</code> on the <code>presence.state</code>. You are\nmapping the <code>state</code> dictionary into whatever datastructure suites your needs)</p>\n<h2 id='handling-individual-presence-join-and-leave-events' class='heading'>Handling individual presence join and leave events</h2>\n\n<p>The presence.onJoin and presence.onLeave callbacks can be used to react to\nindividual presences joining and leaving the app. For example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onJoin</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"k\">let</span> <span class=\"nv\">cur</span> <span class=\"o\">=</span> <span class=\"n\">current</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user additional presence\"</span><span class=\"p\">,</span> <span class=\"n\">cur</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user entered for the first time\"</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onLeave</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"n\">current</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]?</span><span class=\"o\">.</span><span class=\"n\">isEmpty</span> <span class=\"o\">==</span> <span class=\"kc\">true</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user has left from all devices\"</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user left from a device\"</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Enums%20and%20Structs\"></a>\n                <a name=\"//apple_ref/swift/Section/Enums and Structs\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Enums%20and%20Structs\"></a>\n                  <h3 class=\"section-name\"><p>Enums and Structs</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OptionsV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/Options\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OptionsV\">Options</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Custom options that can be provided when creating Presence</p>\n<h3 id='example' class='heading'>Example:</h3>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n                        <a href=\"../Classes/Presence/Options.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Options</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO\"></a>\n                    <a name=\"//apple_ref/swift/Enum/Events\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO\">Events</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Presense Events</p>\n\n                        <a href=\"../Classes/Presence/Events.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">Events</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Typaliases\"></a>\n                <a name=\"//apple_ref/swift/Section/Typaliases\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Typaliases\"></a>\n                  <h3 class=\"section-name\"><p>Typaliases</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4Metaa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Meta\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4Metaa\">Meta</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Meta details of a Presence. Just a dictionary of properties</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC3Mapa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Map\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A mapping of a String to an array of Metas. e.g. {&ldquo;metas&rdquo;: [{id: 1}]}</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Map</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Metaa\">Meta</a></span><span class=\"p\">]]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC5Statea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/State\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A mapping of a Presence state to a mapping of Metas</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">State</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4Diffa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Diff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Diff</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6OnJoina\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnJoin\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Closure signature of OnJoin callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnJoin</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">key</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">current</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">?,</span> <span class=\"n\">_</span> <span class=\"nv\">new</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OnLeavea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnLeave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Closure signature for OnLeave callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnLeave</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">key</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">current</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">left</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6OnSynca\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnSync\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>/ Closure signature for OnSync callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnSync</span> <span class=\"o\">=</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Properties\"></a>\n                <a name=\"//apple_ref/swift/Section/Properties\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Properties\"></a>\n                  <h3 class=\"section-name\"><p>Properties</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/state\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\">state</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The state of the Presence</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/pendingDiffs\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\">pendingDiffs</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Pending <code>join</code> and <code>leave</code> diffs that need to be synced</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">pendingDiffs</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/joinRef\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\">joinRef</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The channel&rsquo;s joinRef, set when state events occur</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">joinRef</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isPendingSyncState\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\">isPendingSyncState</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isPendingSyncState</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onJoin\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\">onJoin</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of joins</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onJoin(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\">onJoin(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnJoin callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onJoin</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onLeave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\">onLeave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of leaves</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onLeave(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\">onLeave(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnLeave callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onLeave</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onSync\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\">onSync</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of synces</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onSync</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onSync(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\">onSync(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnSync callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onSync</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(channel:opts:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\">init(channel:opts:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence/Options.html\">Options</a></span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Presence/Options.html\">Options</a></span><span class=\"o\">.</span><span class=\"n\">defaults</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/list()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\">list()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Returns the array of presences, with deault selected metadata.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">list</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\"></a>\n                    <a name=\"//apple_ref/swift/Method/list(by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\">list(by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Returns the array of presences, with selected metadata</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">list</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">by</span> <span class=\"nv\">transformer</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">T</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/filter(by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\">filter(by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Filter the Presence state with a given function</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">filter</span><span class=\"p\">(</span><span class=\"n\">by</span> <span class=\"nv\">filter</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Bool</span><span class=\"p\">)?)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Static\"></a>\n                <a name=\"//apple_ref/swift/Section/Static\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Static\"></a>\n                  <h3 class=\"section-name\"><p>Static</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/syncState(_:newState:onJoin:onLeave:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\">syncState(_:newState:onJoin:onLeave:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">syncState</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">currentState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">newState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">},</span>\n                             <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">})</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/syncDiff(_:diff:onJoin:onLeave:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\">syncDiff(_:diff:onJoin:onLeave:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">syncDiff</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">currentState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                            <span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a></span><span class=\"p\">,</span>\n                            <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">},</span>\n                            <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">})</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/filter(_:by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\">filter(_:by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">filter</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">presences</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                          <span class=\"n\">by</span> <span class=\"nv\">filter</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Bool</span><span class=\"p\">)?)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/listBy(_:transformer:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\">listBy(_:transformer:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"n\">listBy</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">presences</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">transformer</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">T</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Push.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Push Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Push\" class=\"dashAnchor\"></a>\n    <a title=\"Push Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Push Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Push</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Push</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represnts pushing data to a <code><a href=\"../Classes/Channel.html\">Channel</a></code> through the <code><a href=\"../Classes/Socket.html\">Socket</a></code></p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/channel\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\">channel</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The channel sending the Push</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">weak</span> <span class=\"k\">var</span> <span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC5eventSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/event\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC5eventSSvp\">event</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The event, for example <code>phx_join</code></p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\">payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The payload, for example [&ldquo;user_id&rdquo;: &ldquo;abc123&rdquo;]</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7timeoutSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/timeout\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7timeoutSdvp\">timeout</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The push timeout. Default is 10.0 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC6resendyySdF\"></a>\n                    <a name=\"//apple_ref/swift/Method/resend(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC6resendyySdF\">resend(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Resets and sends the Push</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">resend</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. The push timeout. Default is 10.0s</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC4sendyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/send()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC4sendyyF\">send()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Sends the Push. If it has already timed out, then the call will\nbe ignored and return early. Use <code>resend</code> in this case.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">send</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\"></a>\n                    <a name=\"//apple_ref/swift/Method/receive(_:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\">receive(_:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Receive a specific event when sending an Outbound message. Subscribing\nto status events with this method does not guarantees no retain cycles.\nYou should pass <code>weak self</code> in the capture list of the callback. You\ncan call `.delegateReceive(status:, to:, callback:) and the library will\nhandle it for you.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">send</span><span class=\"p\">(</span><span class=\"nv\">event</span><span class=\"p\">:</span><span class=\"s\">\"custom\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"body\"</span><span class=\"p\">:</span> <span class=\"s\">\"example\"</span><span class=\"p\">])</span>\n    <span class=\"o\">.</span><span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"s\">\"error\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"n\">payload</span> <span class=\"k\">in</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Error: \"</span><span class=\"p\">,</span> <span class=\"n\">payload</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                    <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">()))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>status</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Status to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Callback to fire when the status is recevied</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateReceive(_:to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\">delegateReceive(_:to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Receive a specific event when sending an Outbound message. Automatically\nprevents retain cycles. See <code>manualReceive(status:, callback:)</code> if you\nwant to handle this yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">send</span><span class=\"p\">(</span><span class=\"nv\">event</span><span class=\"p\">:</span><span class=\"s\">\"custom\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"body\"</span><span class=\"p\">:</span> <span class=\"s\">\"example\"</span><span class=\"p\">])</span>\n    <span class=\"o\">.</span><span class=\"nf\">delegateReceive</span><span class=\"p\">(</span><span class=\"s\">\"error\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">payload</span> <span class=\"k\">in</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Error: \"</span><span class=\"p\">,</span> <span class=\"n\">payload</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateReceive</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                                               <span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">()))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>status</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Status to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The class that is calling .receive. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Callback to fire when the status is recevied</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes/Socket.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Socket Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Socket\" class=\"dashAnchor\"></a>\n    <a title=\"Socket Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Socket Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Socket</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Socket</span></code></pre>\n<pre class=\"highlight swift\"><code><span class=\"kd\">extension</span> <span class=\"kt\">Socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketDelegate</span></code></pre>\n\n                </div>\n              </div>\n            <h2 id='socket-connection' class='heading'>Socket Connection</h2>\n\n<p>A single connection is established to the server and\nchannels are multiplexed over the connection.\nConnect to the server using the <code>Socket</code> class:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">socket</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"kt\">Socket</span><span class=\"p\">(</span><span class=\"s\">\"/socket\"</span><span class=\"p\">,</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"s\">\"userToken\"</span><span class=\"p\">:</span> <span class=\"s\">\"123\"</span> <span class=\"p\">]</span> <span class=\"p\">})</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">connect</span><span class=\"p\">()</span>\n</code></pre>\n\n<p>The <code>Socket</code> constructor takes the mount point of the socket,\nthe authentication params, as well as options that can be found in\nthe Socket docs, such as configuring the heartbeat.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public%20Attributes\"></a>\n                <a name=\"//apple_ref/swift/Section/Public Attributes\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public%20Attributes\"></a>\n                  <h3 class=\"section-name\"><p>Public Attributes</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC8endPointSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/endPoint\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC8endPointSSvp\">endPoint</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The string WebSocket endpoint (ie <code>&quot;ws://example.com/socket&quot;</code>,\n<code>&quot;wss://example.com&quot;</code>, etc.) That was passed to the Socket during\ninitialization. The URL endpoint will be modified by the Socket to\ninclude <code>&quot;/websocket&quot;</code> if missing.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/endPointUrl\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\">endPointUrl</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The fully qualified socket URL</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">private(set)</span> <span class=\"k\">var</span> <span class=\"nv\">endPointUrl</span><span class=\"p\">:</span> <span class=\"kt\">URL</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/params\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\">params</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Resolves to return the <code><a href=\"../Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\">paramsClosure</a></code> result at the time of calling.\nIf the <code>Socket</code> was created with static params, then those will be\nreturned every time.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/paramsClosure\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\">paramsClosure</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The optional params closure used to get params whhen connecting. Must\nbe set when initializaing the Socket.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/encode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\">encode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Override to provide custom encoding of data before writing to the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">encode</span><span class=\"p\">:</span> <span class=\"p\">([</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/decode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\">decode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Override to provide customd decoding of data read from the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">decode</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/timeout\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\">timeout</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Timeout to use when opening connections</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/heartbeatInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\">heartbeatInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between sending a heartbeat</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">heartbeatInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/reconnectAfter\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\">reconnectAfter</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between socket reconnect attempts, in seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">reconnectAfter</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/rejoinAfter\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\">rejoinAfter</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between channel rejoin attempts, in seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">rejoinAfter</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/logger\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\">logger</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The optional function to receive logs</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">logger</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/skipHeartbeat\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\">skipHeartbeat</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Disables heartbeats from being sent. Default is false.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">skipHeartbeat</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/disableSSLCertValidation\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\">disableSSLCertValidation</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Enable/Disable SSL certificate validation. Default is false. This\nmust be set before calling <code>socket.connect()</code> in order to be applied</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">disableSSLCertValidation</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/security\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\">security</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Configure custom SSL validation logic, eg. SSL pinning. This\nmust be set before calling <code>socket.connect()</code> in order to apply.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">security</span><span class=\"p\">:</span> <span class=\"kt\">SSLTrustValidator</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/enabledSSLCipherSuites\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\">enabledSSLCipherSuites</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Configure the encryption used by your client by setting the\nallowed cipher suites supported by your server. This must be\nset before calling <code>socket.connect()</code> in order to apply.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">enabledSSLCipherSuites</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">SSLCipherSuite</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Initialization\"></a>\n                <a name=\"//apple_ref/swift/Section/Initialization\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Initialization\"></a>\n                  <h3 class=\"section-name\"><p>Initialization</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(_:params:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\">init(_:params:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"n\">convenience</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                        <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(_:paramsClosure:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\">init(_:paramsClosure:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"n\">convenience</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                        <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a></span><span class=\"p\">?)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public\"></a>\n                <a name=\"//apple_ref/swift/Section/Public\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public\"></a>\n                  <h3 class=\"section-name\"><p>Public</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/websocketProtocol\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\">websocketProtocol</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: The socket protocol, wss or ws</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">websocketProtocol</span><span class=\"p\">:</span> <span class=\"kt\">String</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isConnected\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\">isConnected</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the socket is connected</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isConnected</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7connectyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/connect()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7connectyyF\">connect()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Connects the Socket. The params passed to the Socket on initialization\nwill be sent through the connection. If the Socket is already connected,\nthen this call will be ignored.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">connect</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/disconnect(code:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\">disconnect(code:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Disconnects the socket</p>\n\n<ul>\n<li>paramter callback: Optional. Called when disconnected</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">disconnect</span><span class=\"p\">(</span><span class=\"nv\">code</span><span class=\"p\">:</span> <span class=\"kt\">CloseCode</span> <span class=\"o\">=</span> <span class=\"kt\">CloseCode</span><span class=\"o\">.</span><span class=\"n\">normal</span><span class=\"p\">,</span>\n                       <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"p\">(()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>code</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Closing status code</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Register%20Socket%20State%20Callbacks\"></a>\n                <a name=\"//apple_ref/swift/Section/Register Socket State Callbacks\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Register%20Socket%20State%20Callbacks\"></a>\n                  <h3 class=\"section-name\"><p>Register Socket State Callbacks</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onOpen(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\">onOpen(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection open events. Does not handle retain\ncycles. Use <code>delegateOnOpen(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onOpen</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Open\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onOpen</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is opened</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnOpen(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\">delegateOnOpen(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection open events. Automatically handles\nretain cycles. Use <code>onOpen()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnOpen</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"k\">self</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Open\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnOpen</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                         <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is opened</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onClose(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\">onClose(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection close events. Does not handle retain\ncycles. Use <code>delegateOnClose(_:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onClose</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Close\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onClose</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is closed</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnClose(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\">delegateOnClose(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection close events. Automatically handles\nretain cycles. Use <code>onClose()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnClose</span><span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"k\">self</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Close\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnClose</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is closed</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onError(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\">onError(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection error events. Does not handle retain\ncycles. Use <code>delegateOnError(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onError</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">error</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Error\"</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onError</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Error</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket errors</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnError(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\">delegateOnError(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection error events. Automatically handles\nretain cycles. Use <code>manualOnError()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnError</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Error\"</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnError</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">,</span> <span class=\"kt\">Error</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket errors</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onMessage(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\">onMessage(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection message events. Does not handle\nretain cycles. Use <code>delegateOnMessage(_to:)</code> for automatic handling of\nretain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onMessage</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Message\"</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onMessage</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket receives a message event</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnMessage(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\">delegateOnMessage(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection message events. Automatically handles\nretain cycles. Use <code>onMessage()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnMessage</span><span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Message\"</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnMessage</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                            <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket receives a message event</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/releaseCallbacks()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\">releaseCallbacks()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should\ncall this method when you are finished when the Socket in order to release\nany references held by the socket.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">releaseCallbacks</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Channel%20Initialization\"></a>\n                <a name=\"//apple_ref/swift/Section/Channel Initialization\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Channel%20Initialization\"></a>\n                  <h3 class=\"section-name\"><p>Channel Initialization</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/channel(_:params:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\">channel(_:params:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Initialize a new Channel</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"rooms\"</span><span class=\"p\">,</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"user_id\"</span><span class=\"p\">:</span> <span class=\"s\">\"abc123\"</span><span class=\"p\">])</span>\n</code></pre>\n\n<ul>\n<li>return: A new channel</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                    <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">String</span><span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"p\">[:])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>topic</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Topic of the channel</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>params</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Parameters for the channel</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\"></a>\n                    <a name=\"//apple_ref/swift/Method/remove(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\">remove(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Removes the Channel from the socket. This does not cause the channel to\ninform the server that it is leaving. You should call channel.leave()\nprior to removing the Channel.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">leave</span><span class=\"p\">()</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">remove</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">remove</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>channel</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Channel to remove</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Sending%20Data\"></a>\n                <a name=\"//apple_ref/swift/Section/Sending Data\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Sending%20Data\"></a>\n                  <h3 class=\"section-name\"><p>Sending Data</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/makeRef()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\">makeRef()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: the next message ref, accounting for overflows</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">makeRef</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/WebSocketDelegate\"></a>\n                <a name=\"//apple_ref/swift/Section/WebSocketDelegate\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/WebSocketDelegate\"></a>\n                  <h3 class=\"section-name\"><p>WebSocketDelegate</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidConnect(socket:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\">websocketDidConnect(socket:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidConnect</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidDisconnect(socket:error:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\">websocketDidDisconnect(socket:error:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidDisconnect</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">error</span><span class=\"p\">:</span> <span class=\"kt\">Error</span><span class=\"p\">?)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidReceiveMessage(socket:text:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\">websocketDidReceiveMessage(socket:text:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidReceiveMessage</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">text</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidReceiveData(socket:data:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\">websocketDidReceiveData(socket:data:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidReceiveData</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">data</span><span class=\"p\">:</span> <span class=\"kt\">Data</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Classes.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Classes  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Classes\" class=\"dashAnchor\"></a>\n    <a title=\"Classes  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Classes  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Classes</h1>\n            <p>The following classes are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Channel\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC\">Channel</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                        <a href=\"Classes/Channel.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Channel</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Message\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC\">Message</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Data that is received from the Server.</p>\n\n                        <a href=\"Classes/Message.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Message</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Presence\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC\">Presence</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The Presence object provides features for syncing presence information from\nthe server with the client and handling presences joining and leaving.</p>\n<h2 id='syncing-state-from-the-server' class='heading'>Syncing state from the server</h2>\n\n<p>To sync presence state from the server, first instantiate an object and pass\nyour channel in to track lifecycle events:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"some:topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>If you have custom syncing state events, you can configure the <code>Presence</code>\nobject to use those instead.</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Next, use the presence.onSync callback to react to state changes from the\nserver. For example, to render the list of users every time the list\nchanges, you could write:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n<h2 id='listing-presences' class='heading'>Listing Presences</h2>\n\n<p>presence.list is used to return a list of presence information based on the\nlocal state of metadata. By default, all presence metadata is returned, but\na listBy function can be supplied to allow the client to select which\nmetadata to use for a given presence. For example, you may have a user\nonline from different devices with a metadata status of &ldquo;online&rdquo;, but they\nhave set themselves to &ldquo;away&rdquo; on another device. In this case, the app may\nchoose to use the &ldquo;away&rdquo; status for what appears on the UI. The example\nbelow defines a listBy function which prioritizes the first metadata which\nwas registered for each user. This could be the first tab they opened, or\nthe first device they came online from:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">listBy</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Map</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">pres</span> <span class=\"k\">in</span>\n    <span class=\"k\">let</span> <span class=\"nv\">first</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">first</span><span class=\"o\">!</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"count\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">count</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"id\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">id</span>\n    <span class=\"k\">return</span> <span class=\"n\">first</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">onlineUsers</span> <span class=\"o\">=</span> <span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">(</span><span class=\"nv\">by</span><span class=\"p\">:</span> <span class=\"n\">listBy</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>(NOTE: The underlying behavior is a <code>map</code> on the <code>presence.state</code>. You are\nmapping the <code>state</code> dictionary into whatever datastructure suites your needs)</p>\n<h2 id='handling-individual-presence-join-and-leave-events' class='heading'>Handling individual presence join and leave events</h2>\n\n<p>The presence.onJoin and presence.onLeave callbacks can be used to react to\nindividual presences joining and leaving the app. For example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onJoin</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"k\">let</span> <span class=\"nv\">cur</span> <span class=\"o\">=</span> <span class=\"n\">current</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user additional presence\"</span><span class=\"p\">,</span> <span class=\"n\">cur</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user entered for the first time\"</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onLeave</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"n\">current</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]?</span><span class=\"o\">.</span><span class=\"n\">isEmpty</span> <span class=\"o\">==</span> <span class=\"kc\">true</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user has left from all devices\"</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user left from a device\"</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n\n                        <a href=\"Classes/Presence.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">final</span> <span class=\"kd\">class</span> <span class=\"kt\">Presence</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Push\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC\">Push</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represnts pushing data to a <code><a href=\"Classes/Channel.html\">Channel</a></code> through the <code><a href=\"Classes/Socket.html\">Socket</a></code></p>\n\n                        <a href=\"Classes/Push.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Socket\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC\">Socket</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <h2 id='socket-connection' class='heading'>Socket Connection</h2>\n\n<p>A single connection is established to the server and\nchannels are multiplexed over the connection.\nConnect to the server using the <code>Socket</code> class:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">socket</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"kt\">Socket</span><span class=\"p\">(</span><span class=\"s\">\"/socket\"</span><span class=\"p\">,</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"s\">\"userToken\"</span><span class=\"p\">:</span> <span class=\"s\">\"123\"</span> <span class=\"p\">]</span> <span class=\"p\">})</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">connect</span><span class=\"p\">()</span>\n</code></pre>\n\n<p>The <code>Socket</code> constructor takes the mount point of the socket,\nthe authentication params, as well as options that can be found in\nthe Socket docs, such as configuring the heartbeat.</p>\n\n                        <a href=\"Classes/Socket.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Socket</span></code></pre>\n<pre class=\"highlight swift\"><code><span class=\"kd\">extension</span> <span class=\"kt\">Socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketDelegate</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Defaults\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC\">Defaults</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A collection of default values and behaviors used accross the Client</p>\n\n                        <a href=\"Classes/Defaults.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Defaults</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Enums/ChannelState.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>ChannelState Enumeration Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Enum/ChannelState\" class=\"dashAnchor\"></a>\n    <a title=\"ChannelState Enumeration Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        ChannelState Enumeration Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>ChannelState</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">ChannelState</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represents the multiple states that a Channel can be in\nthroughout it&rsquo;s lifecycle.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/closed\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\">closed</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">closed</span> <span class=\"o\">=</span> <span class=\"s\">\"closed\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/errored\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\">errored</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">errored</span> <span class=\"o\">=</span> <span class=\"s\">\"errored\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/joined\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\">joined</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">joined</span> <span class=\"o\">=</span> <span class=\"s\">\"joined\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/joining\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\">joining</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">joining</span> <span class=\"o\">=</span> <span class=\"s\">\"joining\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/leaving\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\">leaving</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">leaving</span> <span class=\"o\">=</span> <span class=\"s\">\"leaving\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Enums.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Enumerations  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Enumerations\" class=\"dashAnchor\"></a>\n    <a title=\"Enumerations  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Enumerations  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Enumerations</h1>\n            <p>The following enumerations are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO\"></a>\n                    <a name=\"//apple_ref/swift/Enum/ChannelState\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO\">ChannelState</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represents the multiple states that a Channel can be in\nthroughout it&rsquo;s lifecycle.</p>\n\n                        <a href=\"Enums/ChannelState.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">ChannelState</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Global Variables.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Global Variables  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Global Variables\" class=\"dashAnchor\"></a>\n    <a title=\"Global Variables  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (70% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Global Variables  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\">PHOENIX_HEARTBEAT_INTERVAL</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\">PHOENIX_TIMEOUT_INTERVAL</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Global Variables</h1>\n            <p>The following global variables are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_DEFAULT_TIMEOUT\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default timeout when making a connection set to 10 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_DEFAULT_TIMEOUT</span><span class=\"p\">:</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_TIMEOUT_INTERVAL\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\">PHOENIX_TIMEOUT_INTERVAL</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_TIMEOUT_INTERVAL</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_DEFAULT_HEARTBEAT\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default heartbeat interval set to 30 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_DEFAULT_HEARTBEAT</span><span class=\"p\">:</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_HEARTBEAT_INTERVAL\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\">PHOENIX_HEARTBEAT_INTERVAL</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default heartbeat interval set to 30.0 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_HEARTBEAT_INTERVAL</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-04-02)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Protocols/Serializer.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Serializer Protocol Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Protocol/Serializer\" class=\"dashAnchor\"></a>\n    <a title=\"Serializer Protocol Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (50% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Serializer Protocol Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/PresenceEventType.html\">– PresenceEventType</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC0D7OptionsV\">– PresenceOptions</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/SocketState.html\">SocketState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Protocols.html\">Protocols</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Protocols/Serializer.html\">Serializer</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Serializer</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">protocol</span> <span class=\"kt\">Serializer</span></code></pre>\n\n                </div>\n              </div>\n            <p>Provides customization when enoding and decoding data within the Socket</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP6encodey10Foundation4DataVSDySSypGKF\"></a>\n                    <a name=\"//apple_ref/swift/Method/encode(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP6encodey10Foundation4DataVSDySSypGKF\">encode(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convert a message into Data to be sent over the Socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">func</span> <span class=\"nf\">encode</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">message</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"k\">throws</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP6decodeyAA7MessageCSg10Foundation4DataVF\"></a>\n                    <a name=\"//apple_ref/swift/Method/decode(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP6decodeyAA7MessageCSg10Foundation4DataVF\">decode(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convert data from the Socket into a Message</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">func</span> <span class=\"nf\">decode</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">data</span><span class=\"p\">:</span> <span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-02-10)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Protocols.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Protocols  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Protocols\" class=\"dashAnchor\"></a>\n    <a title=\"Protocols  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (50% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Protocols  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/PresenceEventType.html\">– PresenceEventType</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC0D7OptionsV\">– PresenceOptions</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/SocketState.html\">SocketState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Protocols.html\">Protocols</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Protocols/Serializer.html\">Serializer</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Protocols</h1>\n            <p>The following protocols are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP\"></a>\n                    <a name=\"//apple_ref/swift/Protocol/Serializer\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP\">Serializer</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Provides customization when enoding and decoding data within the Socket</p>\n\n                        <a href=\"Protocols/Serializer.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">protocol</span> <span class=\"kt\">Serializer</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-02-10)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Structs/ChannelEvent.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>ChannelEvent Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/ChannelEvent\" class=\"dashAnchor\"></a>\n    <a title=\"ChannelEvent Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        ChannelEvent Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>ChannelEvent</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">ChannelEvent</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represents the different events that can be sent through\na channel regarding a Channel&rsquo;s lifecycle.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/heartbeat\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\">heartbeat</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">heartbeat</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/join\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\">join</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">join</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/leave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\">leave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">leave</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/reply\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\">reply</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">reply</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/error\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\">error</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">error</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/close\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\">close</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">close</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Structs/Delegated.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Delegated Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/Delegated\" class=\"dashAnchor\"></a>\n    <a title=\"Delegated Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Delegated Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Delegated</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Delegated</span><span class=\"o\">&lt;</span><span class=\"kt\">Input</span><span class=\"p\">,</span> <span class=\"kt\">Output</span><span class=\"o\">&gt;</span></code></pre>\n\n                </div>\n              </div>\n            <p>Provides a memory-safe way of passing callbacks around while not creating\nretain cycles. This file was copied from <a href=\"https://github.com/dreymonde/Delegated\">https://github.com/dreymonde/Delegated</a>\ninstead of added as a dependency to reduce the number of packages that\nship with SwiftPhoenixClient</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\">init()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"nf\">init</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\">delegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">delegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                  <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\">call(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">input</span><span class=\"p\">:</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isDelegateSet\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\">isDelegateSet</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isDelegateSet</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/stronglyDelegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\">stronglyDelegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">stronglyDelegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                          <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/manuallyDelegate(with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\">manuallyDelegate(with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"nf\">manuallyDelegate</span><span class=\"p\">(</span><span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/removeDelegate()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\">removeDelegate()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"nf\">removeDelegate</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Input%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Input` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Input%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Input</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\">delegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">delegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                  <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/stronglyDelegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\">stronglyDelegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">stronglyDelegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                          <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\">call()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Output%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Output` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Output%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Output</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\">call(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">input</span><span class=\"p\">:</span> <span class=\"kt\">Input</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Input%60%20==%20%60Void%60,%20%60Output%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Input` == `Void`, `Output` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Input%60%20==%20%60Void%60,%20%60Output%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Input</code> == <code>Void</code>, <code>Output</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\">call()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Structs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Structures  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Structures\" class=\"dashAnchor\"></a>\n    <a title=\"Structures  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Structures  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Structures</h1>\n            <p>The following structures are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/ChannelEvent\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV\">ChannelEvent</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represents the different events that can be sent through\na channel regarding a Channel&rsquo;s lifecycle.</p>\n\n                        <a href=\"Structs/ChannelEvent.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">ChannelEvent</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/Delegated\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV\">Delegated</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Provides a memory-safe way of passing callbacks around while not creating\nretain cycles. This file was copied from <a href=\"https://github.com/dreymonde/Delegated\">https://github.com/dreymonde/Delegated</a>\ninstead of added as a dependency to reduce the number of packages that\nship with SwiftPhoenixClient</p>\n\n                        <a href=\"Structs/Delegated.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Delegated</span><span class=\"o\">&lt;</span><span class=\"kt\">Input</span><span class=\"p\">,</span> <span class=\"kt\">Output</span><span class=\"o\">&gt;</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/Typealiases.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Type Aliases  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Type Aliases\" class=\"dashAnchor\"></a>\n    <a title=\"Type Aliases  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Type Aliases  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Type Aliases</h1>\n            <p>The following type aliases are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7Payloada\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Alias for a JSON dictionary [String: Any]</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Payload</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient14PayloadClosurea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/PayloadClosure\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Alias for a function returning an optional JSON dictionary (<code>Payload?</code>)</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">PayloadClosure</span> <span class=\"o\">=</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/css/highlight.css",
    "content": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n  /* Comment */\n  /* Error */\n  /* Keyword */\n  /* Operator */\n  /* Comment.Multiline */\n  /* Comment.Preproc */\n  /* Comment.Single */\n  /* Comment.Special */\n  /* Generic.Deleted */\n  /* Generic.Deleted.Specific */\n  /* Generic.Emph */\n  /* Generic.Error */\n  /* Generic.Heading */\n  /* Generic.Inserted */\n  /* Generic.Inserted.Specific */\n  /* Generic.Output */\n  /* Generic.Prompt */\n  /* Generic.Strong */\n  /* Generic.Subheading */\n  /* Generic.Traceback */\n  /* Keyword.Constant */\n  /* Keyword.Declaration */\n  /* Keyword.Pseudo */\n  /* Keyword.Reserved */\n  /* Keyword.Type */\n  /* Literal.Number */\n  /* Literal.String */\n  /* Name.Attribute */\n  /* Name.Builtin */\n  /* Name.Class */\n  /* Name.Constant */\n  /* Name.Entity */\n  /* Name.Exception */\n  /* Name.Function */\n  /* Name.Namespace */\n  /* Name.Tag */\n  /* Name.Variable */\n  /* Operator.Word */\n  /* Text.Whitespace */\n  /* Literal.Number.Float */\n  /* Literal.Number.Hex */\n  /* Literal.Number.Integer */\n  /* Literal.Number.Oct */\n  /* Literal.String.Backtick */\n  /* Literal.String.Char */\n  /* Literal.String.Doc */\n  /* Literal.String.Double */\n  /* Literal.String.Escape */\n  /* Literal.String.Heredoc */\n  /* Literal.String.Interpol */\n  /* Literal.String.Other */\n  /* Literal.String.Regex */\n  /* Literal.String.Single */\n  /* Literal.String.Symbol */\n  /* Name.Builtin.Pseudo */\n  /* Name.Variable.Class */\n  /* Name.Variable.Global */\n  /* Name.Variable.Instance */\n  /* Literal.Number.Integer.Long */ }\n  .highlight .c {\n    color: #999988;\n    font-style: italic; }\n  .highlight .err {\n    color: #a61717;\n    background-color: #e3d2d2; }\n  .highlight .k {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .o {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .cm {\n    color: #999988;\n    font-style: italic; }\n  .highlight .cp {\n    color: #999999;\n    font-weight: bold; }\n  .highlight .c1 {\n    color: #999988;\n    font-style: italic; }\n  .highlight .cs {\n    color: #999999;\n    font-weight: bold;\n    font-style: italic; }\n  .highlight .gd {\n    color: #000000;\n    background-color: #ffdddd; }\n  .highlight .gd .x {\n    color: #000000;\n    background-color: #ffaaaa; }\n  .highlight .ge {\n    color: #000000;\n    font-style: italic; }\n  .highlight .gr {\n    color: #aa0000; }\n  .highlight .gh {\n    color: #999999; }\n  .highlight .gi {\n    color: #000000;\n    background-color: #ddffdd; }\n  .highlight .gi .x {\n    color: #000000;\n    background-color: #aaffaa; }\n  .highlight .go {\n    color: #888888; }\n  .highlight .gp {\n    color: #555555; }\n  .highlight .gs {\n    font-weight: bold; }\n  .highlight .gu {\n    color: #aaaaaa; }\n  .highlight .gt {\n    color: #aa0000; }\n  .highlight .kc {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kd {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kp {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kr {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kt {\n    color: #445588; }\n  .highlight .m {\n    color: #009999; }\n  .highlight .s {\n    color: #d14; }\n  .highlight .na {\n    color: #008080; }\n  .highlight .nb {\n    color: #0086B3; }\n  .highlight .nc {\n    color: #445588;\n    font-weight: bold; }\n  .highlight .no {\n    color: #008080; }\n  .highlight .ni {\n    color: #800080; }\n  .highlight .ne {\n    color: #990000;\n    font-weight: bold; }\n  .highlight .nf {\n    color: #990000; }\n  .highlight .nn {\n    color: #555555; }\n  .highlight .nt {\n    color: #000080; }\n  .highlight .nv {\n    color: #008080; }\n  .highlight .ow {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .w {\n    color: #bbbbbb; }\n  .highlight .mf {\n    color: #009999; }\n  .highlight .mh {\n    color: #009999; }\n  .highlight .mi {\n    color: #009999; }\n  .highlight .mo {\n    color: #009999; }\n  .highlight .sb {\n    color: #d14; }\n  .highlight .sc {\n    color: #d14; }\n  .highlight .sd {\n    color: #d14; }\n  .highlight .s2 {\n    color: #d14; }\n  .highlight .se {\n    color: #d14; }\n  .highlight .sh {\n    color: #d14; }\n  .highlight .si {\n    color: #d14; }\n  .highlight .sx {\n    color: #d14; }\n  .highlight .sr {\n    color: #009926; }\n  .highlight .s1 {\n    color: #d14; }\n  .highlight .ss {\n    color: #990073; }\n  .highlight .bp {\n    color: #999999; }\n  .highlight .vc {\n    color: #008080; }\n  .highlight .vg {\n    color: #008080; }\n  .highlight .vi {\n    color: #008080; }\n  .highlight .il {\n    color: #009999; }\n"
  },
  {
    "path": "docs/css/jazzy.css",
    "content": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n  background: transparent;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n  vertical-align: baseline; }\n\nbody {\n  background-color: #f2f2f2;\n  font-family: Helvetica, freesans, Arial, sans-serif;\n  font-size: 14px;\n  -webkit-font-smoothing: subpixel-antialiased;\n  word-wrap: break-word; }\n\nh1, h2, h3 {\n  margin-top: 0.8em;\n  margin-bottom: 0.3em;\n  font-weight: 100;\n  color: black; }\n\nh1 {\n  font-size: 2.5em; }\n\nh2 {\n  font-size: 2em;\n  border-bottom: 1px solid #e2e2e2; }\n\nh4 {\n  font-size: 13px;\n  line-height: 1.5;\n  margin-top: 21px; }\n\nh5 {\n  font-size: 1.1em; }\n\nh6 {\n  font-size: 1.1em;\n  color: #777; }\n\n.section-name {\n  color: gray;\n  display: block;\n  font-family: Helvetica;\n  font-size: 22px;\n  font-weight: 100;\n  margin-bottom: 15px; }\n\npre, code {\n  font: 0.95em Menlo, monospace;\n  color: #777;\n  word-wrap: normal; }\n\np code, li code {\n  background-color: #eee;\n  padding: 2px 4px;\n  border-radius: 4px; }\n\na {\n  color: #0088cc;\n  text-decoration: none; }\n\nul {\n  padding-left: 15px; }\n\nli {\n  line-height: 1.8em; }\n\nimg {\n  max-width: 100%; }\n\nblockquote {\n  margin-left: 0;\n  padding: 0 10px;\n  border-left: 4px solid #ccc; }\n\n.content-wrapper {\n  margin: 0 auto;\n  width: 980px; }\n\nheader {\n  font-size: 0.85em;\n  line-height: 26px;\n  background-color: #414141;\n  position: fixed;\n  width: 100%;\n  z-index: 2; }\n  header img {\n    padding-right: 6px;\n    vertical-align: -4px;\n    height: 16px; }\n  header a {\n    color: #fff; }\n  header p {\n    float: left;\n    color: #999; }\n  header .header-right {\n    float: right;\n    margin-left: 16px; }\n\n#breadcrumbs {\n  background-color: #f2f2f2;\n  height: 27px;\n  padding-top: 17px;\n  position: fixed;\n  width: 100%;\n  z-index: 2;\n  margin-top: 26px; }\n  #breadcrumbs #carat {\n    height: 10px;\n    margin: 0 5px; }\n\n.sidebar {\n  background-color: #f9f9f9;\n  border: 1px solid #e2e2e2;\n  overflow-y: auto;\n  overflow-x: hidden;\n  position: fixed;\n  top: 70px;\n  bottom: 0;\n  width: 230px;\n  word-wrap: normal; }\n\n.nav-groups {\n  list-style-type: none;\n  background: #fff;\n  padding-left: 0; }\n\n.nav-group-name {\n  border-bottom: 1px solid #e2e2e2;\n  font-size: 1.1em;\n  font-weight: 100;\n  padding: 15px 0 15px 20px; }\n  .nav-group-name > a {\n    color: #333; }\n\n.nav-group-tasks {\n  margin-top: 5px; }\n\n.nav-group-task {\n  font-size: 0.9em;\n  list-style-type: none;\n  white-space: nowrap; }\n  .nav-group-task a {\n    color: #888; }\n\n.main-content {\n  background-color: #fff;\n  border: 1px solid #e2e2e2;\n  margin-left: 246px;\n  position: absolute;\n  overflow: hidden;\n  padding-bottom: 20px;\n  top: 70px;\n  width: 734px; }\n  .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {\n    margin-bottom: 1em; }\n  .main-content p {\n    line-height: 1.8em; }\n  .main-content section .section:first-child {\n    margin-top: 0;\n    padding-top: 0; }\n  .main-content section .task-group-section .task-group:first-of-type {\n    padding-top: 10px; }\n    .main-content section .task-group-section .task-group:first-of-type .section-name {\n      padding-top: 15px; }\n  .main-content section .heading:before {\n    content: \"\";\n    display: block;\n    padding-top: 70px;\n    margin: -70px 0 0; }\n  .main-content .section-name p {\n    margin-bottom: inherit;\n    line-height: inherit; }\n  .main-content .section-name code {\n    background-color: inherit;\n    padding: inherit;\n    color: inherit; }\n\n.section {\n  padding: 0 25px; }\n\n.highlight {\n  background-color: #eee;\n  padding: 10px 12px;\n  border: 1px solid #e2e2e2;\n  border-radius: 4px;\n  overflow-x: auto; }\n\n.declaration .highlight {\n  overflow-x: initial;\n  padding: 0 40px 40px 0;\n  margin-bottom: -25px;\n  background-color: transparent;\n  border: none; }\n\n.section-name {\n  margin: 0;\n  margin-left: 18px; }\n\n.task-group-section {\n  padding-left: 6px;\n  border-top: 1px solid #e2e2e2; }\n\n.task-group {\n  padding-top: 0px; }\n\n.task-name-container a[name]:before {\n  content: \"\";\n  display: block;\n  padding-top: 70px;\n  margin: -70px 0 0; }\n\n.section-name-container {\n  position: relative;\n  display: inline-block; }\n  .section-name-container .section-name-link {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin-bottom: 0; }\n  .section-name-container .section-name {\n    position: relative;\n    pointer-events: none;\n    z-index: 1; }\n    .section-name-container .section-name a {\n      pointer-events: auto; }\n\n.item {\n  padding-top: 8px;\n  width: 100%;\n  list-style-type: none; }\n  .item a[name]:before {\n    content: \"\";\n    display: block;\n    padding-top: 70px;\n    margin: -70px 0 0; }\n  .item code {\n    background-color: transparent;\n    padding: 0; }\n  .item .token, .item .direct-link {\n    padding-left: 3px;\n    margin-left: 15px;\n    font-size: 11.9px;\n    transition: all 300ms; }\n  .item .token-open {\n    margin-left: 0px; }\n  .item .discouraged {\n    text-decoration: line-through; }\n  .item .declaration-note {\n    font-size: .85em;\n    color: gray;\n    font-style: italic; }\n\n.pointer-container {\n  border-bottom: 1px solid #e2e2e2;\n  left: -23px;\n  padding-bottom: 13px;\n  position: relative;\n  width: 110%; }\n\n.pointer {\n  background: #f9f9f9;\n  border-left: 1px solid #e2e2e2;\n  border-top: 1px solid #e2e2e2;\n  height: 12px;\n  left: 21px;\n  top: -7px;\n  -webkit-transform: rotate(45deg);\n  -moz-transform: rotate(45deg);\n  -o-transform: rotate(45deg);\n  transform: rotate(45deg);\n  position: absolute;\n  width: 12px; }\n\n.height-container {\n  display: none;\n  left: -25px;\n  padding: 0 25px;\n  position: relative;\n  width: 100%;\n  overflow: hidden; }\n  .height-container .section {\n    background: #f9f9f9;\n    border-bottom: 1px solid #e2e2e2;\n    left: -25px;\n    position: relative;\n    width: 100%;\n    padding-top: 10px;\n    padding-bottom: 5px; }\n\n.aside, .language {\n  padding: 6px 12px;\n  margin: 12px 0;\n  border-left: 5px solid #dddddd;\n  overflow-y: hidden; }\n  .aside .aside-title, .language .aside-title {\n    font-size: 9px;\n    letter-spacing: 2px;\n    text-transform: uppercase;\n    padding-bottom: 0;\n    margin: 0;\n    color: #aaa;\n    -webkit-user-select: none; }\n  .aside p:last-child, .language p:last-child {\n    margin-bottom: 0; }\n\n.language {\n  border-left: 5px solid #cde9f4; }\n  .language .aside-title {\n    color: #4b8afb; }\n\n.aside-warning, .aside-deprecated, .aside-unavailable {\n  border-left: 5px solid #ff6666; }\n  .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {\n    color: #ff0000; }\n\n.graybox {\n  border-collapse: collapse;\n  width: 100%; }\n  .graybox p {\n    margin: 0;\n    word-break: break-word;\n    min-width: 50px; }\n  .graybox td {\n    border: 1px solid #e2e2e2;\n    padding: 5px 25px 5px 10px;\n    vertical-align: middle; }\n  .graybox tr td:first-of-type {\n    text-align: right;\n    padding: 7px;\n    vertical-align: top;\n    word-break: normal;\n    width: 40px; }\n\n.slightly-smaller {\n  font-size: 0.9em; }\n\n#footer {\n  position: relative;\n  top: 10px;\n  bottom: 0px;\n  margin-left: 25px; }\n  #footer p {\n    margin: 0;\n    color: #aaa;\n    font-size: 0.8em; }\n\nhtml.dash header, html.dash #breadcrumbs, html.dash .sidebar {\n  display: none; }\n\nhtml.dash .main-content {\n  width: 980px;\n  margin-left: 0;\n  border: none;\n  width: 100%;\n  top: 0;\n  padding-bottom: 0; }\n\nhtml.dash .height-container {\n  display: block; }\n\nhtml.dash .item .token {\n  margin-left: 0; }\n\nhtml.dash .content-wrapper {\n  width: auto; }\n\nhtml.dash #footer {\n  position: static; }\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n  <dict>\n    <key>CFBundleIdentifier</key>\n      <string>com.jazzy.swiftphoenixclient</string>\n    <key>CFBundleName</key>\n      <string>SwiftPhoenixClient</string>\n    <key>DocSetPlatformFamily</key>\n      <string>swiftphoenixclient</string>\n    <key>isDashDocset</key>\n      <true/>\n    <key>dashIndexFilePath</key>\n      <string>index.html</string>\n    <key>isJavaScriptEnabled</key>\n      <true/>\n    <key>DashDocSetFamily</key>\n      <string>dashtoc</string>\n  </dict>\n</plist>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Channel.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Channel Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Channel\" class=\"dashAnchor\"></a>\n    <a title=\"Channel Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Channel Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Channel</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Channel</span></code></pre>\n\n                </div>\n              </div>\n            <p>Undocumented</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC5topicSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/topic\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC5topicSSvp\">topic</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The topic of the Channel. e.g. &ldquo;rooms:friends&rdquo;</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/params\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\">params</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The params sent when joining the channel</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onMessage\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\">onMessage</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Overridable message hook. Receives all events for specialized message\nhandling before dispatching to the channel callbacks.</p>\n\n<ul>\n<li>return: Must return the message, modified or unmodified</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onMessage</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>msg</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The Message received by the client from the server</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/join(timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\">join(timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Joins the channel</p>\n\n<ul>\n<li>return: Push event</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">join</span><span class=\"p\">(</span><span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Defaults to Channel&rsquo;s timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onClose(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\">onClose(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel is closed. Does not handle retain cycles.\nUse <code>delegateOnClose(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">onClose</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"n\">message</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onClose</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnClose(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\">delegateOnClose(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel is closed. Automatically handles retain\ncycles. Use <code>onClose()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOnClose</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnClose</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onError(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\">onError(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel receives an Error. Does not handle retain\ncycles. Use <code>delegateOnError(to:)</code> for automatic handling of retain\ncycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">onError</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has errored\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onError</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"n\">_</span> <span class=\"nv\">message</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnError(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\">delegateOnError(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Hook into when the Channel receives an Error. Automatically handles\nretain cycles. Use <code>onError()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOnError</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Channel </span><span class=\"se\">\\(</span><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">topic</span><span class=\"se\">)</span><span class=\"s\"> has closed\"</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnError</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Channel closes</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\"></a>\n                    <a name=\"//apple_ref/swift/Method/on(_:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\">on(_:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Subscribes on channel events. Does not handle retain cycles. Use\n<code>delegateOn(_:, to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Subscription returns a ref counter, which can be used later to\nunsubscribe the exact event listener</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do other stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Since unsubscription of ref1, &ldquo;do stuff&rdquo; won&rsquo;t print, but &ldquo;do other\nstuff&rdquo; will keep on printing on the &ldquo;event&rdquo;</p>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called with the event&rsquo;s message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOn(_:to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\">delegateOn(_:to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Subscribes on channel events. Automatically handles retain cycles. Use\n<code>on()</code> to handle yourself.</p>\n\n<p>Subscription returns a ref counter, which can be used later to\nunsubscribe the exact event listener</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOn</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">delegateOn</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"do other stuff\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Since unsubscription of ref1, &ldquo;do stuff&rdquo; won&rsquo;t print, but &ldquo;do other\nstuff&rdquo; will keep on printing on the &ldquo;event&rdquo;</p>\n\n<ul>\n<li>return: Ref counter of the subscription. See <code>func off()</code></li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOn</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                                          <span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called with the event&rsquo;s message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/off(_:ref:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\">off(_:ref:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Unsubscribes from a channel event. If a <code>ref</code> is given, only the exact\nlistener will be removed. Else all listeners for the <code>event</code> will be\nremoved.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref1</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref1 event\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref2</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref2 event\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref3</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref3 other\"</span> <span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">ref4</span> <span class=\"o\">=</span> <span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">on</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"ref4 other\"</span> <span class=\"p\">}</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"n\">ref1</span><span class=\"p\">)</span>\n<span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"s\">\"other_event\"</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>After this, only &ldquo;ref2 event&rdquo; will be printed if the channel receives\n&ldquo;event&rdquo; and nothing is printed if the channel receives &ldquo;other_event&rdquo;.</p>\n\n<ul>\n<li>paramter ref: Ref counter returned when subscribing. Can be omitted</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">off</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"nv\">ref</span><span class=\"p\">:</span> <span class=\"kt\">Int</span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to unsubscribe from</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/push(_:payload:timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\">push(_:payload:timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Push a payload to the Channel</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">push</span><span class=\"p\">(</span><span class=\"s\">\"event\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"message\"</span><span class=\"p\">:</span> <span class=\"s\">\"hello\"</span><span class=\"p\">)</span>\n    <span class=\"o\">.</span><span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"s\">\"ok\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">{</span> <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"message sent\"</span><span class=\"p\">)</span> <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">push</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                 <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">,</span>\n                 <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Event to push</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>payload</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Payload to push</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/leave(timeout:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\">leave(timeout:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Leaves the channel</p>\n\n<p>Unsubscribes from server events, and instructs channel to terminate on\n server</p>\n\n<p>Triggers onClose() hooks</p>\n\n<p>To receive leave acknowledgements, use the a <code>receive</code>\n hook to bind to the server ack, ie:</p>\n\n<p>Example:\n/\n     channel.leave().receive(&ldquo;ok&rdquo;) { _ in { print(&ldquo;left&rdquo;) }</p>\n\n<ul>\n<li>return: Push that can add receive hooks</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">leave</span><span class=\"p\">(</span><span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Push.html\">Push</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional timeout</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onMessage(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\">onMessage(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Overridable message hook. Receives all events for specialized message\nhandling before dispatching to the channel callbacks.</p>\n\n<ul>\n<li>return: Must return the payload, modified or unmodified</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onMessage</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>event</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The event the message was for</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>payload</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The payload for the message</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>ref</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The reference of the message</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public%20API\"></a>\n                <a name=\"//apple_ref/swift/Section/Public API\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public%20API\"></a>\n                  <h3 class=\"section-name\"><p>Public API</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isClosed\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\">isClosed</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the Channel has been closed</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isClosed</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isErrored\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\">isErrored</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the Channel experienced an error</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isErrored</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isJoined\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\">isJoined</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has joined</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isJoined</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isJoining\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\">isJoining</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has requested to join</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isJoining</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isLeaving\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\">isLeaving</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the channel has requested to leave</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isLeaving</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Defaults.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Defaults Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Defaults\" class=\"dashAnchor\"></a>\n    <a title=\"Defaults Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Defaults Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Defaults</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Defaults</span></code></pre>\n\n                </div>\n              </div>\n            <p>A collection of default values and behaviors used accross the Client</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/timeoutInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\">timeoutInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default timeout when sending messages</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">timeoutInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/heartbeatInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\">heartbeatInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default interval to send heartbeats on</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">heartbeatInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/reconnectSteppedBackOff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\">reconnectSteppedBackOff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default reconnect algorithm for the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">reconnectSteppedBackOff</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/rejoinSteppedBackOff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\">rejoinSteppedBackOff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default rejoin algorithm for individual channels</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">rejoinSteppedBackOff</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/encode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\">encode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default encode function, utilizing JSONSerialization.data</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">encode</span><span class=\"p\">:</span> <span class=\"p\">([</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/decode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\">decode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default decode function, utilizing JSONSerialization.jsonObject</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">decode</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Message.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Message Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Message\" class=\"dashAnchor\"></a>\n    <a title=\"Message Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Message Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Message</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Message</span></code></pre>\n\n                </div>\n              </div>\n            <p>Data that is received from the Server.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC3refSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/ref\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC3refSSvp\">ref</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Reference number. Empty if missing</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">ref</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC5topicSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/topic\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC5topicSSvp\">topic</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message topic</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC5eventSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/event\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC5eventSSvp\">event</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message event</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\">payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Message payload</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/status\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\">status</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convenience accessor. Equivalent to getting the status as such:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">message</span><span class=\"o\">.</span><span class=\"n\">payload</span><span class=\"p\">[</span><span class=\"s\">\"status\"</span><span class=\"p\">]</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">?</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Presence/Events.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Events Enumeration Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../../js/jquery.min.js\" defer></script>\n    <script src=\"../../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Enum/Events\" class=\"dashAnchor\"></a>\n    <a title=\"Events Enumeration Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../../img/carat.png\" />\n        Events Enumeration Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Events</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">Events</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                </div>\n              </div>\n            <p>Presense Events</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/state\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\">state</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">state</span> <span class=\"o\">=</span> <span class=\"s\">\"state\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/diff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\">diff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">diff</span> <span class=\"o\">=</span> <span class=\"s\">\"diff\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Presence/Options.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Options Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../../js/jquery.min.js\" defer></script>\n    <script src=\"../../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/Options\" class=\"dashAnchor\"></a>\n    <a title=\"Options Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../../img/carat.png\" />\n        Options Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Options</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Options</span></code></pre>\n\n                </div>\n              </div>\n            <p>Custom options that can be provided when creating Presence</p>\n<h3 id='example' class='heading'>Example:</h3>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/defaults\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\">defaults</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default set of Options used when creating Presence. Uses the\nphoenix events &ldquo;presence_state&rdquo; and &ldquo;presence_diff&rdquo;</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">defaults</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../../Classes/Presence.html\">Presence</a></span><span class=\"o\">.</span><span class=\"kt\">Options</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Presence.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Presence Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Presence\" class=\"dashAnchor\"></a>\n    <a title=\"Presence Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Presence Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Presence</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">final</span> <span class=\"kd\">class</span> <span class=\"kt\">Presence</span></code></pre>\n\n                </div>\n              </div>\n            <p>The Presence object provides features for syncing presence information from\nthe server with the client and handling presences joining and leaving.</p>\n<h2 id='syncing-state-from-the-server' class='heading'>Syncing state from the server</h2>\n\n<p>To sync presence state from the server, first instantiate an object and pass\nyour channel in to track lifecycle events:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"some:topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>If you have custom syncing state events, you can configure the <code>Presence</code>\nobject to use those instead.</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Next, use the presence.onSync callback to react to state changes from the\nserver. For example, to render the list of users every time the list\nchanges, you could write:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n<h2 id='listing-presences' class='heading'>Listing Presences</h2>\n\n<p>presence.list is used to return a list of presence information based on the\nlocal state of metadata. By default, all presence metadata is returned, but\na listBy function can be supplied to allow the client to select which\nmetadata to use for a given presence. For example, you may have a user\nonline from different devices with a metadata status of &ldquo;online&rdquo;, but they\nhave set themselves to &ldquo;away&rdquo; on another device. In this case, the app may\nchoose to use the &ldquo;away&rdquo; status for what appears on the UI. The example\nbelow defines a listBy function which prioritizes the first metadata which\nwas registered for each user. This could be the first tab they opened, or\nthe first device they came online from:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">listBy</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Map</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">pres</span> <span class=\"k\">in</span>\n    <span class=\"k\">let</span> <span class=\"nv\">first</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">first</span><span class=\"o\">!</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"count\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">count</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"id\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">id</span>\n    <span class=\"k\">return</span> <span class=\"n\">first</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">onlineUsers</span> <span class=\"o\">=</span> <span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">(</span><span class=\"nv\">by</span><span class=\"p\">:</span> <span class=\"n\">listBy</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>(NOTE: The underlying behavior is a <code>map</code> on the <code>presence.state</code>. You are\nmapping the <code>state</code> dictionary into whatever datastructure suites your needs)</p>\n<h2 id='handling-individual-presence-join-and-leave-events' class='heading'>Handling individual presence join and leave events</h2>\n\n<p>The presence.onJoin and presence.onLeave callbacks can be used to react to\nindividual presences joining and leaving the app. For example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onJoin</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"k\">let</span> <span class=\"nv\">cur</span> <span class=\"o\">=</span> <span class=\"n\">current</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user additional presence\"</span><span class=\"p\">,</span> <span class=\"n\">cur</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user entered for the first time\"</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onLeave</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"n\">current</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]?</span><span class=\"o\">.</span><span class=\"n\">isEmpty</span> <span class=\"o\">==</span> <span class=\"kc\">true</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user has left from all devices\"</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user left from a device\"</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Enums%20and%20Structs\"></a>\n                <a name=\"//apple_ref/swift/Section/Enums and Structs\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Enums%20and%20Structs\"></a>\n                  <h3 class=\"section-name\"><p>Enums and Structs</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OptionsV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/Options\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OptionsV\">Options</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Custom options that can be provided when creating Presence</p>\n<h3 id='example' class='heading'>Example:</h3>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n                        <a href=\"../Classes/Presence/Options.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Options</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6EventsO\"></a>\n                    <a name=\"//apple_ref/swift/Enum/Events\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6EventsO\">Events</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Presense Events</p>\n\n                        <a href=\"../Classes/Presence/Events.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">Events</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Typaliases\"></a>\n                <a name=\"//apple_ref/swift/Section/Typaliases\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Typaliases\"></a>\n                  <h3 class=\"section-name\"><p>Typaliases</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4Metaa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Meta\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4Metaa\">Meta</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Meta details of a Presence. Just a dictionary of properties</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC3Mapa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Map\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A mapping of a String to an array of Metas. e.g. {&ldquo;metas&rdquo;: [{id: 1}]}</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Map</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Metaa\">Meta</a></span><span class=\"p\">]]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC5Statea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/State\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A mapping of a Presence state to a mapping of Metas</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">State</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4Diffa\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Diff\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Diff</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6OnJoina\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnJoin\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Closure signature of OnJoin callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnJoin</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">key</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">current</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">?,</span> <span class=\"n\">_</span> <span class=\"nv\">new</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7OnLeavea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnLeave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Closure signature for OnLeave callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnLeave</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">key</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">current</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">,</span> <span class=\"n\">_</span> <span class=\"nv\">left</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6OnSynca\"></a>\n                    <a name=\"//apple_ref/swift/Alias/OnSync\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>/ Closure signature for OnSync callbacks</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">OnSync</span> <span class=\"o\">=</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Properties\"></a>\n                <a name=\"//apple_ref/swift/Section/Properties\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Properties\"></a>\n                  <h3 class=\"section-name\"><p>Properties</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/state\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\">state</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The state of the Presence</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/pendingDiffs\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\">pendingDiffs</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Pending <code>join</code> and <code>leave</code> diffs that need to be synced</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">pendingDiffs</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/joinRef\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\">joinRef</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The channel&rsquo;s joinRef, set when state events occur</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">private(set)</span> <span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">joinRef</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isPendingSyncState\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\">isPendingSyncState</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isPendingSyncState</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onJoin\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\">onJoin</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of joins</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onJoin(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\">onJoin(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnJoin callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onJoin</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onLeave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\">onLeave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of leaves</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onLeave(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\">onLeave(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnLeave callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onLeave</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/onSync\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\">onSync</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Callback to be informed of synces</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">onSync</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a></span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"k\">set</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onSync(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\">onSync(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Set the OnSync callback</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onSync</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\">OnSync</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(channel:opts:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\">init(channel:opts:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence/Options.html\">Options</a></span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Presence/Options.html\">Options</a></span><span class=\"o\">.</span><span class=\"n\">defaults</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/list()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\">list()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Returns the array of presences, with deault selected metadata.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">list</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\"></a>\n                    <a name=\"//apple_ref/swift/Method/list(by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\">list(by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Returns the array of presences, with selected metadata</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">list</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">by</span> <span class=\"nv\">transformer</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">T</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/filter(by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\">filter(by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Filter the Presence state with a given function</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">filter</span><span class=\"p\">(</span><span class=\"n\">by</span> <span class=\"nv\">filter</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Bool</span><span class=\"p\">)?)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Static\"></a>\n                <a name=\"//apple_ref/swift/Section/Static\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Static\"></a>\n                  <h3 class=\"section-name\"><p>Static</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/syncState(_:newState:onJoin:onLeave:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\">syncState(_:newState:onJoin:onLeave:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">syncState</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">currentState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">newState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">},</span>\n                             <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">})</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/syncDiff(_:diff:onJoin:onLeave:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\">syncDiff(_:diff:onJoin:onLeave:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">syncDiff</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">currentState</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                            <span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\">Diff</a></span><span class=\"p\">,</span>\n                            <span class=\"nv\">onJoin</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\">OnJoin</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">},</span>\n                            <span class=\"nv\">onLeave</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\">OnLeave</a></span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span><span class=\"p\">,</span><span class=\"n\">_</span> <span class=\"k\">in</span> <span class=\"p\">})</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/filter(_:by:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\">filter(_:by:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"nf\">filter</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">presences</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                          <span class=\"n\">by</span> <span class=\"nv\">filter</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Bool</span><span class=\"p\">)?)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\"></a>\n                    <a name=\"//apple_ref/swift/Method/listBy(_:transformer:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\">listBy(_:transformer:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"kd\">func</span> <span class=\"n\">listBy</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">presences</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\">State</a></span><span class=\"p\">,</span>\n                             <span class=\"nv\">transformer</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\">Map</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">T</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Push.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Push Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Push\" class=\"dashAnchor\"></a>\n    <a title=\"Push Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Push Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Push</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Push</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represnts pushing data to a <code><a href=\"../Classes/Channel.html\">Channel</a></code> through the <code><a href=\"../Classes/Socket.html\">Socket</a></code></p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/channel\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\">channel</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The channel sending the Push</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">weak</span> <span class=\"k\">var</span> <span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC5eventSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/event\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC5eventSSvp\">event</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The event, for example <code>phx_join</code></p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">event</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\">payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The payload, for example [&ldquo;user_id&rdquo;: &ldquo;abc123&rdquo;]</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7timeoutSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/timeout\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7timeoutSdvp\">timeout</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The push timeout. Default is 10.0 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC6resendyySdF\"></a>\n                    <a name=\"//apple_ref/swift/Method/resend(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC6resendyySdF\">resend(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Resets and sends the Push</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">resend</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span> <span class=\"o\">=</span> <span class=\"kt\"><a href=\"../Classes/Defaults.html\">Defaults</a></span><span class=\"o\">.</span><span class=\"n\">timeoutInterval</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>timeout</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. The push timeout. Default is 10.0s</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC4sendyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/send()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC4sendyyF\">send()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Sends the Push. If it has already timed out, then the call will\nbe ignored and return early. Use <code>resend</code> in this case.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">send</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\"></a>\n                    <a name=\"//apple_ref/swift/Method/receive(_:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\">receive(_:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Receive a specific event when sending an Outbound message. Subscribing\nto status events with this method does not guarantees no retain cycles.\nYou should pass <code>weak self</code> in the capture list of the callback. You\ncan call `.delegateReceive(status:, to:, callback:) and the library will\nhandle it for you.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">send</span><span class=\"p\">(</span><span class=\"nv\">event</span><span class=\"p\">:</span><span class=\"s\">\"custom\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"body\"</span><span class=\"p\">:</span> <span class=\"s\">\"example\"</span><span class=\"p\">])</span>\n    <span class=\"o\">.</span><span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"s\">\"error\"</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"n\">payload</span> <span class=\"k\">in</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Error: \"</span><span class=\"p\">,</span> <span class=\"n\">payload</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">receive</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                    <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">()))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>status</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Status to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Callback to fire when the status is recevied</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateReceive(_:to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\">delegateReceive(_:to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Receive a specific event when sending an Outbound message. Automatically\nprevents retain cycles. See <code>manualReceive(status:, callback:)</code> if you\nwant to handle this yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span>\n    <span class=\"o\">.</span><span class=\"nf\">send</span><span class=\"p\">(</span><span class=\"nv\">event</span><span class=\"p\">:</span><span class=\"s\">\"custom\"</span><span class=\"p\">,</span> <span class=\"nv\">payload</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"body\"</span><span class=\"p\">:</span> <span class=\"s\">\"example\"</span><span class=\"p\">])</span>\n    <span class=\"o\">.</span><span class=\"nf\">delegateReceive</span><span class=\"p\">(</span><span class=\"s\">\"error\"</span><span class=\"p\">,</span> <span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"n\">payload</span> <span class=\"k\">in</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Error: \"</span><span class=\"p\">,</span> <span class=\"n\">payload</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">@discardableResult</span>\n<span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateReceive</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">status</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                                               <span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                               <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">()))</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>status</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Status to receive</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>The class that is calling .receive. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Callback to fire when the status is recevied</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes/Socket.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Socket Class Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Class/Socket\" class=\"dashAnchor\"></a>\n    <a title=\"Socket Class Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Socket Class Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Socket</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Socket</span></code></pre>\n<pre class=\"highlight swift\"><code><span class=\"kd\">extension</span> <span class=\"kt\">Socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketDelegate</span></code></pre>\n\n                </div>\n              </div>\n            <h2 id='socket-connection' class='heading'>Socket Connection</h2>\n\n<p>A single connection is established to the server and\nchannels are multiplexed over the connection.\nConnect to the server using the <code>Socket</code> class:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">socket</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"kt\">Socket</span><span class=\"p\">(</span><span class=\"s\">\"/socket\"</span><span class=\"p\">,</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"s\">\"userToken\"</span><span class=\"p\">:</span> <span class=\"s\">\"123\"</span> <span class=\"p\">]</span> <span class=\"p\">})</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">connect</span><span class=\"p\">()</span>\n</code></pre>\n\n<p>The <code>Socket</code> constructor takes the mount point of the socket,\nthe authentication params, as well as options that can be found in\nthe Socket docs, such as configuring the heartbeat.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public%20Attributes\"></a>\n                <a name=\"//apple_ref/swift/Section/Public Attributes\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public%20Attributes\"></a>\n                  <h3 class=\"section-name\"><p>Public Attributes</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC8endPointSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/endPoint\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC8endPointSSvp\">endPoint</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The string WebSocket endpoint (ie <code>&quot;ws://example.com/socket&quot;</code>,\n<code>&quot;wss://example.com&quot;</code>, etc.) That was passed to the Socket during\ninitialization. The URL endpoint will be modified by the Socket to\ninclude <code>&quot;/websocket&quot;</code> if missing.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/endPointUrl\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\">endPointUrl</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The fully qualified socket URL</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">private(set)</span> <span class=\"k\">var</span> <span class=\"nv\">endPointUrl</span><span class=\"p\">:</span> <span class=\"kt\">URL</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/params\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\">params</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Resolves to return the <code><a href=\"../Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\">paramsClosure</a></code> result at the time of calling.\nIf the <code>Socket</code> was created with static params, then those will be\nreturned every time.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/paramsClosure\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\">paramsClosure</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The optional params closure used to get params whhen connecting. Must\nbe set when initializaing the Socket.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/encode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\">encode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Override to provide custom encoding of data before writing to the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">encode</span><span class=\"p\">:</span> <span class=\"p\">([</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/decode\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\">decode</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Override to provide customd decoding of data read from the socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">decode</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/timeout\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\">timeout</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Timeout to use when opening connections</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">timeout</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/heartbeatInterval\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\">heartbeatInterval</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between sending a heartbeat</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">heartbeatInterval</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/reconnectAfter\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\">reconnectAfter</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between socket reconnect attempts, in seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">reconnectAfter</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/rejoinAfter\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\">rejoinAfter</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Interval between channel rejoin attempts, in seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">rejoinAfter</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">Int</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/logger\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\">logger</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The optional function to receive logs</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">logger</span><span class=\"p\">:</span> <span class=\"p\">((</span><span class=\"kt\">String</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/skipHeartbeat\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\">skipHeartbeat</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Disables heartbeats from being sent. Default is false.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">skipHeartbeat</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/disableSSLCertValidation\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\">disableSSLCertValidation</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Enable/Disable SSL certificate validation. Default is false. This\nmust be set before calling <code>socket.connect()</code> in order to be applied</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">disableSSLCertValidation</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/security\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\">security</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Configure custom SSL validation logic, eg. SSL pinning. This\nmust be set before calling <code>socket.connect()</code> in order to apply.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">security</span><span class=\"p\">:</span> <span class=\"kt\">SSLTrustValidator</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/enabledSSLCipherSuites\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\">enabledSSLCipherSuites</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Configure the encryption used by your client by setting the\nallowed cipher suites supported by your server. This must be\nset before calling <code>socket.connect()</code> in order to apply.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">enabledSSLCipherSuites</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">SSLCipherSuite</span><span class=\"p\">]?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Initialization\"></a>\n                <a name=\"//apple_ref/swift/Section/Initialization\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Initialization\"></a>\n                  <h3 class=\"section-name\"><p>Initialization</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(_:params:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\">init(_:params:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"n\">convenience</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                        <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init(_:paramsClosure:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\">init(_:paramsClosure:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"n\">convenience</span> <span class=\"nf\">init</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">endPoint</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                        <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a></span><span class=\"p\">?)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Public\"></a>\n                <a name=\"//apple_ref/swift/Section/Public\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Public\"></a>\n                  <h3 class=\"section-name\"><p>Public</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/websocketProtocol\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\">websocketProtocol</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: The socket protocol, wss or ws</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">websocketProtocol</span><span class=\"p\">:</span> <span class=\"kt\">String</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isConnected\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\">isConnected</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: True if the socket is connected</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isConnected</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7connectyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/connect()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7connectyyF\">connect()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Connects the Socket. The params passed to the Socket on initialization\nwill be sent through the connection. If the Socket is already connected,\nthen this call will be ignored.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">connect</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/disconnect(code:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\">disconnect(code:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Disconnects the socket</p>\n\n<ul>\n<li>paramter callback: Optional. Called when disconnected</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">disconnect</span><span class=\"p\">(</span><span class=\"nv\">code</span><span class=\"p\">:</span> <span class=\"kt\">CloseCode</span> <span class=\"o\">=</span> <span class=\"kt\">CloseCode</span><span class=\"o\">.</span><span class=\"n\">normal</span><span class=\"p\">,</span>\n                       <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"p\">(()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)?</span> <span class=\"o\">=</span> <span class=\"kc\">nil</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>code</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Closing status code</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Register%20Socket%20State%20Callbacks\"></a>\n                <a name=\"//apple_ref/swift/Section/Register Socket State Callbacks\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Register%20Socket%20State%20Callbacks\"></a>\n                  <h3 class=\"section-name\"><p>Register Socket State Callbacks</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onOpen(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\">onOpen(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection open events. Does not handle retain\ncycles. Use <code>delegateOnOpen(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onOpen</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Open\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onOpen</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is opened</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnOpen(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\">delegateOnOpen(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection open events. Automatically handles\nretain cycles. Use <code>onOpen()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnOpen</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"k\">self</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Open\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnOpen</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                         <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is opened</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onClose(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\">onClose(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection close events. Does not handle retain\ncycles. Use <code>delegateOnClose(_:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onClose</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Close\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onClose</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is closed</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnClose(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\">delegateOnClose(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection close events. Automatically handles\nretain cycles. Use <code>onClose()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnClose</span><span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"k\">self</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Close\"</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnClose</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket is closed</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onError(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\">onError(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection error events. Does not handle retain\ncycles. Use <code>delegateOnError(to:)</code> for automatic handling of retain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onError</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">error</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Error\"</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onError</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Error</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket errors</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnError(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\">delegateOnError(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection error events. Automatically handles\nretain cycles. Use <code>manualOnError()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnError</span><span class=\"p\">(</span><span class=\"nv\">to</span><span class=\"p\">:</span> <span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Error\"</span><span class=\"p\">,</span> <span class=\"n\">error</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnError</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                          <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">,</span> <span class=\"kt\">Error</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket errors</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/onMessage(callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\">onMessage(callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection message events. Does not handle\nretain cycles. Use <code>delegateOnMessage(_to:)</code> for automatic handling of\nretain cycles.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">onMessage</span><span class=\"p\">()</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"p\">?</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Message\"</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">onMessage</span><span class=\"p\">(</span><span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket receives a message event</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegateOnMessage(to:callback:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\">delegateOnMessage(to:callback:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Registers callbacks for connection message events. Automatically handles\nretain cycles. Use <code>onMessage()</code> to handle yourself.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">delegateOnMessage</span><span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">)</span> <span class=\"p\">{</span> <span class=\"p\">(</span><span class=\"k\">self</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">self</span><span class=\"o\">.</span><span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"Socket Connection Message\"</span><span class=\"p\">,</span> <span class=\"n\">message</span><span class=\"p\">)</span>\n<span class=\"p\">}</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"n\">delegateOnMessage</span><span class=\"o\">&lt;</span><span class=\"kt\">T</span><span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">owner</span><span class=\"p\">:</span> <span class=\"kt\">T</span><span class=\"p\">,</span>\n                                            <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">((</span><span class=\"kt\">T</span><span class=\"p\">,</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Void</span><span class=\"p\">))</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>owner</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Class registering the callback. Usually <code>self</code></p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>callback</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Called when the Socket receives a message event</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/releaseCallbacks()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\">releaseCallbacks()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should\ncall this method when you are finished when the Socket in order to release\nany references held by the socket.</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">releaseCallbacks</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Channel%20Initialization\"></a>\n                <a name=\"//apple_ref/swift/Section/Channel Initialization\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Channel%20Initialization\"></a>\n                  <h3 class=\"section-name\"><p>Channel Initialization</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/channel(_:params:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\">channel(_:params:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Initialize a new Channel</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"rooms\"</span><span class=\"p\">,</span> <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"s\">\"user_id\"</span><span class=\"p\">:</span> <span class=\"s\">\"abc123\"</span><span class=\"p\">])</span>\n</code></pre>\n\n<ul>\n<li>return: A new channel</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">topic</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">,</span>\n                    <span class=\"nv\">params</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">String</span><span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"p\">[:])</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>topic</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Topic of the channel</p>\n                                </div>\n                              </td>\n                            </tr>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>params</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Optional. Parameters for the channel</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\"></a>\n                    <a name=\"//apple_ref/swift/Method/remove(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\">remove(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Removes the Channel from the socket. This does not cause the channel to\ninform the server that it is leaving. You should call channel.leave()\nprior to removing the Channel.</p>\n\n<p>Example:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">channel</span><span class=\"o\">.</span><span class=\"nf\">leave</span><span class=\"p\">()</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">remove</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">remove</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">channel</span><span class=\"p\">:</span> <span class=\"kt\"><a href=\"../Classes/Channel.html\">Channel</a></span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                      <div>\n                        <h4>Parameters</h4>\n                        <table class=\"graybox\">\n                          <tbody>\n                            <tr>\n                              <td>\n                                <code>\n                                <em>channel</em>\n                                </code>\n                              </td>\n                              <td>\n                                <div>\n                                  <p>Channel to remove</p>\n                                </div>\n                              </td>\n                            </tr>\n                          </tbody>\n                        </table>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Sending%20Data\"></a>\n                <a name=\"//apple_ref/swift/Section/Sending Data\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Sending%20Data\"></a>\n                  <h3 class=\"section-name\"><p>Sending Data</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/makeRef()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\">makeRef()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        \n<ul>\n<li>return: the next message ref, accounting for overflows</li>\n</ul>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">makeRef</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/WebSocketDelegate\"></a>\n                <a name=\"//apple_ref/swift/Section/WebSocketDelegate\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/WebSocketDelegate\"></a>\n                  <h3 class=\"section-name\"><p>WebSocketDelegate</p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidConnect(socket:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\">websocketDidConnect(socket:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidConnect</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidDisconnect(socket:error:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\">websocketDidDisconnect(socket:error:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidDisconnect</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">error</span><span class=\"p\">:</span> <span class=\"kt\">Error</span><span class=\"p\">?)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidReceiveMessage(socket:text:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\">websocketDidReceiveMessage(socket:text:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidReceiveMessage</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">text</span><span class=\"p\">:</span> <span class=\"kt\">String</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\"></a>\n                    <a name=\"//apple_ref/swift/Method/websocketDidReceiveData(socket:data:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\">websocketDidReceiveData(socket:data:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">websocketDidReceiveData</span><span class=\"p\">(</span><span class=\"nv\">socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketClient</span><span class=\"p\">,</span> <span class=\"nv\">data</span><span class=\"p\">:</span> <span class=\"kt\">Data</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Classes.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Classes  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Classes\" class=\"dashAnchor\"></a>\n    <a title=\"Classes  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Classes  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Classes</h1>\n            <p>The following classes are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7ChannelC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Channel\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7ChannelC\">Channel</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                        <a href=\"Classes/Channel.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Channel</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7MessageC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Message\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7MessageC\">Message</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Data that is received from the Server.</p>\n\n                        <a href=\"Classes/Message.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Message</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8PresenceC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Presence\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8PresenceC\">Presence</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>The Presence object provides features for syncing presence information from\nthe server with the client and handling presences joining and leaving.</p>\n<h2 id='syncing-state-from-the-server' class='heading'>Syncing state from the server</h2>\n\n<p>To sync presence state from the server, first instantiate an object and pass\nyour channel in to track lifecycle events:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">channel</span> <span class=\"o\">=</span> <span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">channel</span><span class=\"p\">(</span><span class=\"s\">\"some:topic\"</span><span class=\"p\">)</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>If you have custom syncing state events, you can configure the <code>Presence</code>\nobject to use those instead.</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">options</span> <span class=\"o\">=</span> <span class=\"kt\">Options</span><span class=\"p\">(</span><span class=\"nv\">events</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"o\">.</span><span class=\"nv\">state</span><span class=\"p\">:</span> <span class=\"s\">\"my_state\"</span><span class=\"p\">,</span> <span class=\"o\">.</span><span class=\"nv\">diff</span><span class=\"p\">:</span> <span class=\"s\">\"my_diff\"</span><span class=\"p\">])</span>\n<span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">,</span> <span class=\"nv\">opts</span><span class=\"p\">:</span> <span class=\"n\">options</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>Next, use the presence.onSync callback to react to state changes from the\nserver. For example, to render the list of users every time the list\nchanges, you could write:</p>\n<pre class=\"highlight swift\"><code><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n<h2 id='listing-presences' class='heading'>Listing Presences</h2>\n\n<p>presence.list is used to return a list of presence information based on the\nlocal state of metadata. By default, all presence metadata is returned, but\na listBy function can be supplied to allow the client to select which\nmetadata to use for a given presence. For example, you may have a user\nonline from different devices with a metadata status of &ldquo;online&rdquo;, but they\nhave set themselves to &ldquo;away&rdquo; on another device. In this case, the app may\nchoose to use the &ldquo;away&rdquo; status for what appears on the UI. The example\nbelow defines a listBy function which prioritizes the first metadata which\nwas registered for each user. This could be the first tab they opened, or\nthe first device they came online from:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">listBy</span><span class=\"p\">:</span> <span class=\"p\">(</span><span class=\"kt\">String</span><span class=\"p\">,</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Map</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Presence</span><span class=\"o\">.</span><span class=\"kt\">Meta</span> <span class=\"o\">=</span> <span class=\"p\">{</span> <span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">pres</span> <span class=\"k\">in</span>\n    <span class=\"k\">let</span> <span class=\"nv\">first</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">first</span><span class=\"o\">!</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"count\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pres</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]</span><span class=\"o\">!.</span><span class=\"n\">count</span>\n    <span class=\"n\">first</span><span class=\"p\">[</span><span class=\"s\">\"id\"</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">id</span>\n    <span class=\"k\">return</span> <span class=\"n\">first</span>\n<span class=\"p\">}</span>\n<span class=\"k\">let</span> <span class=\"nv\">onlineUsers</span> <span class=\"o\">=</span> <span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">(</span><span class=\"nv\">by</span><span class=\"p\">:</span> <span class=\"n\">listBy</span><span class=\"p\">)</span>\n</code></pre>\n\n<p>(NOTE: The underlying behavior is a <code>map</code> on the <code>presence.state</code>. You are\nmapping the <code>state</code> dictionary into whatever datastructure suites your needs)</p>\n<h2 id='handling-individual-presence-join-and-leave-events' class='heading'>Handling individual presence join and leave events</h2>\n\n<p>The presence.onJoin and presence.onLeave callbacks can be used to react to\nindividual presences joining and leaving the app. For example:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">presence</span> <span class=\"o\">=</span> <span class=\"kt\">Presence</span><span class=\"p\">(</span><span class=\"n\">channel</span><span class=\"p\">)</span>\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onJoin</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"k\">let</span> <span class=\"nv\">cur</span> <span class=\"o\">=</span> <span class=\"n\">current</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user additional presence\"</span><span class=\"p\">,</span> <span class=\"n\">cur</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user entered for the first time\"</span><span class=\"p\">,</span> <span class=\"n\">newPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onLeave</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"k\">weak</span> <span class=\"k\">self</span><span class=\"p\">]</span> <span class=\"p\">(</span><span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span> <span class=\"k\">in</span>\n    <span class=\"k\">if</span> <span class=\"n\">current</span><span class=\"p\">[</span><span class=\"s\">\"metas\"</span><span class=\"p\">]?</span><span class=\"o\">.</span><span class=\"n\">isEmpty</span> <span class=\"o\">==</span> <span class=\"kc\">true</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user has left from all devices\"</span><span class=\"p\">,</span> <span class=\"n\">leftPres</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span> <span class=\"k\">else</span> <span class=\"p\">{</span>\n        <span class=\"nf\">print</span><span class=\"p\">(</span><span class=\"s\">\"user left from a device\"</span><span class=\"p\">,</span> <span class=\"n\">current</span><span class=\"p\">)</span>\n    <span class=\"p\">}</span>\n<span class=\"p\">}</span>\n\n<span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"n\">onSync</span> <span class=\"p\">{</span> <span class=\"nf\">renderUsers</span><span class=\"p\">(</span><span class=\"n\">presence</span><span class=\"o\">.</span><span class=\"nf\">list</span><span class=\"p\">())</span> <span class=\"p\">}</span>\n</code></pre>\n\n                        <a href=\"Classes/Presence.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">final</span> <span class=\"kd\">class</span> <span class=\"kt\">Presence</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient4PushC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Push\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient4PushC\">Push</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represnts pushing data to a <code><a href=\"Classes/Channel.html\">Channel</a></code> through the <code><a href=\"Classes/Socket.html\">Socket</a></code></p>\n\n                        <a href=\"Classes/Push.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Push</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient6SocketC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Socket\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient6SocketC\">Socket</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <h2 id='socket-connection' class='heading'>Socket Connection</h2>\n\n<p>A single connection is established to the server and\nchannels are multiplexed over the connection.\nConnect to the server using the <code>Socket</code> class:</p>\n<pre class=\"highlight swift\"><code><span class=\"k\">let</span> <span class=\"nv\">socket</span> <span class=\"o\">=</span> <span class=\"k\">new</span> <span class=\"kt\">Socket</span><span class=\"p\">(</span><span class=\"s\">\"/socket\"</span><span class=\"p\">,</span> <span class=\"nv\">paramsClosure</span><span class=\"p\">:</span> <span class=\"p\">{</span> <span class=\"p\">[</span><span class=\"s\">\"userToken\"</span><span class=\"p\">:</span> <span class=\"s\">\"123\"</span> <span class=\"p\">]</span> <span class=\"p\">})</span>\n<span class=\"n\">socket</span><span class=\"o\">.</span><span class=\"nf\">connect</span><span class=\"p\">()</span>\n</code></pre>\n\n<p>The <code>Socket</code> constructor takes the mount point of the socket,\nthe authentication params, as well as options that can be found in\nthe Socket docs, such as configuring the heartbeat.</p>\n\n                        <a href=\"Classes/Socket.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Socket</span></code></pre>\n<pre class=\"highlight swift\"><code><span class=\"kd\">extension</span> <span class=\"kt\">Socket</span><span class=\"p\">:</span> <span class=\"kt\">WebSocketDelegate</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient8DefaultsC\"></a>\n                    <a name=\"//apple_ref/swift/Class/Defaults\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient8DefaultsC\">Defaults</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>A collection of default values and behaviors used accross the Client</p>\n\n                        <a href=\"Classes/Defaults.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">class</span> <span class=\"kt\">Defaults</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Enums/ChannelState.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>ChannelState Enumeration Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Enum/ChannelState\" class=\"dashAnchor\"></a>\n    <a title=\"ChannelState Enumeration Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        ChannelState Enumeration Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>ChannelState</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">ChannelState</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represents the multiple states that a Channel can be in\nthroughout it&rsquo;s lifecycle.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/closed\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\">closed</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">closed</span> <span class=\"o\">=</span> <span class=\"s\">\"closed\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/errored\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\">errored</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">errored</span> <span class=\"o\">=</span> <span class=\"s\">\"errored\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/joined\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\">joined</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">joined</span> <span class=\"o\">=</span> <span class=\"s\">\"joined\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/joining\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\">joining</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">joining</span> <span class=\"o\">=</span> <span class=\"s\">\"joining\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\"></a>\n                    <a name=\"//apple_ref/swift/Element/leaving\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\">leaving</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"k\">case</span> <span class=\"n\">leaving</span> <span class=\"o\">=</span> <span class=\"s\">\"leaving\"</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Enums.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Enumerations  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Enumerations\" class=\"dashAnchor\"></a>\n    <a title=\"Enumerations  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Enumerations  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Enumerations</h1>\n            <p>The following enumerations are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelStateO\"></a>\n                    <a name=\"//apple_ref/swift/Enum/ChannelState\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelStateO\">ChannelState</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represents the multiple states that a Channel can be in\nthroughout it&rsquo;s lifecycle.</p>\n\n                        <a href=\"Enums/ChannelState.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">enum</span> <span class=\"kt\">ChannelState</span> <span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Global Variables.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Global Variables  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Global Variables\" class=\"dashAnchor\"></a>\n    <a title=\"Global Variables  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (70% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Global Variables  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\">PHOENIX_HEARTBEAT_INTERVAL</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\">PHOENIX_TIMEOUT_INTERVAL</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Global Variables</h1>\n            <p>The following global variables are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_DEFAULT_TIMEOUT\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default timeout when making a connection set to 10 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_DEFAULT_TIMEOUT</span><span class=\"p\">:</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_TIMEOUT_INTERVAL\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient24PHOENIX_TIMEOUT_INTERVALSdvp\">PHOENIX_TIMEOUT_INTERVAL</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_TIMEOUT_INTERVAL</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_DEFAULT_HEARTBEAT\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default heartbeat interval set to 30 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_DEFAULT_HEARTBEAT</span><span class=\"p\">:</span> <span class=\"kt\">Int</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\"></a>\n                    <a name=\"//apple_ref/swift/Global/PHOENIX_HEARTBEAT_INTERVAL\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient26PHOENIX_HEARTBEAT_INTERVALSdvp\">PHOENIX_HEARTBEAT_INTERVAL</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Default heartbeat interval set to 30.0 seconds</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">let</span> <span class=\"nv\">PHOENIX_HEARTBEAT_INTERVAL</span><span class=\"p\">:</span> <span class=\"kt\">TimeInterval</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-04-02)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Protocols/Serializer.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Serializer Protocol Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Protocol/Serializer\" class=\"dashAnchor\"></a>\n    <a title=\"Serializer Protocol Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (50% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Serializer Protocol Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/PresenceEventType.html\">– PresenceEventType</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC0D7OptionsV\">– PresenceOptions</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/SocketState.html\">SocketState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Protocols.html\">Protocols</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Protocols/Serializer.html\">Serializer</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Serializer</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">protocol</span> <span class=\"kt\">Serializer</span></code></pre>\n\n                </div>\n              </div>\n            <p>Provides customization when enoding and decoding data within the Socket</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP6encodey10Foundation4DataVSDySSypGKF\"></a>\n                    <a name=\"//apple_ref/swift/Method/encode(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP6encodey10Foundation4DataVSDySSypGKF\">encode(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convert a message into Data to be sent over the Socket</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">func</span> <span class=\"nf\">encode</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">message</span><span class=\"p\">:</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">])</span> <span class=\"k\">throws</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Data</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP6decodeyAA7MessageCSg10Foundation4DataVF\"></a>\n                    <a name=\"//apple_ref/swift/Method/decode(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP6decodeyAA7MessageCSg10Foundation4DataVF\">decode(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Convert data from the Socket into a Message</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">func</span> <span class=\"nf\">decode</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">data</span><span class=\"p\">:</span> <span class=\"kt\">Data</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"../Classes/Message.html\">Message</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-02-10)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Protocols.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Protocols  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Protocols\" class=\"dashAnchor\"></a>\n    <a title=\"Protocols  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (50% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Protocols  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/PresenceEventType.html\">– PresenceEventType</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC0D7OptionsV\">– PresenceOptions</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Global Variables.html\">Global Variables</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient25PHOENIX_DEFAULT_HEARTBEATSivp\">PHOENIX_DEFAULT_HEARTBEAT</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Global Variables.html#/s:18SwiftPhoenixClient23PHOENIX_DEFAULT_TIMEOUTSivp\">PHOENIX_DEFAULT_TIMEOUT</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/SocketState.html\">SocketState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Protocols.html\">Protocols</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Protocols/Serializer.html\">Serializer</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Protocols</h1>\n            <p>The following protocols are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient10SerializerP\"></a>\n                    <a name=\"//apple_ref/swift/Protocol/Serializer\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient10SerializerP\">Serializer</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Provides customization when enoding and decoding data within the Socket</p>\n\n                        <a href=\"Protocols/Serializer.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">protocol</span> <span class=\"kt\">Serializer</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-02-10)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.9.4</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Structs/ChannelEvent.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>ChannelEvent Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/ChannelEvent\" class=\"dashAnchor\"></a>\n    <a title=\"ChannelEvent Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        ChannelEvent Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>ChannelEvent</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">ChannelEvent</span></code></pre>\n\n                </div>\n              </div>\n            <p>Represents the different events that can be sent through\na channel regarding a Channel&rsquo;s lifecycle.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/heartbeat\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\">heartbeat</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">heartbeat</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/join\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\">join</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">join</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/leave\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\">leave</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">leave</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/reply\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\">reply</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">reply</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/error\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\">error</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">error</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\"></a>\n                    <a name=\"//apple_ref/swift/Variable/close\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\">close</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">static</span> <span class=\"k\">let</span> <span class=\"nv\">close</span><span class=\"p\">:</span> <span class=\"kt\">String</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Structs/Delegated.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Delegated Structure Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"../js/jquery.min.js\" defer></script>\n    <script src=\"../js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Struct/Delegated\" class=\"dashAnchor\"></a>\n    <a title=\"Delegated Structure Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"../index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"../index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"../img/carat.png\" />\n        Delegated Structure Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"../Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"../Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"../Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Delegated</h1>\n              <div class=\"declaration\">\n                <div class=\"language\">\n                  <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Delegated</span><span class=\"o\">&lt;</span><span class=\"kt\">Input</span><span class=\"p\">,</span> <span class=\"kt\">Output</span><span class=\"o\">&gt;</span></code></pre>\n\n                </div>\n              </div>\n            <p>Provides a memory-safe way of passing callbacks around while not creating\nretain cycles. This file was copied from <a href=\"https://github.com/dreymonde/Delegated\">https://github.com/dreymonde/Delegated</a>\ninstead of added as a dependency to reduce the number of packages that\nship with SwiftPhoenixClient</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\"></a>\n                    <a name=\"//apple_ref/swift/Method/init()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\">init()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"nf\">init</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\">delegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">delegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                  <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\">call(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">input</span><span class=\"p\">:</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\"></a>\n                    <a name=\"//apple_ref/swift/Property/isDelegateSet\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\">isDelegateSet</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">var</span> <span class=\"nv\">isDelegateSet</span><span class=\"p\">:</span> <span class=\"kt\">Bool</span> <span class=\"p\">{</span> <span class=\"k\">get</span> <span class=\"p\">}</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/stronglyDelegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\">stronglyDelegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">stronglyDelegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                          <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">,</span> <span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\"></a>\n                    <a name=\"//apple_ref/swift/Method/manuallyDelegate(with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\">manuallyDelegate(with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"nf\">manuallyDelegate</span><span class=\"p\">(</span><span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Input</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/removeDelegate()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\">removeDelegate()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"nf\">removeDelegate</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Input%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Input` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Input%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Input</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/delegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\">delegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">delegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                  <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\"></a>\n                    <a name=\"//apple_ref/swift/Method/stronglyDelegate(to:with:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\">stronglyDelegate(to:with:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"k\">mutating</span> <span class=\"kd\">func</span> <span class=\"n\">stronglyDelegate</span><span class=\"o\">&lt;</span><span class=\"kt\">Target</span> <span class=\"p\">:</span> <span class=\"kt\">AnyObject</span><span class=\"o\">&gt;</span><span class=\"p\">(</span><span class=\"n\">to</span> <span class=\"nv\">target</span><span class=\"p\">:</span> <span class=\"kt\">Target</span><span class=\"p\">,</span>\n                                                          <span class=\"n\">with</span> <span class=\"nv\">callback</span><span class=\"p\">:</span> <span class=\"kd\">@escaping</span> <span class=\"p\">(</span><span class=\"kt\">Target</span><span class=\"p\">)</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\">call()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\">Output</span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Output%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Output` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Output%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Output</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call(_:)\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\">call(_:)</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">(</span><span class=\"n\">_</span> <span class=\"nv\">input</span><span class=\"p\">:</span> <span class=\"kt\">Input</span><span class=\"p\">)</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n            <div class=\"task-group\">\n              <div class=\"task-name-container\">\n                <a name=\"/Available%20where%20%60Input%60%20==%20%60Void%60,%20%60Output%60%20==%20%60Void%60\"></a>\n                <a name=\"//apple_ref/swift/Section/Available where `Input` == `Void`, `Output` == `Void`\" class=\"dashAnchor\"></a>\n                <div class=\"section-name-container\">\n                  <a class=\"section-name-link\" href=\"#/Available%20where%20%60Input%60%20==%20%60Void%60,%20%60Output%60%20==%20%60Void%60\"></a>\n                  <h3 class=\"section-name\"><p>Available where <code>Input</code> == <code>Void</code>, <code>Output</code> == <code>Void</code></p>\n</h3>\n                </div>\n              </div>\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\"></a>\n                    <a name=\"//apple_ref/swift/Method/call()\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\">call()</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Undocumented</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">func</span> <span class=\"nf\">call</span><span class=\"p\">()</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Structs.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Structures  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Structures\" class=\"dashAnchor\"></a>\n    <a title=\"Structures  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Structures  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Structures</h1>\n            <p>The following structures are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient12ChannelEventV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/ChannelEvent\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient12ChannelEventV\">ChannelEvent</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Represents the different events that can be sent through\na channel regarding a Channel&rsquo;s lifecycle.</p>\n\n                        <a href=\"Structs/ChannelEvent.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">ChannelEvent</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient9DelegatedV\"></a>\n                    <a name=\"//apple_ref/swift/Struct/Delegated\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient9DelegatedV\">Delegated</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Provides a memory-safe way of passing callbacks around while not creating\nretain cycles. This file was copied from <a href=\"https://github.com/dreymonde/Delegated\">https://github.com/dreymonde/Delegated</a>\ninstead of added as a dependency to reduce the number of packages that\nship with SwiftPhoenixClient</p>\n\n                        <a href=\"Structs/Delegated.html\" class=\"slightly-smaller\">See more</a>\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">struct</span> <span class=\"kt\">Delegated</span><span class=\"o\">&lt;</span><span class=\"kt\">Input</span><span class=\"p\">,</span> <span class=\"kt\">Output</span><span class=\"o\">&gt;</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/Typealiases.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Type Aliases  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a name=\"//apple_ref/swift/Section/Type Aliases\" class=\"dashAnchor\"></a>\n    <a title=\"Type Aliases  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        Type Aliases  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            <h1>Type Aliases</h1>\n            <p>The following type aliases are available globally.</p>\n\n          </section>\n          <section class=\"section task-group-section\">\n            <div class=\"task-group\">\n              <ul>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient7Payloada\"></a>\n                    <a name=\"//apple_ref/swift/Alias/Payload\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Alias for a JSON dictionary [String: Any]</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">Payload</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kt\">String</span> <span class=\"p\">:</span> <span class=\"kt\">Any</span><span class=\"p\">]</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n                <li class=\"item\">\n                  <div>\n                    <code>\n                    <a name=\"/s:18SwiftPhoenixClient14PayloadClosurea\"></a>\n                    <a name=\"//apple_ref/swift/Alias/PayloadClosure\" class=\"dashAnchor\"></a>\n                    <a class=\"token\" href=\"#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n                    </code>\n                  </div>\n                  <div class=\"height-container\">\n                    <div class=\"pointer-container\"></div>\n                    <section class=\"section\">\n                      <div class=\"pointer\"></div>\n                      <div class=\"abstract\">\n                        <p>Alias for a function returning an optional JSON dictionary (<code>Payload?</code>)</p>\n\n                      </div>\n                      <div class=\"declaration\">\n                        <h4>Declaration</h4>\n                        <div class=\"language\">\n                          <p class=\"aside-title\">Swift</p>\n                          <pre class=\"highlight swift\"><code><span class=\"kd\">public</span> <span class=\"kd\">typealias</span> <span class=\"kt\">PayloadClosure</span> <span class=\"o\">=</span> <span class=\"p\">()</span> <span class=\"o\">-&gt;</span> <span class=\"kt\"><a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a></span><span class=\"p\">?</span></code></pre>\n\n                        </div>\n                      </div>\n                    </section>\n                  </div>\n                </li>\n              </ul>\n            </div>\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/css/highlight.css",
    "content": "/* Credit to https://gist.github.com/wataru420/2048287 */\n.highlight {\n  /* Comment */\n  /* Error */\n  /* Keyword */\n  /* Operator */\n  /* Comment.Multiline */\n  /* Comment.Preproc */\n  /* Comment.Single */\n  /* Comment.Special */\n  /* Generic.Deleted */\n  /* Generic.Deleted.Specific */\n  /* Generic.Emph */\n  /* Generic.Error */\n  /* Generic.Heading */\n  /* Generic.Inserted */\n  /* Generic.Inserted.Specific */\n  /* Generic.Output */\n  /* Generic.Prompt */\n  /* Generic.Strong */\n  /* Generic.Subheading */\n  /* Generic.Traceback */\n  /* Keyword.Constant */\n  /* Keyword.Declaration */\n  /* Keyword.Pseudo */\n  /* Keyword.Reserved */\n  /* Keyword.Type */\n  /* Literal.Number */\n  /* Literal.String */\n  /* Name.Attribute */\n  /* Name.Builtin */\n  /* Name.Class */\n  /* Name.Constant */\n  /* Name.Entity */\n  /* Name.Exception */\n  /* Name.Function */\n  /* Name.Namespace */\n  /* Name.Tag */\n  /* Name.Variable */\n  /* Operator.Word */\n  /* Text.Whitespace */\n  /* Literal.Number.Float */\n  /* Literal.Number.Hex */\n  /* Literal.Number.Integer */\n  /* Literal.Number.Oct */\n  /* Literal.String.Backtick */\n  /* Literal.String.Char */\n  /* Literal.String.Doc */\n  /* Literal.String.Double */\n  /* Literal.String.Escape */\n  /* Literal.String.Heredoc */\n  /* Literal.String.Interpol */\n  /* Literal.String.Other */\n  /* Literal.String.Regex */\n  /* Literal.String.Single */\n  /* Literal.String.Symbol */\n  /* Name.Builtin.Pseudo */\n  /* Name.Variable.Class */\n  /* Name.Variable.Global */\n  /* Name.Variable.Instance */\n  /* Literal.Number.Integer.Long */ }\n  .highlight .c {\n    color: #999988;\n    font-style: italic; }\n  .highlight .err {\n    color: #a61717;\n    background-color: #e3d2d2; }\n  .highlight .k {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .o {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .cm {\n    color: #999988;\n    font-style: italic; }\n  .highlight .cp {\n    color: #999999;\n    font-weight: bold; }\n  .highlight .c1 {\n    color: #999988;\n    font-style: italic; }\n  .highlight .cs {\n    color: #999999;\n    font-weight: bold;\n    font-style: italic; }\n  .highlight .gd {\n    color: #000000;\n    background-color: #ffdddd; }\n  .highlight .gd .x {\n    color: #000000;\n    background-color: #ffaaaa; }\n  .highlight .ge {\n    color: #000000;\n    font-style: italic; }\n  .highlight .gr {\n    color: #aa0000; }\n  .highlight .gh {\n    color: #999999; }\n  .highlight .gi {\n    color: #000000;\n    background-color: #ddffdd; }\n  .highlight .gi .x {\n    color: #000000;\n    background-color: #aaffaa; }\n  .highlight .go {\n    color: #888888; }\n  .highlight .gp {\n    color: #555555; }\n  .highlight .gs {\n    font-weight: bold; }\n  .highlight .gu {\n    color: #aaaaaa; }\n  .highlight .gt {\n    color: #aa0000; }\n  .highlight .kc {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kd {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kp {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kr {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .kt {\n    color: #445588; }\n  .highlight .m {\n    color: #009999; }\n  .highlight .s {\n    color: #d14; }\n  .highlight .na {\n    color: #008080; }\n  .highlight .nb {\n    color: #0086B3; }\n  .highlight .nc {\n    color: #445588;\n    font-weight: bold; }\n  .highlight .no {\n    color: #008080; }\n  .highlight .ni {\n    color: #800080; }\n  .highlight .ne {\n    color: #990000;\n    font-weight: bold; }\n  .highlight .nf {\n    color: #990000; }\n  .highlight .nn {\n    color: #555555; }\n  .highlight .nt {\n    color: #000080; }\n  .highlight .nv {\n    color: #008080; }\n  .highlight .ow {\n    color: #000000;\n    font-weight: bold; }\n  .highlight .w {\n    color: #bbbbbb; }\n  .highlight .mf {\n    color: #009999; }\n  .highlight .mh {\n    color: #009999; }\n  .highlight .mi {\n    color: #009999; }\n  .highlight .mo {\n    color: #009999; }\n  .highlight .sb {\n    color: #d14; }\n  .highlight .sc {\n    color: #d14; }\n  .highlight .sd {\n    color: #d14; }\n  .highlight .s2 {\n    color: #d14; }\n  .highlight .se {\n    color: #d14; }\n  .highlight .sh {\n    color: #d14; }\n  .highlight .si {\n    color: #d14; }\n  .highlight .sx {\n    color: #d14; }\n  .highlight .sr {\n    color: #009926; }\n  .highlight .s1 {\n    color: #d14; }\n  .highlight .ss {\n    color: #990073; }\n  .highlight .bp {\n    color: #999999; }\n  .highlight .vc {\n    color: #008080; }\n  .highlight .vg {\n    color: #008080; }\n  .highlight .vi {\n    color: #008080; }\n  .highlight .il {\n    color: #009999; }\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/css/jazzy.css",
    "content": "html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {\n  background: transparent;\n  border: 0;\n  margin: 0;\n  outline: 0;\n  padding: 0;\n  vertical-align: baseline; }\n\nbody {\n  background-color: #f2f2f2;\n  font-family: Helvetica, freesans, Arial, sans-serif;\n  font-size: 14px;\n  -webkit-font-smoothing: subpixel-antialiased;\n  word-wrap: break-word; }\n\nh1, h2, h3 {\n  margin-top: 0.8em;\n  margin-bottom: 0.3em;\n  font-weight: 100;\n  color: black; }\n\nh1 {\n  font-size: 2.5em; }\n\nh2 {\n  font-size: 2em;\n  border-bottom: 1px solid #e2e2e2; }\n\nh4 {\n  font-size: 13px;\n  line-height: 1.5;\n  margin-top: 21px; }\n\nh5 {\n  font-size: 1.1em; }\n\nh6 {\n  font-size: 1.1em;\n  color: #777; }\n\n.section-name {\n  color: gray;\n  display: block;\n  font-family: Helvetica;\n  font-size: 22px;\n  font-weight: 100;\n  margin-bottom: 15px; }\n\npre, code {\n  font: 0.95em Menlo, monospace;\n  color: #777;\n  word-wrap: normal; }\n\np code, li code {\n  background-color: #eee;\n  padding: 2px 4px;\n  border-radius: 4px; }\n\na {\n  color: #0088cc;\n  text-decoration: none; }\n\nul {\n  padding-left: 15px; }\n\nli {\n  line-height: 1.8em; }\n\nimg {\n  max-width: 100%; }\n\nblockquote {\n  margin-left: 0;\n  padding: 0 10px;\n  border-left: 4px solid #ccc; }\n\n.content-wrapper {\n  margin: 0 auto;\n  width: 980px; }\n\nheader {\n  font-size: 0.85em;\n  line-height: 26px;\n  background-color: #414141;\n  position: fixed;\n  width: 100%;\n  z-index: 2; }\n  header img {\n    padding-right: 6px;\n    vertical-align: -4px;\n    height: 16px; }\n  header a {\n    color: #fff; }\n  header p {\n    float: left;\n    color: #999; }\n  header .header-right {\n    float: right;\n    margin-left: 16px; }\n\n#breadcrumbs {\n  background-color: #f2f2f2;\n  height: 27px;\n  padding-top: 17px;\n  position: fixed;\n  width: 100%;\n  z-index: 2;\n  margin-top: 26px; }\n  #breadcrumbs #carat {\n    height: 10px;\n    margin: 0 5px; }\n\n.sidebar {\n  background-color: #f9f9f9;\n  border: 1px solid #e2e2e2;\n  overflow-y: auto;\n  overflow-x: hidden;\n  position: fixed;\n  top: 70px;\n  bottom: 0;\n  width: 230px;\n  word-wrap: normal; }\n\n.nav-groups {\n  list-style-type: none;\n  background: #fff;\n  padding-left: 0; }\n\n.nav-group-name {\n  border-bottom: 1px solid #e2e2e2;\n  font-size: 1.1em;\n  font-weight: 100;\n  padding: 15px 0 15px 20px; }\n  .nav-group-name > a {\n    color: #333; }\n\n.nav-group-tasks {\n  margin-top: 5px; }\n\n.nav-group-task {\n  font-size: 0.9em;\n  list-style-type: none;\n  white-space: nowrap; }\n  .nav-group-task a {\n    color: #888; }\n\n.main-content {\n  background-color: #fff;\n  border: 1px solid #e2e2e2;\n  margin-left: 246px;\n  position: absolute;\n  overflow: hidden;\n  padding-bottom: 20px;\n  top: 70px;\n  width: 734px; }\n  .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {\n    margin-bottom: 1em; }\n  .main-content p {\n    line-height: 1.8em; }\n  .main-content section .section:first-child {\n    margin-top: 0;\n    padding-top: 0; }\n  .main-content section .task-group-section .task-group:first-of-type {\n    padding-top: 10px; }\n    .main-content section .task-group-section .task-group:first-of-type .section-name {\n      padding-top: 15px; }\n  .main-content section .heading:before {\n    content: \"\";\n    display: block;\n    padding-top: 70px;\n    margin: -70px 0 0; }\n  .main-content .section-name p {\n    margin-bottom: inherit;\n    line-height: inherit; }\n  .main-content .section-name code {\n    background-color: inherit;\n    padding: inherit;\n    color: inherit; }\n\n.section {\n  padding: 0 25px; }\n\n.highlight {\n  background-color: #eee;\n  padding: 10px 12px;\n  border: 1px solid #e2e2e2;\n  border-radius: 4px;\n  overflow-x: auto; }\n\n.declaration .highlight {\n  overflow-x: initial;\n  padding: 0 40px 40px 0;\n  margin-bottom: -25px;\n  background-color: transparent;\n  border: none; }\n\n.section-name {\n  margin: 0;\n  margin-left: 18px; }\n\n.task-group-section {\n  padding-left: 6px;\n  border-top: 1px solid #e2e2e2; }\n\n.task-group {\n  padding-top: 0px; }\n\n.task-name-container a[name]:before {\n  content: \"\";\n  display: block;\n  padding-top: 70px;\n  margin: -70px 0 0; }\n\n.section-name-container {\n  position: relative;\n  display: inline-block; }\n  .section-name-container .section-name-link {\n    position: absolute;\n    top: 0;\n    left: 0;\n    bottom: 0;\n    right: 0;\n    margin-bottom: 0; }\n  .section-name-container .section-name {\n    position: relative;\n    pointer-events: none;\n    z-index: 1; }\n    .section-name-container .section-name a {\n      pointer-events: auto; }\n\n.item {\n  padding-top: 8px;\n  width: 100%;\n  list-style-type: none; }\n  .item a[name]:before {\n    content: \"\";\n    display: block;\n    padding-top: 70px;\n    margin: -70px 0 0; }\n  .item code {\n    background-color: transparent;\n    padding: 0; }\n  .item .token, .item .direct-link {\n    padding-left: 3px;\n    margin-left: 15px;\n    font-size: 11.9px;\n    transition: all 300ms; }\n  .item .token-open {\n    margin-left: 0px; }\n  .item .discouraged {\n    text-decoration: line-through; }\n  .item .declaration-note {\n    font-size: .85em;\n    color: gray;\n    font-style: italic; }\n\n.pointer-container {\n  border-bottom: 1px solid #e2e2e2;\n  left: -23px;\n  padding-bottom: 13px;\n  position: relative;\n  width: 110%; }\n\n.pointer {\n  background: #f9f9f9;\n  border-left: 1px solid #e2e2e2;\n  border-top: 1px solid #e2e2e2;\n  height: 12px;\n  left: 21px;\n  top: -7px;\n  -webkit-transform: rotate(45deg);\n  -moz-transform: rotate(45deg);\n  -o-transform: rotate(45deg);\n  transform: rotate(45deg);\n  position: absolute;\n  width: 12px; }\n\n.height-container {\n  display: none;\n  left: -25px;\n  padding: 0 25px;\n  position: relative;\n  width: 100%;\n  overflow: hidden; }\n  .height-container .section {\n    background: #f9f9f9;\n    border-bottom: 1px solid #e2e2e2;\n    left: -25px;\n    position: relative;\n    width: 100%;\n    padding-top: 10px;\n    padding-bottom: 5px; }\n\n.aside, .language {\n  padding: 6px 12px;\n  margin: 12px 0;\n  border-left: 5px solid #dddddd;\n  overflow-y: hidden; }\n  .aside .aside-title, .language .aside-title {\n    font-size: 9px;\n    letter-spacing: 2px;\n    text-transform: uppercase;\n    padding-bottom: 0;\n    margin: 0;\n    color: #aaa;\n    -webkit-user-select: none; }\n  .aside p:last-child, .language p:last-child {\n    margin-bottom: 0; }\n\n.language {\n  border-left: 5px solid #cde9f4; }\n  .language .aside-title {\n    color: #4b8afb; }\n\n.aside-warning, .aside-deprecated, .aside-unavailable {\n  border-left: 5px solid #ff6666; }\n  .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {\n    color: #ff0000; }\n\n.graybox {\n  border-collapse: collapse;\n  width: 100%; }\n  .graybox p {\n    margin: 0;\n    word-break: break-word;\n    min-width: 50px; }\n  .graybox td {\n    border: 1px solid #e2e2e2;\n    padding: 5px 25px 5px 10px;\n    vertical-align: middle; }\n  .graybox tr td:first-of-type {\n    text-align: right;\n    padding: 7px;\n    vertical-align: top;\n    word-break: normal;\n    width: 40px; }\n\n.slightly-smaller {\n  font-size: 0.9em; }\n\n#footer {\n  position: relative;\n  top: 10px;\n  bottom: 0px;\n  margin-left: 25px; }\n  #footer p {\n    margin: 0;\n    color: #aaa;\n    font-size: 0.8em; }\n\nhtml.dash header, html.dash #breadcrumbs, html.dash .sidebar {\n  display: none; }\n\nhtml.dash .main-content {\n  width: 980px;\n  margin-left: 0;\n  border: none;\n  width: 100%;\n  top: 0;\n  padding-bottom: 0; }\n\nhtml.dash .height-container {\n  display: block; }\n\nhtml.dash .item .token {\n  margin-left: 0; }\n\nhtml.dash .content-wrapper {\n  width: auto; }\n\nhtml.dash #footer {\n  position: static; }\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>SwiftPhoenixClient  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a title=\"SwiftPhoenixClient  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        SwiftPhoenixClient  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            \n            <h1 id='swift-phoenix-client' class='heading'>Swift Phoenix Client</h1>\n\n<p><a href=\"https://swift.org/\"><img src=\"https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat\" alt=\"Swift\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/v/SwiftPhoenixClient.svg?style=flat\" alt=\"Version\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/l/SwiftPhoenixClient.svg?style=flat\" alt=\"License\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/p/SwiftPhoenixClient.svg?style=flat\" alt=\"Platform\"></a>\n<a href=\"https://github.com/Carthage/Carthage\"><img src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\"></a>\n<a href=\"https://www.codetriage.com/davidstump/swiftphoenixclient\"><img src=\"https://www.codetriage.com/davidstump/swiftphoenixclient/badges/users.svg\" alt=\"Open Source Helpers\"></a></p>\n<h2 id='about' class='heading'>About</h2>\n\n<p>Swift Phoenix Client is an extension of Starscream websocket client library\nthat makes it easy to connect to Phoenix sockets in a similar manner to the\nphoenix.js client.</p>\n\n<p>The client is currently updated to mirror phoenix.js 1.4.</p>\n<h3 id='swift-versions' class='heading'>Swift Versions</h3>\n\n<p><code>master</code> currently supports Swift 5.0. You&rsquo;ll need to set your target to <code>= 1.0.1</code> if your project is using Swift 4.2</p>\n\n<table><thead>\n<tr>\n<th>swift</th>\n<th>client</th>\n</tr>\n</thead><tbody>\n<tr>\n<td>4.2</td>\n<td>1.0.1</td>\n</tr>\n<tr>\n<td>5.0</td>\n<td>1.1.0</td>\n</tr>\n</tbody></table>\n<h2 id='installation' class='heading'>Installation</h2>\n<h3 id='cocoapods' class='heading'>CocoaPods</h3>\n\n<p>You can install SwiftPhoenix Client via CocoaPods by adding the following to your\nPodfile. Keep in mind that in order to use Swift Phoenix Client, the minimum iOS\ntarget must be &lsquo;9.0&rsquo;</p>\n<pre class=\"highlight plaintext\"><code>platform :ios, '9.0'\nuse_frameworks!\n\npod \"SwiftPhoenixClient\", '~&gt; 1.0'\n</code></pre>\n\n<p>and running <code>pod install</code>. From there you will need to add <code>import SwiftPhoenixClient</code> in any class you want it to be used.</p>\n<h3 id='carthage' class='heading'>Carthage</h3>\n\n<p>If you use Carthage to manage your dependencies, simply add\nSwiftPhoenixClient to your <code>Cartfile</code>:</p>\n<pre class=\"highlight plaintext\"><code>github \"davidstump/SwiftPhoenixClient\" ~&gt; 1.0\n</code></pre>\n<h3 id='swiftpackagemanager' class='heading'>SwiftPackageManager</h3>\n\n<p>SwiftPackageManager is properly supported starting in SwiftPhoenixClient v1.2.0. You can add the following to your <code>Package.swift</code></p>\n<pre class=\"highlight plaintext\"><code>.package(url: \"https://github.com/davidstump/SwiftPhoenixClient.git\", .upToNextMajor(from: \"1.2.0\"))\n</code></pre>\n\n<p>Make sure you have added <code>SwiftPhoenixClient.framework</code>, and <code>Starscream.framework</code> to the &ldquo;<em>Linked Frameworks and Libraries</em>&rdquo; section of your target, and have included them in your Carthage framework copying build phase.</p>\n<h2 id='usage' class='heading'>Usage</h2>\n\n<p>Using the Swift Phoenix Client is extremely easy (and familiar if have used the phoenix.s client).</p>\n\n<p>See the <a href=\"https://github.com/davidstump/SwiftPhoenixClient/wiki/Usage-Guide\">Usage Guide</a> for details instructions. You can also check out the <a href=\"http://davidstump.github.io/SwiftPhoenixClient/\">documentation</a></p>\n<h2 id='example' class='heading'>Example</h2>\n\n<p>Check out the <a href=\"https://github.com/davidstump/SwiftPhoenixClient/blob/master/Example/ChatExample/ViewController.swift\">ViewController</a> in this repo for a brief example of a simple iOS chat application using the <a href=\"https://github.com/chrismccord/phoenix_chat_example\">Phoenix Chat Example</a></p>\n\n<p>Also check out both the Swift and Elixir channels on IRC.</p>\n<h2 id='development' class='heading'>Development</h2>\n\n<p>Check out the wiki page for <a href=\"https://github.com/davidstump/SwiftPhoenixClient/wiki/Contributing\">getting started</a></p>\n\n<p>Tested with the <a href=\"https://github.com/chrismccord/phoenix_chat_example\">Phoenix Chat Server example</a>, upgraded to Phoenix 1.2.</p>\n<h2 id='thanks' class='heading'>Thanks</h2>\n\n<p>Many many thanks to <a href=\"https://github.com/dsrees\">Daniel Rees</a> for his many contributions and continued maintenance of this project!</p>\n<h2 id='license' class='heading'>License</h2>\n\n<p>SwiftPhoenixClient is available under the MIT license. See the LICENSE file for more info.</p>\n\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/js/jazzy.js",
    "content": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n  document.documentElement.className += ' dash'\n  window.jazzy.docset = true\n}\nif (navigator.userAgent.match(/xcode/i)) {\n  document.documentElement.className += ' xcode'\n  window.jazzy.docset = true\n}\n\nfunction toggleItem($link, $content) {\n  var animationDuration = 300;\n  $link.toggleClass('token-open');\n  $content.slideToggle(animationDuration);\n}\n\nfunction itemLinkToContent($link) {\n  return $link.parent().parent().next();\n}\n\n// On doc load + hash-change, open any targetted item\nfunction openCurrentItemIfClosed() {\n  if (window.jazzy.docset) {\n    return;\n  }\n  var $link = $(`.token[href=\"${location.hash}\"]`);\n  $content = itemLinkToContent($link);\n  if ($content.is(':hidden')) {\n    toggleItem($link, $content);\n  }\n}\n\n$(openCurrentItemIfClosed);\n$(window).on('hashchange', openCurrentItemIfClosed);\n\n// On item link ('token') click, toggle its discussion\n$('.token').on('click', function(event) {\n  if (window.jazzy.docset) {\n    return;\n  }\n  var $link = $(this);\n  toggleItem($link, itemLinkToContent($link));\n\n  // Keeps the document from jumping to the hash.\n  var href = $link.attr('href');\n  if (history.pushState) {\n    history.pushState({}, '', href);\n  } else {\n    location.hash = href;\n  }\n  event.preventDefault();\n});\n\n// Clicks on links to the current, closed, item need to open the item\n$(\"a:not('.token')\").on('click', function() {\n  if (location == this.href) {\n    openCurrentItemIfClosed();\n  }\n});\n"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/search.json",
    "content": "{\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\":{\"name\":\"Payload\",\"abstract\":\"<p>Alias for a JSON dictionary [String: Any]</p>\"},\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\":{\"name\":\"PayloadClosure\",\"abstract\":\"<p>Alias for a function returning an optional JSON dictionary (<code>Payload?</code>)</p>\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\":{\"name\":\"init()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\":{\"name\":\"delegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\":{\"name\":\"call(_:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\":{\"name\":\"isDelegateSet\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\":{\"name\":\"stronglyDelegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\":{\"name\":\"manuallyDelegate(with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\":{\"name\":\"removeDelegate()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\":{\"name\":\"delegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\":{\"name\":\"stronglyDelegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\":{\"name\":\"call()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\":{\"name\":\"call(_:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\":{\"name\":\"call()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\":{\"name\":\"heartbeat\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\":{\"name\":\"join\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\":{\"name\":\"leave\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\":{\"name\":\"reply\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\":{\"name\":\"error\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\":{\"name\":\"close\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html\":{\"name\":\"ChannelEvent\",\"abstract\":\"<p>Represents the different events that can be sent through\"},\"Structs/Delegated.html\":{\"name\":\"Delegated\",\"abstract\":\"<p>Provides a memory-safe way of passing callbacks around while not creating\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\":{\"name\":\"closed\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\":{\"name\":\"errored\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\":{\"name\":\"joined\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\":{\"name\":\"joining\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\":{\"name\":\"leaving\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html\":{\"name\":\"ChannelState\",\"abstract\":\"<p>Represents the multiple states that a Channel can be in\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\":{\"name\":\"timeoutInterval\",\"abstract\":\"<p>Default timeout when sending messages</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\":{\"name\":\"heartbeatInterval\",\"abstract\":\"<p>Default interval to send heartbeats on</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\":{\"name\":\"reconnectSteppedBackOff\",\"abstract\":\"<p>Default reconnect algorithm for the socket</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\":{\"name\":\"rejoinSteppedBackOff\",\"abstract\":\"<p>Default rejoin algorithm for individual channels</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\":{\"name\":\"encode\",\"abstract\":\"<p>Default encode function, utilizing JSONSerialization.data</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\":{\"name\":\"decode\",\"abstract\":\"<p>Default decode function, utilizing JSONSerialization.jsonObject</p>\",\"parent_name\":\"Defaults\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC8endPointSSvp\":{\"name\":\"endPoint\",\"abstract\":\"<p>The string WebSocket endpoint (ie <code>&quot;ws://example.com/socket&quot;</code>,\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\":{\"name\":\"endPointUrl\",\"abstract\":\"<p>The fully qualified socket URL</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\":{\"name\":\"params\",\"abstract\":\"<p>Resolves to return the <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\\\">paramsClosure</a></code> result at the time of calling.\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\":{\"name\":\"paramsClosure\",\"abstract\":\"<p>The optional params closure used to get params whhen connecting. Must\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\":{\"name\":\"encode\",\"abstract\":\"<p>Override to provide custom encoding of data before writing to the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\":{\"name\":\"decode\",\"abstract\":\"<p>Override to provide customd decoding of data read from the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\":{\"name\":\"timeout\",\"abstract\":\"<p>Timeout to use when opening connections</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\":{\"name\":\"heartbeatInterval\",\"abstract\":\"<p>Interval between sending a heartbeat</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\":{\"name\":\"reconnectAfter\",\"abstract\":\"<p>Interval between socket reconnect attempts, in seconds</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\":{\"name\":\"rejoinAfter\",\"abstract\":\"<p>Interval between channel rejoin attempts, in seconds</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\":{\"name\":\"logger\",\"abstract\":\"<p>The optional function to receive logs</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\":{\"name\":\"skipHeartbeat\",\"abstract\":\"<p>Disables heartbeats from being sent. Default is false.</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\":{\"name\":\"disableSSLCertValidation\",\"abstract\":\"<p>Enable/Disable SSL certificate validation. Default is false. This\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\":{\"name\":\"security\",\"abstract\":\"<p>Configure custom SSL validation logic, eg. SSL pinning. This\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\":{\"name\":\"enabledSSLCipherSuites\",\"abstract\":\"<p>Configure the encryption used by your client by setting the\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\":{\"name\":\"init(_:params:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\":{\"name\":\"init(_:paramsClosure:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\":{\"name\":\"websocketProtocol\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\":{\"name\":\"isConnected\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7connectyyF\":{\"name\":\"connect()\",\"abstract\":\"<p>Connects the Socket. The params passed to the Socket on initialization\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\":{\"name\":\"disconnect(code:callback:)\",\"abstract\":\"<p>Disconnects the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\":{\"name\":\"onOpen(callback:)\",\"abstract\":\"<p>Registers callbacks for connection open events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\":{\"name\":\"delegateOnOpen(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection open events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\":{\"name\":\"onClose(callback:)\",\"abstract\":\"<p>Registers callbacks for connection close events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\":{\"name\":\"delegateOnClose(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection close events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\":{\"name\":\"onError(callback:)\",\"abstract\":\"<p>Registers callbacks for connection error events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\":{\"name\":\"delegateOnError(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection error events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\":{\"name\":\"onMessage(callback:)\",\"abstract\":\"<p>Registers callbacks for connection message events. Does not handle\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\":{\"name\":\"delegateOnMessage(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection message events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\":{\"name\":\"releaseCallbacks()\",\"abstract\":\"<p>Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\":{\"name\":\"channel(_:params:)\",\"abstract\":\"<p>Initialize a new Channel</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\":{\"name\":\"remove(_:)\",\"abstract\":\"<p>Removes the Channel from the socket. This does not cause the channel to\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\":{\"name\":\"makeRef()\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\":{\"name\":\"websocketDidConnect(socket:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\":{\"name\":\"websocketDidDisconnect(socket:error:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\":{\"name\":\"websocketDidReceiveMessage(socket:text:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\":{\"name\":\"websocketDidReceiveData(socket:data:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\":{\"name\":\"channel\",\"abstract\":\"<p>The channel sending the Push</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC5eventSSvp\":{\"name\":\"event\",\"abstract\":\"<p>The event, for example <code>phx_join</code></p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\":{\"name\":\"payload\",\"abstract\":\"<p>The payload, for example [&ldquo;user_id&rdquo;: &ldquo;abc123&rdquo;]</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7timeoutSdvp\":{\"name\":\"timeout\",\"abstract\":\"<p>The push timeout. Default is 10.0 seconds</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC6resendyySdF\":{\"name\":\"resend(_:)\",\"abstract\":\"<p>Resets and sends the Push</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC4sendyyF\":{\"name\":\"send()\",\"abstract\":\"<p>Sends the Push. If it has already timed out, then the call will\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\":{\"name\":\"receive(_:callback:)\",\"abstract\":\"<p>Receive a specific event when sending an Outbound message. Subscribing\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\":{\"name\":\"delegateReceive(_:to:callback:)\",\"abstract\":\"<p>Receive a specific event when sending an Outbound message. Automatically\",\"parent_name\":\"Push\"},\"Classes/Presence/Events.html#/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\":{\"name\":\"state\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Events\"},\"Classes/Presence/Events.html#/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\":{\"name\":\"diff\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Events\"},\"Classes/Presence/Options.html#/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\":{\"name\":\"defaults\",\"abstract\":\"<p>Default set of Options used when creating Presence. Uses the\",\"parent_name\":\"Options\"},\"Classes/Presence/Options.html\":{\"name\":\"Options\",\"abstract\":\"<p>Custom options that can be provided when creating Presence</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence/Events.html\":{\"name\":\"Events\",\"abstract\":\"<p>Presense Events</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Metaa\":{\"name\":\"Meta\",\"abstract\":\"<p>Meta details of a Presence. Just a dictionary of properties</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\":{\"name\":\"Map\",\"abstract\":\"<p>A mapping of a String to an array of Metas. e.g. {&ldquo;metas&rdquo;: [{id: 1}]}</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\":{\"name\":\"State\",\"abstract\":\"<p>A mapping of a Presence state to a mapping of Metas</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\":{\"name\":\"Diff\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\":{\"name\":\"OnJoin\",\"abstract\":\"<p>Closure signature of OnJoin callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\":{\"name\":\"OnLeave\",\"abstract\":\"<p>Closure signature for OnLeave callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\":{\"name\":\"OnSync\",\"abstract\":\"<p>/ Closure signature for OnSync callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\":{\"name\":\"state\",\"abstract\":\"<p>The state of the Presence</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\":{\"name\":\"pendingDiffs\",\"abstract\":\"<p>Pending <code>join</code> and <code>leave</code> diffs that need to be synced</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\":{\"name\":\"joinRef\",\"abstract\":\"<p>The channel&rsquo;s joinRef, set when state events occur</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\":{\"name\":\"isPendingSyncState\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\":{\"name\":\"onJoin\",\"abstract\":\"<p>Callback to be informed of joins</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\":{\"name\":\"onJoin(_:)\",\"abstract\":\"<p>Set the OnJoin callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\":{\"name\":\"onLeave\",\"abstract\":\"<p>Callback to be informed of leaves</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\":{\"name\":\"onLeave(_:)\",\"abstract\":\"<p>Set the OnLeave callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\":{\"name\":\"onSync\",\"abstract\":\"<p>Callback to be informed of synces</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\":{\"name\":\"onSync(_:)\",\"abstract\":\"<p>Set the OnSync callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\":{\"name\":\"init(channel:opts:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\":{\"name\":\"list()\",\"abstract\":\"<p>Returns the array of presences, with deault selected metadata.</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\":{\"name\":\"list(by:)\",\"abstract\":\"<p>Returns the array of presences, with selected metadata</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\":{\"name\":\"filter(by:)\",\"abstract\":\"<p>Filter the Presence state with a given function</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\":{\"name\":\"syncState(_:newState:onJoin:onLeave:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\":{\"name\":\"syncDiff(_:diff:onJoin:onLeave:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\":{\"name\":\"filter(_:by:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\":{\"name\":\"listBy(_:transformer:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC3refSSvp\":{\"name\":\"ref\",\"abstract\":\"<p>Reference number. Empty if missing</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC5topicSSvp\":{\"name\":\"topic\",\"abstract\":\"<p>Message topic</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC5eventSSvp\":{\"name\":\"event\",\"abstract\":\"<p>Message event</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\":{\"name\":\"payload\",\"abstract\":\"<p>Message payload</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\":{\"name\":\"status\",\"abstract\":\"<p>Convenience accessor. Equivalent to getting the status as such:</p>\",\"parent_name\":\"Message\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC5topicSSvp\":{\"name\":\"topic\",\"abstract\":\"<p>The topic of the Channel. e.g. &ldquo;rooms:friends&rdquo;</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\":{\"name\":\"params\",\"abstract\":\"<p>The params sent when joining the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\":{\"name\":\"onMessage\",\"abstract\":\"<p>Overridable message hook. Receives all events for specialized message\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\":{\"name\":\"join(timeout:)\",\"abstract\":\"<p>Joins the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\":{\"name\":\"onClose(_:)\",\"abstract\":\"<p>Hook into when the Channel is closed. Does not handle retain cycles.\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOnClose(to:callback:)\",\"abstract\":\"<p>Hook into when the Channel is closed. Automatically handles retain\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\":{\"name\":\"onError(_:)\",\"abstract\":\"<p>Hook into when the Channel receives an Error. Does not handle retain\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOnError(to:callback:)\",\"abstract\":\"<p>Hook into when the Channel receives an Error. Automatically handles\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\":{\"name\":\"on(_:callback:)\",\"abstract\":\"<p>Subscribes on channel events. Does not handle retain cycles. Use\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOn(_:to:callback:)\",\"abstract\":\"<p>Subscribes on channel events. Automatically handles retain cycles. Use\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\":{\"name\":\"off(_:ref:)\",\"abstract\":\"<p>Unsubscribes from a channel event. If a <code>ref</code> is given, only the exact\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\":{\"name\":\"push(_:payload:timeout:)\",\"abstract\":\"<p>Push a payload to the Channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\":{\"name\":\"leave(timeout:)\",\"abstract\":\"<p>Leaves the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\":{\"name\":\"onMessage(callback:)\",\"abstract\":\"<p>Overridable message hook. Receives all events for specialized message\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\":{\"name\":\"isClosed\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\":{\"name\":\"isErrored\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\":{\"name\":\"isJoined\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\":{\"name\":\"isJoining\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\":{\"name\":\"isLeaving\",\"parent_name\":\"Channel\"},\"Classes/Channel.html\":{\"name\":\"Channel\",\"abstract\":\"<p>Undocumented</p>\"},\"Classes/Message.html\":{\"name\":\"Message\",\"abstract\":\"<p>Data that is received from the Server.</p>\"},\"Classes/Presence.html\":{\"name\":\"Presence\",\"abstract\":\"<p>The Presence object provides features for syncing presence information from\"},\"Classes/Push.html\":{\"name\":\"Push\",\"abstract\":\"<p>Represnts pushing data to a <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Channel.html\\\">Channel</a></code> through the <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Socket.html\\\">Socket</a></code></p>\"},\"Classes/Socket.html\":{\"name\":\"Socket\",\"abstract\":\"<h2 id='socket-connection' class='heading'>Socket Connection</h2>\"},\"Classes/Defaults.html\":{\"name\":\"Defaults\",\"abstract\":\"<p>A collection of default values and behaviors used accross the Client</p>\"},\"Classes.html\":{\"name\":\"Classes\",\"abstract\":\"<p>The following classes are available globally.</p>\"},\"Enums.html\":{\"name\":\"Enumerations\",\"abstract\":\"<p>The following enumerations are available globally.</p>\"},\"Structs.html\":{\"name\":\"Structures\",\"abstract\":\"<p>The following structures are available globally.</p>\"},\"Typealiases.html\":{\"name\":\"Type Aliases\",\"abstract\":\"<p>The following type aliases are available globally.</p>\"}}"
  },
  {
    "path": "docs/docsets/SwiftPhoenixClient.docset/Contents/Resources/Documents/undocumented.json",
    "content": "{\n  \"warnings\": [\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 118,\n      \"symbol\": \"Presence.Events.state\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 119,\n      \"symbol\": \"Presence.Events.diff\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 136,\n      \"symbol\": \"Presence.Diff\",\n      \"symbol_kind\": \"source.lang.swift.decl.typealias\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 173,\n      \"symbol\": \"Presence.isPendingSyncState\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 212,\n      \"symbol\": \"Presence.init(channel:opts:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 285,\n      \"symbol\": \"Presence.syncState(_:newState:onJoin:onLeave:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 340,\n      \"symbol\": \"Presence.syncDiff(_:diff:onJoin:onLeave:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 380,\n      \"symbol\": \"Presence.filter(_:by:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Presence.swift\",\n      \"line\": 386,\n      \"symbol\": \"Presence.listBy(_:transformer:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Socket.swift\",\n      \"line\": 143,\n      \"symbol\": \"Socket.init(_:params:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Socket.swift\",\n      \"line\": 663,\n      \"symbol\": \"Socket.websocketDidConnect(socket:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Socket.swift\",\n      \"line\": 667,\n      \"symbol\": \"Socket.websocketDidDisconnect(socket:error:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Socket.swift\",\n      \"line\": 672,\n      \"symbol\": \"Socket.websocketDidReceiveMessage(socket:text:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Socket.swift\",\n      \"line\": 676,\n      \"symbol\": \"Socket.websocketDidReceiveData(socket:data:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 59,\n      \"symbol\": \"ChannelState.closed\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 60,\n      \"symbol\": \"ChannelState.errored\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 61,\n      \"symbol\": \"ChannelState.joined\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 62,\n      \"symbol\": \"ChannelState.joining\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 63,\n      \"symbol\": \"ChannelState.leaving\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 69,\n      \"symbol\": \"ChannelEvent.heartbeat\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 70,\n      \"symbol\": \"ChannelEvent.join\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 71,\n      \"symbol\": \"ChannelEvent.leave\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 72,\n      \"symbol\": \"ChannelEvent.reply\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 73,\n      \"symbol\": \"ChannelEvent.error\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Defaults.swift\",\n      \"line\": 74,\n      \"symbol\": \"ChannelEvent.close\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 31,\n      \"symbol\": \"Delegated.init()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 33,\n      \"symbol\": \"Delegated.delegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 43,\n      \"symbol\": \"Delegated.call(_:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 47,\n      \"symbol\": \"Delegated.isDelegateSet\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 55,\n      \"symbol\": \"Delegated.stronglyDelegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 62,\n      \"symbol\": \"Delegated.manuallyDelegate(with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 66,\n      \"symbol\": \"Delegated.removeDelegate()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 74,\n      \"symbol\": \"Delegated.delegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 79,\n      \"symbol\": \"Delegated.stronglyDelegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 88,\n      \"symbol\": \"Delegated.call()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 96,\n      \"symbol\": \"Delegated.call(_:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/client/Utilities/Delegated.swift\",\n      \"line\": 104,\n      \"symbol\": \"Delegated.call()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    }\n  ],\n  \"source_directory\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient\"\n}"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>SwiftPhoenixClient  Reference</title>\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/jazzy.css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"css/highlight.css\" />\n    <meta charset='utf-8'>\n    <script src=\"js/jquery.min.js\" defer></script>\n    <script src=\"js/jazzy.js\" defer></script>\n    \n  </head>\n  <body>\n    <a title=\"SwiftPhoenixClient  Reference\"></a>\n    <header>\n      <div class=\"content-wrapper\">\n        <p><a href=\"index.html\">SwiftPhoenixClient Docs</a> (72% documented)</p>\n      </div>\n    </header>\n    <div class=\"content-wrapper\">\n      <p id=\"breadcrumbs\">\n        <a href=\"index.html\">SwiftPhoenixClient Reference</a>\n        <img id=\"carat\" src=\"img/carat.png\" />\n        SwiftPhoenixClient  Reference\n      </p>\n    </div>\n    <div class=\"content-wrapper\">\n      <nav class=\"sidebar\">\n        <ul class=\"nav-groups\">\n          <li class=\"nav-group-name\">\n            <a href=\"Classes.html\">Classes</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Channel.html\">Channel</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Defaults.html\">Defaults</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Message.html\">Message</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence.html\">Presence</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Options.html\">– Options</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Presence/Events.html\">– Events</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Push.html\">Push</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Classes/Socket.html\">Socket</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Enums.html\">Enumerations</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Enums/ChannelState.html\">ChannelState</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Structs.html\">Structures</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/ChannelEvent.html\">ChannelEvent</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Structs/Delegated.html\">Delegated</a>\n              </li>\n            </ul>\n          </li>\n          <li class=\"nav-group-name\">\n            <a href=\"Typealiases.html\">Type Aliases</a>\n            <ul class=\"nav-group-tasks\">\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\">Payload</a>\n              </li>\n              <li class=\"nav-group-task\">\n                <a href=\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\">PayloadClosure</a>\n              </li>\n            </ul>\n          </li>\n        </ul>\n      </nav>\n      <article class=\"main-content\">\n        <section>\n          <section class=\"section\">\n            \n            <h1 id='swift-phoenix-client' class='heading'>Swift Phoenix Client</h1>\n\n<p><a href=\"https://swift.org/\"><img src=\"https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat\" alt=\"Swift\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/v/SwiftPhoenixClient.svg?style=flat\" alt=\"Version\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/l/SwiftPhoenixClient.svg?style=flat\" alt=\"License\"></a>\n<a href=\"http://cocoapods.org/pods/SwiftPhoenixClient\"><img src=\"https://img.shields.io/cocoapods/p/SwiftPhoenixClient.svg?style=flat\" alt=\"Platform\"></a>\n<a href=\"https://github.com/Carthage/Carthage\"><img src=\"https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat\" alt=\"Carthage compatible\"></a>\n<a href=\"https://www.codetriage.com/davidstump/swiftphoenixclient\"><img src=\"https://www.codetriage.com/davidstump/swiftphoenixclient/badges/users.svg\" alt=\"Open Source Helpers\"></a></p>\n<h2 id='about' class='heading'>About</h2>\n\n<p>Swift Phoenix Client is an extension of Starscream websocket client library\nthat makes it easy to connect to Phoenix sockets in a similar manner to the\nphoenix.js client.</p>\n\n<p>The client is currently updated to mirror phoenix.js 1.4.</p>\n<h3 id='swift-versions' class='heading'>Swift Versions</h3>\n\n<p><code>master</code> currently supports Swift 5.0. You&rsquo;ll need to set your target to <code>= 1.0.1</code> if your project is using Swift 4.2</p>\n\n<table><thead>\n<tr>\n<th>swift</th>\n<th>client</th>\n</tr>\n</thead><tbody>\n<tr>\n<td>4.2</td>\n<td>1.0.1</td>\n</tr>\n<tr>\n<td>5.0</td>\n<td>1.1.0</td>\n</tr>\n</tbody></table>\n<h2 id='installation' class='heading'>Installation</h2>\n<h3 id='cocoapods' class='heading'>CocoaPods</h3>\n\n<p>You can install SwiftPhoenix Client via CocoaPods by adding the following to your\nPodfile. Keep in mind that in order to use Swift Phoenix Client, the minimum iOS\ntarget must be &lsquo;9.0&rsquo;</p>\n<pre class=\"highlight plaintext\"><code>platform :ios, '9.0'\nuse_frameworks!\n\npod \"SwiftPhoenixClient\", '~&gt; 1.0'\n</code></pre>\n\n<p>and running <code>pod install</code>. From there you will need to add <code>import SwiftPhoenixClient</code> in any class you want it to be used.</p>\n<h3 id='carthage' class='heading'>Carthage</h3>\n\n<p>If you use Carthage to manage your dependencies, simply add\nSwiftPhoenixClient to your <code>Cartfile</code>:</p>\n<pre class=\"highlight plaintext\"><code>github \"davidstump/SwiftPhoenixClient\" ~&gt; 1.0\n</code></pre>\n<h3 id='swiftpackagemanager' class='heading'>SwiftPackageManager</h3>\n\n<p>SwiftPackageManager is properly supported starting in SwiftPhoenixClient v1.2.0. You can add the following to your <code>Package.swift</code></p>\n<pre class=\"highlight plaintext\"><code>.package(url: \"https://github.com/davidstump/SwiftPhoenixClient.git\", .upToNextMajor(from: \"1.2.0\"))\n</code></pre>\n\n<p>Make sure you have added <code>SwiftPhoenixClient.framework</code>, and <code>Starscream.framework</code> to the &ldquo;<em>Linked Frameworks and Libraries</em>&rdquo; section of your target, and have included them in your Carthage framework copying build phase.</p>\n<h2 id='usage' class='heading'>Usage</h2>\n\n<p>Using the Swift Phoenix Client is extremely easy (and familiar if have used the phoenix.s client).</p>\n\n<p>See the <a href=\"https://github.com/davidstump/SwiftPhoenixClient/wiki/Usage-Guide\">Usage Guide</a> for details instructions. You can also check out the <a href=\"http://davidstump.github.io/SwiftPhoenixClient/\">documentation</a></p>\n<h2 id='example' class='heading'>Example</h2>\n\n<p>Check out the <a href=\"https://github.com/davidstump/SwiftPhoenixClient/blob/master/Example/ChatExample/ViewController.swift\">ViewController</a> in this repo for a brief example of a simple iOS chat application using the <a href=\"https://github.com/chrismccord/phoenix_chat_example\">Phoenix Chat Example</a></p>\n\n<p>Also check out both the Swift and Elixir channels on IRC.</p>\n<h2 id='development' class='heading'>Development</h2>\n\n<p>Check out the wiki page for <a href=\"https://github.com/davidstump/SwiftPhoenixClient/wiki/Contributing\">getting started</a></p>\n\n<p>Tested with the <a href=\"https://github.com/chrismccord/phoenix_chat_example\">Phoenix Chat Server example</a>, upgraded to Phoenix 1.2.</p>\n<h2 id='thanks' class='heading'>Thanks</h2>\n\n<p>Many many thanks to <a href=\"https://github.com/dsrees\">Daniel Rees</a> for his many contributions and continued maintenance of this project!</p>\n<h2 id='license' class='heading'>License</h2>\n\n<p>SwiftPhoenixClient is available under the MIT license. See the LICENSE file for more info.</p>\n\n          </section>\n        </section>\n        <section id=\"footer\">\n          <p>&copy; 2019 <a class=\"link\" href=\"https://github.com/davidstump/SwiftPhoenixClient\" target=\"_blank\" rel=\"external\">David Stump</a>. All rights reserved. (Last updated: 2019-12-23)</p>\n          <p>Generated by <a class=\"link\" href=\"https://github.com/realm/jazzy\" target=\"_blank\" rel=\"external\">jazzy ♪♫ v0.13.0</a>, a <a class=\"link\" href=\"https://realm.io\" target=\"_blank\" rel=\"external\">Realm</a> project.</p>\n        </section>\n      </article>\n    </div>\n  </body>\n</div>\n</html>\n"
  },
  {
    "path": "docs/js/jazzy.js",
    "content": "window.jazzy = {'docset': false}\nif (typeof window.dash != 'undefined') {\n  document.documentElement.className += ' dash'\n  window.jazzy.docset = true\n}\nif (navigator.userAgent.match(/xcode/i)) {\n  document.documentElement.className += ' xcode'\n  window.jazzy.docset = true\n}\n\nfunction toggleItem($link, $content) {\n  var animationDuration = 300;\n  $link.toggleClass('token-open');\n  $content.slideToggle(animationDuration);\n}\n\nfunction itemLinkToContent($link) {\n  return $link.parent().parent().next();\n}\n\n// On doc load + hash-change, open any targetted item\nfunction openCurrentItemIfClosed() {\n  if (window.jazzy.docset) {\n    return;\n  }\n  var $link = $(`.token[href=\"${location.hash}\"]`);\n  $content = itemLinkToContent($link);\n  if ($content.is(':hidden')) {\n    toggleItem($link, $content);\n  }\n}\n\n$(openCurrentItemIfClosed);\n$(window).on('hashchange', openCurrentItemIfClosed);\n\n// On item link ('token') click, toggle its discussion\n$('.token').on('click', function(event) {\n  if (window.jazzy.docset) {\n    return;\n  }\n  var $link = $(this);\n  toggleItem($link, itemLinkToContent($link));\n\n  // Keeps the document from jumping to the hash.\n  var href = $link.attr('href');\n  if (history.pushState) {\n    history.pushState({}, '', href);\n  } else {\n    location.hash = href;\n  }\n  event.preventDefault();\n});\n\n// Clicks on links to the current, closed, item need to open the item\n$(\"a:not('.token')\").on('click', function() {\n  if (location == this.href) {\n    openCurrentItemIfClosed();\n  }\n});\n"
  },
  {
    "path": "docs/search.json",
    "content": "{\"Typealiases.html#/s:18SwiftPhoenixClient7Payloada\":{\"name\":\"Payload\",\"abstract\":\"<p>Alias for a JSON dictionary [String: Any]</p>\"},\"Typealiases.html#/s:18SwiftPhoenixClient14PayloadClosurea\":{\"name\":\"PayloadClosure\",\"abstract\":\"<p>Alias for a function returning an optional JSON dictionary (<code>Payload?</code>)</p>\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVACyxq_Gycfc\":{\"name\":\"init()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV8delegate2to4withyqd___q_qd___xtctRld__ClF\":{\"name\":\"delegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV4callyq_SgxF\":{\"name\":\"call(_:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV13isDelegateSetSbvp\":{\"name\":\"isDelegateSet\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV16stronglyDelegate2to4withyqd___q_qd___xtctRld__ClF\":{\"name\":\"stronglyDelegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV16manuallyDelegate4withyq_xc_tF\":{\"name\":\"manuallyDelegate(with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedV14removeDelegateyyF\":{\"name\":\"removeDelegate()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE8delegate2to4withyqd___q_qd__ctRld__ClF\":{\"name\":\"delegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE16stronglyDelegate2to4withyqd___q_qd__ctRld__ClF\":{\"name\":\"stronglyDelegate(to:with:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszrlE4callq_SgyF\":{\"name\":\"call()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRs_rlE4callyyxF\":{\"name\":\"call(_:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/Delegated.html#/s:18SwiftPhoenixClient9DelegatedVAAytRszytRs_rlE4callyyF\":{\"name\":\"call()\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Delegated\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV9heartbeatSSvpZ\":{\"name\":\"heartbeat\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV4joinSSvpZ\":{\"name\":\"join\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5leaveSSvpZ\":{\"name\":\"leave\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5replySSvpZ\":{\"name\":\"reply\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5errorSSvpZ\":{\"name\":\"error\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html#/s:18SwiftPhoenixClient12ChannelEventV5closeSSvpZ\":{\"name\":\"close\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelEvent\"},\"Structs/ChannelEvent.html\":{\"name\":\"ChannelEvent\",\"abstract\":\"<p>Represents the different events that can be sent through\"},\"Structs/Delegated.html\":{\"name\":\"Delegated\",\"abstract\":\"<p>Provides a memory-safe way of passing callbacks around while not creating\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO6closedyA2CmF\":{\"name\":\"closed\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7erroredyA2CmF\":{\"name\":\"errored\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO6joinedyA2CmF\":{\"name\":\"joined\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7joiningyA2CmF\":{\"name\":\"joining\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html#/s:18SwiftPhoenixClient12ChannelStateO7leavingyA2CmF\":{\"name\":\"leaving\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"ChannelState\"},\"Enums/ChannelState.html\":{\"name\":\"ChannelState\",\"abstract\":\"<p>Represents the multiple states that a Channel can be in\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC15timeoutIntervalSdvpZ\":{\"name\":\"timeoutInterval\",\"abstract\":\"<p>Default timeout when sending messages</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC17heartbeatIntervalSdvpZ\":{\"name\":\"heartbeatInterval\",\"abstract\":\"<p>Default interval to send heartbeats on</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC23reconnectSteppedBackOffySdSicvpZ\":{\"name\":\"reconnectSteppedBackOff\",\"abstract\":\"<p>Default reconnect algorithm for the socket</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC20rejoinSteppedBackOffySdSicvpZ\":{\"name\":\"rejoinSteppedBackOff\",\"abstract\":\"<p>Default rejoin algorithm for individual channels</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC6encodey10Foundation4DataVSDySSypGcvpZ\":{\"name\":\"encode\",\"abstract\":\"<p>Default encode function, utilizing JSONSerialization.data</p>\",\"parent_name\":\"Defaults\"},\"Classes/Defaults.html#/s:18SwiftPhoenixClient8DefaultsC6decodeySDySSypGSg10Foundation4DataVcvpZ\":{\"name\":\"decode\",\"abstract\":\"<p>Default decode function, utilizing JSONSerialization.jsonObject</p>\",\"parent_name\":\"Defaults\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC8endPointSSvp\":{\"name\":\"endPoint\",\"abstract\":\"<p>The string WebSocket endpoint (ie <code>&quot;ws://example.com/socket&quot;</code>,\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11endPointUrl10Foundation3URLVvp\":{\"name\":\"endPointUrl\",\"abstract\":\"<p>The fully qualified socket URL</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6paramsSDySSypGSgvp\":{\"name\":\"params\",\"abstract\":\"<p>Resolves to return the <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\\\">paramsClosure</a></code> result at the time of calling.\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13paramsClosureSDySSypGSgycSgvp\":{\"name\":\"paramsClosure\",\"abstract\":\"<p>The optional params closure used to get params whhen connecting. Must\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6encodey10Foundation4DataVSDySSypGcvp\":{\"name\":\"encode\",\"abstract\":\"<p>Override to provide custom encoding of data before writing to the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6decodeySDySSypGSg10Foundation4DataVcvp\":{\"name\":\"decode\",\"abstract\":\"<p>Override to provide customd decoding of data read from the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7timeoutSdvp\":{\"name\":\"timeout\",\"abstract\":\"<p>Timeout to use when opening connections</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17heartbeatIntervalSdvp\":{\"name\":\"heartbeatInterval\",\"abstract\":\"<p>Interval between sending a heartbeat</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC14reconnectAfterySdSicvp\":{\"name\":\"reconnectAfter\",\"abstract\":\"<p>Interval between socket reconnect attempts, in seconds</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11rejoinAfterySdSicvp\":{\"name\":\"rejoinAfter\",\"abstract\":\"<p>Interval between channel rejoin attempts, in seconds</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6loggerySScSgvp\":{\"name\":\"logger\",\"abstract\":\"<p>The optional function to receive logs</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC13skipHeartbeatSbvp\":{\"name\":\"skipHeartbeat\",\"abstract\":\"<p>Disables heartbeats from being sent. Default is false.</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC24disableSSLCertValidationSbvp\":{\"name\":\"disableSSLCertValidation\",\"abstract\":\"<p>Enable/Disable SSL certificate validation. Default is false. This\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC8security10Starscream17SSLTrustValidator_pSgvp\":{\"name\":\"security\",\"abstract\":\"<p>Configure custom SSL validation logic, eg. SSL pinning. This\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC22enabledSSLCipherSuitesSays6UInt16VGSgvp\":{\"name\":\"enabledSSLCipherSuites\",\"abstract\":\"<p>Configure the encryption used by your client by setting the\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC_6paramsACSS_SDySSypGSgtcfc\":{\"name\":\"init(_:params:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC_13paramsClosureACSS_SDySSypGSgycSgtcfc\":{\"name\":\"init(_:paramsClosure:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17websocketProtocolSSvp\":{\"name\":\"websocketProtocol\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC11isConnectedSbvp\":{\"name\":\"isConnected\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7connectyyF\":{\"name\":\"connect()\",\"abstract\":\"<p>Connects the Socket. The params passed to the Socket on initialization\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC10disconnect4code8callbacky10Starscream9CloseCodeO_yycSgtF\":{\"name\":\"disconnect(code:callback:)\",\"abstract\":\"<p>Disconnects the socket</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6onOpen8callbackyyyc_tF\":{\"name\":\"onOpen(callback:)\",\"abstract\":\"<p>Registers callbacks for connection open events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC14delegateOnOpen2to8callbackyx_yxctRlzClF\":{\"name\":\"delegateOnOpen(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection open events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7onClose8callbackyyyc_tF\":{\"name\":\"onClose(callback:)\",\"abstract\":\"<p>Registers callbacks for connection close events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC15delegateOnClose2to8callbackyx_yxctRlzClF\":{\"name\":\"delegateOnClose(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection close events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7onError8callbackyys0F0_pc_tF\":{\"name\":\"onError(callback:)\",\"abstract\":\"<p>Registers callbacks for connection error events. Does not handle retain\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC15delegateOnError2to8callbackyx_yx_s0G0_ptctRlzClF\":{\"name\":\"delegateOnError(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection error events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC9onMessage8callbackyyAA0F0Cc_tF\":{\"name\":\"onMessage(callback:)\",\"abstract\":\"<p>Registers callbacks for connection message events. Does not handle\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC17delegateOnMessage2to8callbackyx_yx_AA0G0CtctRlzClF\":{\"name\":\"delegateOnMessage(to:callback:)\",\"abstract\":\"<p>Registers callbacks for connection message events. Automatically handles\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC16releaseCallbacksyyF\":{\"name\":\"releaseCallbacks()\",\"abstract\":\"<p>Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7channel_6paramsAA7ChannelCSS_SDySSypGtF\":{\"name\":\"channel(_:params:)\",\"abstract\":\"<p>Initialize a new Channel</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC6removeyyAA7ChannelCF\":{\"name\":\"remove(_:)\",\"abstract\":\"<p>Removes the Channel from the socket. This does not cause the channel to\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC7makeRefSSyF\":{\"name\":\"makeRef()\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC19websocketDidConnect6sockety10Starscream03WebdC0_p_tF\":{\"name\":\"websocketDidConnect(socket:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC22websocketDidDisconnect6socket5errory10Starscream03WebdC0_p_s5Error_pSgtF\":{\"name\":\"websocketDidDisconnect(socket:error:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC26websocketDidReceiveMessage6socket4texty10Starscream03WebdC0_p_SStF\":{\"name\":\"websocketDidReceiveMessage(socket:text:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Socket.html#/s:18SwiftPhoenixClient6SocketC23websocketDidReceiveData6socket4datay10Starscream03WebdC0_p_10Foundation0H0VtF\":{\"name\":\"websocketDidReceiveData(socket:data:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Socket\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7channelAA7ChannelCSgvp\":{\"name\":\"channel\",\"abstract\":\"<p>The channel sending the Push</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC5eventSSvp\":{\"name\":\"event\",\"abstract\":\"<p>The event, for example <code>phx_join</code></p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7payloadSDySSypGvp\":{\"name\":\"payload\",\"abstract\":\"<p>The payload, for example [&ldquo;user_id&rdquo;: &ldquo;abc123&rdquo;]</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7timeoutSdvp\":{\"name\":\"timeout\",\"abstract\":\"<p>The push timeout. Default is 10.0 seconds</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC6resendyySdF\":{\"name\":\"resend(_:)\",\"abstract\":\"<p>Resets and sends the Push</p>\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC4sendyyF\":{\"name\":\"send()\",\"abstract\":\"<p>Sends the Push. If it has already timed out, then the call will\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC7receive_8callbackACSS_yAA7MessageCctF\":{\"name\":\"receive(_:callback:)\",\"abstract\":\"<p>Receive a specific event when sending an Outbound message. Subscribing\",\"parent_name\":\"Push\"},\"Classes/Push.html#/s:18SwiftPhoenixClient4PushC15delegateReceive_2to8callbackACSS_xyx_AA7MessageCtctRlzClF\":{\"name\":\"delegateReceive(_:to:callback:)\",\"abstract\":\"<p>Receive a specific event when sending an Outbound message. Automatically\",\"parent_name\":\"Push\"},\"Classes/Presence/Events.html#/s:18SwiftPhoenixClient8PresenceC6EventsO5stateyA2EmF\":{\"name\":\"state\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Events\"},\"Classes/Presence/Events.html#/s:18SwiftPhoenixClient8PresenceC6EventsO4diffyA2EmF\":{\"name\":\"diff\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Events\"},\"Classes/Presence/Options.html#/s:18SwiftPhoenixClient8PresenceC7OptionsV8defaultsAEvpZ\":{\"name\":\"defaults\",\"abstract\":\"<p>Default set of Options used when creating Presence. Uses the\",\"parent_name\":\"Options\"},\"Classes/Presence/Options.html\":{\"name\":\"Options\",\"abstract\":\"<p>Custom options that can be provided when creating Presence</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence/Events.html\":{\"name\":\"Events\",\"abstract\":\"<p>Presense Events</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Metaa\":{\"name\":\"Meta\",\"abstract\":\"<p>Meta details of a Presence. Just a dictionary of properties</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC3Mapa\":{\"name\":\"Map\",\"abstract\":\"<p>A mapping of a String to an array of Metas. e.g. {&ldquo;metas&rdquo;: [{id: 1}]}</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5Statea\":{\"name\":\"State\",\"abstract\":\"<p>A mapping of a Presence state to a mapping of Metas</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4Diffa\":{\"name\":\"Diff\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnJoina\":{\"name\":\"OnJoin\",\"abstract\":\"<p>Closure signature of OnJoin callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7OnLeavea\":{\"name\":\"OnLeave\",\"abstract\":\"<p>Closure signature for OnLeave callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6OnSynca\":{\"name\":\"OnSync\",\"abstract\":\"<p>/ Closure signature for OnSync callbacks</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC5stateSDySSSDySSSaySDySSypGGGGvp\":{\"name\":\"state\",\"abstract\":\"<p>The state of the Presence</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC12pendingDiffsSaySDySSSDySSSDySSSaySDySSypGGGGGGvp\":{\"name\":\"pendingDiffs\",\"abstract\":\"<p>Pending <code>join</code> and <code>leave</code> diffs that need to be synced</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7joinRefSSSgvp\":{\"name\":\"joinRef\",\"abstract\":\"<p>The channel&rsquo;s joinRef, set when state events occur</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC18isPendingSyncStateSbvp\":{\"name\":\"isPendingSyncState\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onJoinyySS_SDySSSaySDySSypGGGSgAGtcvp\":{\"name\":\"onJoin\",\"abstract\":\"<p>Callback to be informed of joins</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onJoinyyySS_SDySSSaySDySSypGGGSgAGtcF\":{\"name\":\"onJoin(_:)\",\"abstract\":\"<p>Set the OnJoin callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7onLeaveyySS_SDySSSaySDySSypGGGAGtcvp\":{\"name\":\"onLeave\",\"abstract\":\"<p>Callback to be informed of leaves</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7onLeaveyyySS_SDySSSaySDySSypGGGAGtcF\":{\"name\":\"onLeave(_:)\",\"abstract\":\"<p>Set the OnLeave callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onSyncyycvp\":{\"name\":\"onSync\",\"abstract\":\"<p>Callback to be informed of synces</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6onSyncyyyycF\":{\"name\":\"onSync(_:)\",\"abstract\":\"<p>Set the OnSync callback</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC7channel4optsAcA7ChannelC_AC7OptionsVtcfc\":{\"name\":\"init(channel:opts:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4listSaySDySSSaySDySSypGGGGyF\":{\"name\":\"list()\",\"abstract\":\"<p>Returns the array of presences, with deault selected metadata.</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC4list2bySayxGxSS_SDySSSaySDySSypGGGtXE_tlF\":{\"name\":\"list(by:)\",\"abstract\":\"<p>Returns the array of presences, with selected metadata</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6filter2bySDySSSDySSSaySDySSypGGGGSbSS_AHtcSg_tF\":{\"name\":\"filter(by:)\",\"abstract\":\"<p>Filter the Presence state with a given function</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC9syncState_03newF06onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_AKySS_AJSgAJtXEySS_A2JtXEtFZ\":{\"name\":\"syncState(_:newState:onJoin:onLeave:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC8syncDiff_4diff6onJoin0H5LeaveSDySSSDySSSaySDySSypGGGGAK_SDySSAKGySS_AJSgAJtXEySS_A2JtXEtFZ\":{\"name\":\"syncDiff(_:diff:onJoin:onLeave:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6filter_2bySDySSSDySSSaySDySSypGGGGAI_SbSS_AHtcSgtFZ\":{\"name\":\"filter(_:by:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Presence.html#/s:18SwiftPhoenixClient8PresenceC6listBy_11transformerSayxGSDySSSDySSSaySDySSypGGGG_xSS_AItXEtlFZ\":{\"name\":\"listBy(_:transformer:)\",\"abstract\":\"<p>Undocumented</p>\",\"parent_name\":\"Presence\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC3refSSvp\":{\"name\":\"ref\",\"abstract\":\"<p>Reference number. Empty if missing</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC5topicSSvp\":{\"name\":\"topic\",\"abstract\":\"<p>Message topic</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC5eventSSvp\":{\"name\":\"event\",\"abstract\":\"<p>Message event</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC7payloadSDySSypGvp\":{\"name\":\"payload\",\"abstract\":\"<p>Message payload</p>\",\"parent_name\":\"Message\"},\"Classes/Message.html#/s:18SwiftPhoenixClient7MessageC6statusSSSgvp\":{\"name\":\"status\",\"abstract\":\"<p>Convenience accessor. Equivalent to getting the status as such:</p>\",\"parent_name\":\"Message\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC5topicSSvp\":{\"name\":\"topic\",\"abstract\":\"<p>The topic of the Channel. e.g. &ldquo;rooms:friends&rdquo;</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC6paramsSDySSypGvp\":{\"name\":\"params\",\"abstract\":\"<p>The params sent when joining the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9onMessageyAA0F0CAFcvp\":{\"name\":\"onMessage\",\"abstract\":\"<p>Overridable message hook. Receives all events for specialized message\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC4join7timeoutAA4PushCSdSg_tF\":{\"name\":\"join(timeout:)\",\"abstract\":\"<p>Joins the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC7onCloseySiyAA7MessageCcF\":{\"name\":\"onClose(_:)\",\"abstract\":\"<p>Hook into when the Channel is closed. Does not handle retain cycles.\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC15delegateOnClose2to8callbackSix_yx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOnClose(to:callback:)\",\"abstract\":\"<p>Hook into when the Channel is closed. Automatically handles retain\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC7onErrorySiyAA7MessageCcF\":{\"name\":\"onError(_:)\",\"abstract\":\"<p>Hook into when the Channel receives an Error. Does not handle retain\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC15delegateOnError2to8callbackSix_yx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOnError(to:callback:)\",\"abstract\":\"<p>Hook into when the Channel receives an Error. Automatically handles\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC2on_8callbackSiSS_yAA7MessageCctF\":{\"name\":\"on(_:callback:)\",\"abstract\":\"<p>Subscribes on channel events. Does not handle retain cycles. Use\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC10delegateOn_2to8callbackSiSS_xyx_AA7MessageCtctRlzClF\":{\"name\":\"delegateOn(_:to:callback:)\",\"abstract\":\"<p>Subscribes on channel events. Automatically handles retain cycles. Use\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC3off_3refySS_SiSgtF\":{\"name\":\"off(_:ref:)\",\"abstract\":\"<p>Unsubscribes from a channel event. If a <code>ref</code> is given, only the exact\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC4push_7payload7timeoutAA4PushCSS_SDySSypGSdtF\":{\"name\":\"push(_:payload:timeout:)\",\"abstract\":\"<p>Push a payload to the Channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC5leave7timeoutAA4PushCSd_tF\":{\"name\":\"leave(timeout:)\",\"abstract\":\"<p>Leaves the channel</p>\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9onMessage8callbackyAA0F0CAGc_tF\":{\"name\":\"onMessage(callback:)\",\"abstract\":\"<p>Overridable message hook. Receives all events for specialized message\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC8isClosedSbvp\":{\"name\":\"isClosed\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isErroredSbvp\":{\"name\":\"isErrored\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC8isJoinedSbvp\":{\"name\":\"isJoined\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isJoiningSbvp\":{\"name\":\"isJoining\",\"parent_name\":\"Channel\"},\"Classes/Channel.html#/s:18SwiftPhoenixClient7ChannelC9isLeavingSbvp\":{\"name\":\"isLeaving\",\"parent_name\":\"Channel\"},\"Classes/Channel.html\":{\"name\":\"Channel\",\"abstract\":\"<p>Undocumented</p>\"},\"Classes/Message.html\":{\"name\":\"Message\",\"abstract\":\"<p>Data that is received from the Server.</p>\"},\"Classes/Presence.html\":{\"name\":\"Presence\",\"abstract\":\"<p>The Presence object provides features for syncing presence information from\"},\"Classes/Push.html\":{\"name\":\"Push\",\"abstract\":\"<p>Represnts pushing data to a <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Channel.html\\\">Channel</a></code> through the <code><a href=\\\"36f8f5912051ae747ef441d6511ca4cbClasses/Socket.html\\\">Socket</a></code></p>\"},\"Classes/Socket.html\":{\"name\":\"Socket\",\"abstract\":\"<h2 id='socket-connection' class='heading'>Socket Connection</h2>\"},\"Classes/Defaults.html\":{\"name\":\"Defaults\",\"abstract\":\"<p>A collection of default values and behaviors used accross the Client</p>\"},\"Classes.html\":{\"name\":\"Classes\",\"abstract\":\"<p>The following classes are available globally.</p>\"},\"Enums.html\":{\"name\":\"Enumerations\",\"abstract\":\"<p>The following enumerations are available globally.</p>\"},\"Structs.html\":{\"name\":\"Structures\",\"abstract\":\"<p>The following structures are available globally.</p>\"},\"Typealiases.html\":{\"name\":\"Type Aliases\",\"abstract\":\"<p>The following type aliases are available globally.</p>\"}}"
  },
  {
    "path": "docs/undocumented.json",
    "content": "{\n  \"warnings\": [\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Channel.swift\",\n      \"line\": 61,\n      \"symbol\": \"Channel\",\n      \"symbol_kind\": \"source.lang.swift.decl.class\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Channel.swift\",\n      \"line\": 601,\n      \"symbol\": \"Channel\",\n      \"symbol_kind\": \"source.lang.swift.decl.extension\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 118,\n      \"symbol\": \"Presence.Events.state\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 119,\n      \"symbol\": \"Presence.Events.diff\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 136,\n      \"symbol\": \"Presence.Diff\",\n      \"symbol_kind\": \"source.lang.swift.decl.typealias\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 173,\n      \"symbol\": \"Presence.isPendingSyncState\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 212,\n      \"symbol\": \"Presence.init(channel:opts:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 285,\n      \"symbol\": \"Presence.syncState(_:newState:onJoin:onLeave:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 340,\n      \"symbol\": \"Presence.syncDiff(_:diff:onJoin:onLeave:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 380,\n      \"symbol\": \"Presence.filter(_:by:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Presence.swift\",\n      \"line\": 386,\n      \"symbol\": \"Presence.listBy(_:transformer:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 161,\n      \"symbol\": \"Socket.init(_:params:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 168,\n      \"symbol\": \"Socket.init(_:paramsClosure:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 723,\n      \"symbol\": \"Socket.websocketDidConnect(socket:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 727,\n      \"symbol\": \"Socket.websocketDidDisconnect(socket:error:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 732,\n      \"symbol\": \"Socket.websocketDidReceiveMessage(socket:text:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Socket.swift\",\n      \"line\": 736,\n      \"symbol\": \"Socket.websocketDidReceiveData(socket:data:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 66,\n      \"symbol\": \"ChannelState.closed\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 67,\n      \"symbol\": \"ChannelState.errored\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 68,\n      \"symbol\": \"ChannelState.joined\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 69,\n      \"symbol\": \"ChannelState.joining\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 70,\n      \"symbol\": \"ChannelState.leaving\",\n      \"symbol_kind\": \"source.lang.swift.decl.enumelement\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 76,\n      \"symbol\": \"ChannelEvent.heartbeat\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 77,\n      \"symbol\": \"ChannelEvent.join\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 78,\n      \"symbol\": \"ChannelEvent.leave\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 79,\n      \"symbol\": \"ChannelEvent.reply\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 80,\n      \"symbol\": \"ChannelEvent.error\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Defaults.swift\",\n      \"line\": 81,\n      \"symbol\": \"ChannelEvent.close\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.static\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 31,\n      \"symbol\": \"Delegated.init()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 33,\n      \"symbol\": \"Delegated.delegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 43,\n      \"symbol\": \"Delegated.call(_:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 47,\n      \"symbol\": \"Delegated.isDelegateSet\",\n      \"symbol_kind\": \"source.lang.swift.decl.var.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 55,\n      \"symbol\": \"Delegated.stronglyDelegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 62,\n      \"symbol\": \"Delegated.manuallyDelegate(with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 66,\n      \"symbol\": \"Delegated.removeDelegate()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 74,\n      \"symbol\": \"Delegated.delegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 79,\n      \"symbol\": \"Delegated.stronglyDelegate(to:with:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 88,\n      \"symbol\": \"Delegated.call()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 96,\n      \"symbol\": \"Delegated.call(_:)\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    },\n    {\n      \"file\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient/Sources/Utilities/Delegated.swift\",\n      \"line\": 104,\n      \"symbol\": \"Delegated.call()\",\n      \"symbol_kind\": \"source.lang.swift.decl.function.method.instance\",\n      \"warning\": \"undocumented\"\n    }\n  ],\n  \"source_directory\": \"/Users/drees/src/github/phoenix/SwiftPhoenixClient\"\n}"
  },
  {
    "path": "fastlane/Appfile",
    "content": "# app_identifier \"[[APP_IDENTIFIER]]\" # The bundle identifier of your app\n# apple_id \"[[APPLE_ID]]\" # Your Apple email address\n\n\n# For more information about the Appfile, see:\n#     https://docs.fastlane.tools/advanced/#appfile\n"
  },
  {
    "path": "fastlane/Fastfile",
    "content": "# This file contains the fastlane.tools configuration\n# You can find the documentation at https://docs.fastlane.tools\n#\n# For a list of all available actions, check out\n#\n#     https://docs.fastlane.tools/actions\n#\n\n# Uncomment the line if you want fastlane to automatically update itself\n# update_fastlane\n\ndefault_platform(:ios)\n\nplatform :ios do\n\n  desc \"Runs tests for the project\"\n  lane :test do \n    execute_tests\n    gather_coverage\n  end\n\n\n  # PRIVATE LANES\n  private_lane :execute_tests do \n    scan(\n      scheme: \"SwiftPhoenixClient\",\n      code_coverage: true\n    )\n  end\n\n  private_lane :gather_coverage do \n    slather(\n      use_bundle_exec: true,\n      cobertura_xml: true,\n      travis: true\n    )\n  end\nend\n"
  },
  {
    "path": "fastlane/README.md",
    "content": "fastlane documentation\n================\n# Installation\n\nMake sure you have the latest version of the Xcode command line tools installed:\n\n```\nxcode-select --install\n```\n\nInstall _fastlane_ using\n```\n[sudo] gem install fastlane -NV\n```\nor alternatively using `brew cask install fastlane`\n\n# Available Actions\n## iOS\n### ios test\n```\nfastlane ios test\n```\nRuns tests for the project\n\n----\n\nThis README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.\nMore information about fastlane can be found on [fastlane.tools](https://fastlane.tools).\nThe documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).\n"
  },
  {
    "path": "sourcery/MockableClass.stencil",
    "content": "// swiftlint:disable line_length\n// swiftlint:disable variable_name\n\n@testable import SwiftPhoenixClient\n\n{% macro swiftifyMethodName name %}{{ name | replace:\"(\",\"_\" | replace:\")\",\"\" | replace:\":\",\"_\" | replace:\"`\",\"\" | snakeToCamelCase | lowerFirstWord }}{% endmacro %}\n\n{% macro methodThrowableErrorDeclaration method %}\n    var {% call swiftifyMethodName method.selectorName %}ThrowableError: Error?\n{% endmacro %}\n\n\n{% macro argumentsBlock arguments %}{% filter removeNewlines:\"leading\" %}\n  {% for argument in arguments %}\n    {{argument.name}}{% if not forloop.last %}, {% endif %}\n  {% endfor %}\n{% endfilter %}{% endmacro %}\n\n\n{% macro methodThrowableErrorUsage method %}\n        if let error = {% call swiftifyMethodName method.selectorName %}ThrowableError {\n            throw error\n        }\n{% endmacro %}\n\n{% macro methodReceivedParameters method %}\n    {%if method.parameters.count == 1 %}\n        {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }} = {{ param.name }}{% endfor %}\n    {% else %}\n    {% if not method.parameters.count == 0 %}\n    {% call swiftifyMethodName method.selectorName %}ReceivedArguments = ({% for param in method.parameters %}{{ param.name }}: {{ param.name }}{% if not forloop.last%}, {% endif %}{% endfor %})\n    {% endif %}\n    {% endif %}\n{% endmacro %}\n\n\n\n{% macro methodClosureName method %}{% call swiftifyMethodName method.selectorName %}Closure{% endmacro %}\n\n{% macro methodClosureDeclaration method %}\n    var {% call methodClosureName method %}: (({% for param in method.parameters %}{{ param.typeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {% if method.throws %}throws {% endif %}-> {% if method.isInitializer %}Void{% else %}{{ method.returnTypeName }}{% endif %})?\n{% endmacro %}\n\n{% macro methodClosureCallParameters method %}{% for param in method.parameters %}{{ param.name }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endmacro %}\n\n{% macro mockMethod method %}\n    //MARK: - {{ method.shortName }}\n\n    {% if method.throws %}\n        {% call methodThrowableErrorDeclaration method %}\n    {% endif %}\n    {% if not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}CallsCount = 0\n    var {% call swiftifyMethodName method.selectorName %}Called: Bool {\n        return {% call swiftifyMethodName method.selectorName %}CallsCount > 0\n    }\n    {% endif %}\n    {% if method.parameters.count == 1 and method.isGeneric == false %}\n    var {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }}: {% if param.isClosure %}({% endif %}{{ param.typeName.unwrappedTypeName }}{% if param.isClosure %}){% endif %}?{% endfor %}\n    {% else %}{% if not method.parameters.count == 0 and method.isGeneric == false %}\n    var {% call swiftifyMethodName method.selectorName %}ReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {% if param.typeAttributes.escaping %}{{ param.unwrappedTypeName }}{% else %}{{ param.typeName }}{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %})?\n    {% endif %}{% endif %}\n    {% if not method.returnTypeName.isVoid and not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}ReturnValue: {{ method.returnTypeName }}!\n    {% endif %}\n    {% if method.isGeneric == false %}\n    {% call methodClosureDeclaration method %}\n    {% endif %}\n\n{% if method.isInitializer or method.isDeinitializer %}\n    {#{% if not method.isConvenienceInitializer %}\n    override {{ method.name }} {\n        super.{{ method.callName }}({% for param in method.parameters %}{{ param.name }}: {{ param.name }}{% ifnot forloop.last %}, {% endif %}{% endfor %})\n        {% call methodReceivedParameters method %}\n        {% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n    }\n    {% endif %}#}\n{% else %}\n    override func {{ method.name }}{% if method.throws %} throws{% endif %}{% if not method.returnTypeName.isVoid %} -> {{ method.returnTypeName }}{% endif %} {\n        {% if method.throws %}\n        {% call methodThrowableErrorUsage method %}\n        {% endif %}\n        {% call swiftifyMethodName method.selectorName %}CallsCount += 1\n        {% if method.isGeneric == false %}\n        {% call methodReceivedParameters method %}\n        {% endif %}\n        {% if method.returnTypeName.isVoid %}\n        {% if method.isGeneric == false %}\n        {% if method.throws %}try {% endif %}{% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n        {% endif %}\n        {% else %}\n        {% if method.isGeneric == true %}\n        return {% call swiftifyMethodName method.selectorName %}ReturnValue\n        {% else %}\n        return {% if method.throws %}try {% endif %}{% call methodClosureName method %}.map({ {% if method.throws %}try {% endif %}$0({% call methodClosureCallParameters method %}) }) ?? {% call swiftifyMethodName method.selectorName %}ReturnValue\n        {% endif %}\n        {% endif %}\n    }\n\n{% endif %}\n{% endmacro %}\n\n{% macro mockOptionalVariable variable %}\n    {% if variable.writeAccess == \"\" %}\n    var {% call underlyingMockedVariableName variable %}: {{ variable.typeName }}!\n    override var {% call mockedVariableName variable %}: {{ variable.typeName }} {\n        return {% call underlyingMockedVariableName variable %}\n    }\n    {% else %}\n    var {{ variable.name }}SetCount: Int = 0\n    var {{ variable.name }}DidGetSet: Bool { return {{ variable.name }}SetCount > 0 }\n    override var {% call mockedVariableName variable %}: {{ variable.typeName }} {\n        didSet { {{ variable.name }}SetCount += 1 }\n    }\n    {% endif %}\n{% endmacro %}\n\n{% macro mockNonOptionalArrayOrDictionaryVariable variable %}\n    {# var {% call mockedVariableName variable %}: {{ variable.typeName }} = {% if variable.isArray %}[]{% elif variable.isDictionary %}[:]{% endif %} #}\n{% endmacro %}\n\n{% macro mockNonOptionalVariable variable %}\n    override var {% call mockedVariableName variable %}: {{ variable.typeName }} {\n        get { return {% call underlyingMockedVariableName variable %} }\n        set(value) { {% call underlyingMockedVariableName variable %} = value }\n    }\n    var {% call underlyingMockedVariableName variable %}: ({{ variable.typeName }})!\n{% endmacro %}\n\n{% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %}\n{% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %}\n\n\n\n\n\n\n\n\n\n{% for type in types.classes where type.name == \"TimeoutTimer\" or type.name == \"Socket\" or type.name == \"Push\" or type.name == \"Channel\" %}\nclass {{ type.name }}Mock: {{ type.name }} {\n{# Generate all variable mocks #}\n{% for variable in type.allVariables|!definedInExtension where variable.readAccess != \"private\" and variable.isMutable %}\n    {% if variable.isOptional %}{% call mockOptionalVariable variable %}{% elif variable.isArray or variable.isDictionary %}{% call mockNonOptionalArrayOrDictionaryVariable variable %}{% else %}{% call mockNonOptionalVariable variable %}{% endif %}\n{% endfor %}\n\n\n{% for method in type.allMethods|!definedInExtension where method.accessLevel != \"private\" and method.actualDefinedInTypeName.name != \"WebSocketDelegate\" %}\n    {% call mockMethod method %}\n\n{% endfor %}\n}\n{% endfor %}\n"
  },
  {
    "path": "sourcery/MockableProtocol.stencil",
    "content": "// swiftlint:disable line_length\n// swiftlint:disable variable_name\n\nimport Foundation\n#if os(iOS) || os(tvOS) || os(watchOS)\nimport UIKit\n#elseif os(OSX)\nimport AppKit\n#endif\n\n@testable import SwiftPhoenixClient\n\n{% macro swiftifyMethodName name %}{{ name | replace:\"(\",\"_\" | replace:\")\",\"\" | replace:\":\",\"_\" | replace:\"`\",\"\" | snakeToCamelCase | lowerFirstWord }}{% endmacro %}\n\n{% macro methodThrowableErrorDeclaration method %}\n    var {% call swiftifyMethodName method.selectorName %}ThrowableError: Error?\n{% endmacro %}\n\n{% macro methodThrowableErrorUsage method %}\n        if let error = {% call swiftifyMethodName method.selectorName %}ThrowableError {\n            throw error\n        }\n{% endmacro %}\n\n{% macro methodReceivedParameters method %}\n    {%if method.parameters.count == 1 %}\n        {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }} = {{ param.name }}{% endfor %}\n        {% call swiftifyMethodName method.selectorName %}ReceivedInvocations.append({% for param in method.parameters %}{{ param.name }}){% endfor %}\n    {% else %}\n    {% if not method.parameters.count == 0 %}\n        {% call swiftifyMethodName method.selectorName %}ReceivedArguments = ({% for param in method.parameters %}{{ param.name }}: {{ param.name }}{% if not forloop.last%}, {% endif %}{% endfor %})\n        {% call swiftifyMethodName method.selectorName %}ReceivedInvocations.append(({% for param in method.parameters %}{{ param.name }}: {{ param.name }}{% if not forloop.last%}, {% endif %}{% endfor %}))\n    {% endif %}\n    {% endif %}\n{% endmacro %}\n\n{% macro methodClosureName method %}{% call swiftifyMethodName method.selectorName %}Closure{% endmacro %}\n\n{% macro closureReturnTypeName method %}{% if method.isOptionalReturnType %}{{ method.unwrappedReturnTypeName }}?{% else %}{{ method.returnTypeName }}{% endif %}{% endmacro %}\n\n{% macro methodClosureDeclaration method %}\n    var {% call methodClosureName method %}: (({% for param in method.parameters %}{{ param.typeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {% if method.throws %}throws {% endif %}-> {% if method.isInitializer %}Void{% else %}{% call closureReturnTypeName method %}{% endif %})?\n{% endmacro %}\n\n{% macro methodClosureCallParameters method %}{% for param in method.parameters %}{{ param.name }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endmacro %}\n\n{% macro mockMethod method %}\n    //MARK: - {{ method.shortName }}\n\n    {% if method.throws %}\n        {% call methodThrowableErrorDeclaration method %}\n    {% endif %}\n    {% if not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}CallsCount = 0\n    var {% call swiftifyMethodName method.selectorName %}Called: Bool {\n        return {% call swiftifyMethodName method.selectorName %}CallsCount > 0\n    }\n    {% endif %}\n    {% if method.parameters.count == 1 %}\n    var {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }}: {{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}?{% endfor %}\n    var {% call swiftifyMethodName method.selectorName %}ReceivedInvocations{% for param in method.parameters %}: [{{ '(' if param.isClosure }}{{ param.typeName.unwrappedTypeName }}{{ ')' if param.isClosure }}{%if param.typeName.isOptional%}?{%endif%}]{% endfor %} = []\n    {% elif not method.parameters.count == 0 %}\n    var {% call swiftifyMethodName method.selectorName %}ReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})?\n    var {% call swiftifyMethodName method.selectorName %}ReceivedInvocations: [({% for param in method.parameters %}{{ param.name }}: {{ param.unwrappedTypeName if param.typeAttributes.escaping else param.typeName }}{{ ', ' if not forloop.last }}{% endfor %})] = []\n    {% endif %}\n    {% if not method.returnTypeName.isVoid and not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}ReturnValue: {{ '(' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ method.returnTypeName }}{{ ')' if method.returnTypeName.isClosure and not method.isOptionalReturnType }}{{ '!' if not method.isOptionalReturnType }}\n    {% endif %}\n    {% call methodClosureDeclaration method %}\n\n{% if method.isInitializer %}\n    required {{ method.name }} {\n        {% call methodReceivedParameters method %}\n        {% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n    }\n{% else %}\n    func {{ method.name }}{{ ' throws' if method.throws }}{% if not method.returnTypeName.isVoid %} -> {{ method.returnTypeName }}{% endif %} {\n        {% if method.throws %}\n        {% call methodThrowableErrorUsage method %}\n        {% endif %}\n        {% call swiftifyMethodName method.selectorName %}CallsCount += 1\n        {% call methodReceivedParameters method %}\n        {% if method.returnTypeName.isVoid %}\n        {% if method.throws %}try {% endif %}{% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n        {% else %}\n        return {{ 'try ' if method.throws }}{% call methodClosureName method %}.map({ {{ 'try ' if method.throws }}$0({% call methodClosureCallParameters method %}) }) ?? {% call swiftifyMethodName method.selectorName %}ReturnValue\n        {% endif %}\n    }\n\n{% endif %}\n{% endmacro %}\n\n{% macro mockOptionalVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }}\n{% endmacro %}\n\n{% macro mockNonOptionalArrayOrDictionaryVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }} = {% if variable.isArray %}[]{% elif variable.isDictionary %}[:]{% endif %}\n{% endmacro %}\n\n{% macro mockNonOptionalVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }} {\n        get { return {% call underlyingMockedVariableName variable %} }\n        set(value) { {% call underlyingMockedVariableName variable %} = value }\n    }\n    var {% call underlyingMockedVariableName variable %}: {{ variable.typeName }}!\n{% endmacro %}\n\n{% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %}\n{% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %}\n\n{% for type in types.protocols where type.based.AutoMockable or type|annotated:\"AutoMockable\" %}{% if type.name != \"AutoMockable\" %}\nclass {{ type.name }}Mock: {{ type.name }} {\n{% for variable in type.allVariables|!definedInExtension %}\n    {% if variable.isOptional %}{% call mockOptionalVariable variable %}{% elif variable.isArray or variable.isDictionary %}{% call mockNonOptionalArrayOrDictionaryVariable variable %}{% else %}{% call mockNonOptionalVariable variable %}{% endif %}\n{% endfor %}\n\n{% for method in type.allMethods|!definedInExtension %}\n    {% call mockMethod method %}\n{% endfor %}\n}\n{% endif %}{% endfor %}\n"
  },
  {
    "path": "sourcery/MockableWebSocketClient.stencil",
    "content": "// swiftlint:disable line_length\n// swiftlint:disable variable_name\n\nimport Starscream\n@testable import SwiftPhoenixClient\n\n{% macro swiftifyMethodName name %}{{ name | replace:\"(\",\"_\" | replace:\")\",\"\" | replace:\":\",\"_\" | replace:\"`\",\"\" | snakeToCamelCase | lowerFirstWord }}{% endmacro %}\n\n{% macro methodThrowableErrorDeclaration method %}\n    var {% call swiftifyMethodName method.selectorName %}ThrowableError: Error?\n{% endmacro %}\n\n{% macro methodThrowableErrorUsage method %}\n        if let error = {% call swiftifyMethodName method.selectorName %}ThrowableError {\n            throw error\n        }\n{% endmacro %}\n\n{% macro methodReceivedParameters method %}\n    {%if method.parameters.count == 1 %}\n        {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }} = {{ param.name }}{% endfor %}\n    {% else %}\n    {% if not method.parameters.count == 0 %}\n        {% call swiftifyMethodName method.selectorName %}ReceivedArguments = ({% for param in method.parameters %}{{ param.name }}: {{ param.name }}{% if not forloop.last%}, {% endif %}{% endfor %})\n    {% endif %}\n    {% endif %}\n{% endmacro %}\n\n{% macro methodClosureName method %}{% call swiftifyMethodName method.selectorName %}Closure{% endmacro %}\n\n{% macro methodClosureDeclaration method %}\n    var {% call methodClosureName method %}: (({% for param in method.parameters %}{{ param.typeName }}{% if not forloop.last %}, {% endif %}{% endfor %}) {% if method.throws %}throws {% endif %}-> {% if method.isInitializer %}Void{% else %}{{ method.returnTypeName }}{% endif %})?\n{% endmacro %}\n\n{% macro methodClosureCallParameters method %}{% for param in method.parameters %}{{ param.name }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endmacro %}\n\n{% macro mockMethod method %}\n    //MARK: - {{ method.shortName }}\n\n    {% if method.throws %}\n        {% call methodThrowableErrorDeclaration method %}\n    {% endif %}\n    {% if not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}CallsCount = 0\n    var {% call swiftifyMethodName method.selectorName %}Called: Bool {\n        return {% call swiftifyMethodName method.selectorName %}CallsCount > 0\n    }\n    {% endif %}\n    {% if method.parameters.count == 1 %}\n    var {% call swiftifyMethodName method.selectorName %}Received{% for param in method.parameters %}{{ param.name|upperFirstLetter }}: {% if param.isClosure %}({% endif %}{{ param.typeName.unwrappedTypeName }}{% if param.isClosure %}){% endif %}?{% endfor %}\n    {% else %}{% if not method.parameters.count == 0 %}\n    var {% call swiftifyMethodName method.selectorName %}ReceivedArguments: ({% for param in method.parameters %}{{ param.name }}: {% if param.typeAttributes.escaping %}{{ param.unwrappedTypeName }}{% else %}{{ param.typeName }}{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %})?\n    {% endif %}{% endif %}\n    {% if not method.returnTypeName.isVoid and not method.isInitializer %}\n    var {% call swiftifyMethodName method.selectorName %}ReturnValue: {{ method.returnTypeName }}!\n    {% endif %}\n    {% call methodClosureDeclaration method %}\n\n{% if method.isInitializer %}\n    required {{ method.name }} {\n        {% call methodReceivedParameters method %}\n        {% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n    }\n{% else %}\n    func {{ method.name }}{% if method.throws %} throws{% endif %}{% if not method.returnTypeName.isVoid %} -> {{ method.returnTypeName }}{% endif %} {\n        {% if method.throws %}\n        {% call methodThrowableErrorUsage method %}\n        {% endif %}\n        {% call swiftifyMethodName method.selectorName %}CallsCount += 1\n        {% call methodReceivedParameters method %}\n        {% if method.returnTypeName.isVoid %}\n        {% if method.throws %}try {% endif %}{% call methodClosureName method %}?({% call methodClosureCallParameters method %})\n        {% else %}\n        return {% if method.throws %}try {% endif %}{% call methodClosureName method %}.map({ {% if method.throws %}try {% endif %}$0({% call methodClosureCallParameters method %}) }) ?? {% call swiftifyMethodName method.selectorName %}ReturnValue\n        {% endif %}\n    }\n\n{% endif %}\n{% endmacro %}\n\n{% macro mockOptionalVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }}\n{% endmacro %}\n\n{% macro mockNonOptionalArrayOrDictionaryVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }} = {% if variable.isArray %}[]{% elif variable.isDictionary %}[:]{% endif %}\n{% endmacro %}\n\n{% macro mockNonOptionalVariable variable %}\n    var {% call mockedVariableName variable %}: {{ variable.typeName }} {\n        get { return {% call underlyingMockedVariableName variable %} }\n        set(value) { {% call underlyingMockedVariableName variable %} = value }\n    }\n    var {% call underlyingMockedVariableName variable %}: {{ variable.typeName }}!\n{% endmacro %}\n\n{% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %}\n{% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %}\n\n{% for type in types.protocols where type.name == \"WebSocketClient\" or type.name == \"TimeoutTimer\"  %}\nclass {{ type.name }}Mock: {{ type.name }} {\n{% for variable in type.allVariables|!definedInExtension %}\n    {% if variable.isOptional %}{% call mockOptionalVariable variable %}{% elif variable.isArray or variable.isDictionary %}{% call mockNonOptionalArrayOrDictionaryVariable variable %}{% else %}{% call mockNonOptionalVariable variable %}{% endif %}\n{% endfor %}\n\n{% for method in type.allMethods|!definedInExtension %}\n    {% call mockMethod method %}\n{% endfor %}\n}\n{% endfor %}\n"
  }
]