(_ expression: @autoclosure () throws -> T?, _ message: String = "", file: StaticString = #file, line: UInt = #line, also validateResult: (T) -> Void) {
12 |
13 | var result: T?
14 |
15 | XCTAssertNoThrow(try executeAndAssignResult(expression, to: &result), message, file: file, line: line)
16 | XCTAssertNotNil(result, message, file: file, line: line)
17 |
18 | if let result = result {
19 | validateResult(result)
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/Helpers/Helpers.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | @testable import PusherSwift
4 |
5 | func convertStringToDictionary(_ text: String) -> [String: AnyObject]? {
6 | guard let data = text.data(using: .utf8) else {
7 | return nil
8 | }
9 |
10 | do {
11 | let json = try JSONSerialization.jsonObject(with: data, options: .mutableContainers) as? [String: AnyObject]
12 | return json
13 | } catch {
14 | print("Something went wrong")
15 |
16 | return nil
17 | }
18 | }
19 |
20 | extension AuthMethod: Equatable {
21 |
22 | public static func == (lhs: AuthMethod, rhs: AuthMethod) -> Bool {
23 | switch (lhs, rhs) {
24 | case (let .endpoint(authEndpoint1), let .endpoint(authEndpoint2)):
25 | return authEndpoint1 == authEndpoint2
26 |
27 | case (let .inline(secret1), let .inline(secret2)):
28 | return secret1 == secret2
29 |
30 | case (.noMethod, .noMethod):
31 | return true
32 |
33 | default:
34 | return false
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Tests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 10.1.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Tests/Unit/Helpers/CryptoTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | @testable import PusherSwift
4 |
5 | class CryptoTests: XCTestCase {
6 |
7 | private let testMessage = "{\"user\":\"my user data\"}"
8 | private let testSecret = "mysecret"
9 |
10 | func testHMACGeneratorGeneratesCorrectMAC() {
11 | let digest = Crypto.generateSHA256HMAC(secret: testSecret, message: testMessage)
12 |
13 | let expectedDigest = "7705bb9a7934fe4ceee2325e23750f35752899448c2fe5b064d93326c98fd5b3"
14 | XCTAssertEqual(digest, expectedDigest)
15 | }
16 |
17 | func testHMACGeneratorEmptySecret() {
18 | let digest = Crypto.generateSHA256HMAC(secret: "", message: testMessage)
19 |
20 | let expectedDigest = "a31926f3c0e20c8fd6174ac08c0057708590b6a6bb081a04560ea60b4500738a"
21 | XCTAssertEqual(digest, expectedDigest)
22 | }
23 |
24 | func testHMACGeneratorEmptyMessage() {
25 | let digest = Crypto.generateSHA256HMAC(secret: testSecret, message: "")
26 |
27 | let expectedDigest = "9074a74de0f34ece3f046403ae88d2eea400281da0ed6ebfa76c949016fa672d"
28 | XCTAssertEqual(digest, expectedDigest)
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Tests/Unit/Services/PusherConnectionTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 |
3 | @testable import PusherSwift
4 |
5 | class PusherConnectionTests: XCTestCase {
6 | private var key: String!
7 | private var pusher: Pusher!
8 |
9 | override func setUp() {
10 | super.setUp()
11 |
12 | key = "testKey123"
13 | pusher = Pusher(key: key)
14 | }
15 |
16 | func testUserDataFetcherIsNilByDefault() {
17 | XCTAssertNil(pusher.connection.userDataFetcher, "userDataFetcher should be nil")
18 | }
19 |
20 | func testDelegateIsNilByDefault() {
21 | XCTAssertNil(pusher.connection.delegate, "delegate should be nil")
22 | }
23 |
24 | func testSettingADelegate() {
25 | class DummyDelegate: PusherDelegate {}
26 | let dummyDelegate = DummyDelegate()
27 | pusher.delegate = dummyDelegate
28 | XCTAssertNotNil(pusher.connection.delegate, "delegate should not be nil")
29 | }
30 |
31 | func testSettingAUserDataFetcher() {
32 | func fetchFunc() -> PusherPresenceChannelMember {
33 | return PusherPresenceChannelMember(userId: "1")
34 | }
35 | pusher.connection.userDataFetcher = fetchFunc
36 | XCTAssertNotNil(pusher.connection.userDataFetcher, "userDataFetcher should not be nil")
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/docs/badge.svg:
--------------------------------------------------------------------------------
1 |
29 |
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | com.jazzy.pusherswift
7 | CFBundleName
8 | PusherSwift
9 | DocSetPlatformFamily
10 | pusherswift
11 | isDashDocset
12 |
13 | dashIndexFilePath
14 | index.html
15 | isJavaScriptEnabled
16 |
17 | DashDocSetFamily
18 | dashtoc
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/badge.svg:
--------------------------------------------------------------------------------
1 |
29 |
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/carat.png
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/dash.png
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/gh.png
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/img/spinner.gif
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/js/jazzy.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | window.jazzy = {'docset': false}
6 | if (typeof window.dash != 'undefined') {
7 | document.documentElement.className += ' dash'
8 | window.jazzy.docset = true
9 | }
10 | if (navigator.userAgent.match(/xcode/i)) {
11 | document.documentElement.className += ' xcode'
12 | window.jazzy.docset = true
13 | }
14 |
15 | function toggleItem($link, $content) {
16 | var animationDuration = 300;
17 | $link.toggleClass('token-open');
18 | $content.slideToggle(animationDuration);
19 | }
20 |
21 | function itemLinkToContent($link) {
22 | return $link.parent().parent().next();
23 | }
24 |
25 | // On doc load + hash-change, open any targetted item
26 | function openCurrentItemIfClosed() {
27 | if (window.jazzy.docset) {
28 | return;
29 | }
30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
31 | $content = itemLinkToContent($link);
32 | if ($content.is(':hidden')) {
33 | toggleItem($link, $content);
34 | }
35 | }
36 |
37 | $(openCurrentItemIfClosed);
38 | $(window).on('hashchange', openCurrentItemIfClosed);
39 |
40 | // On item link ('token') click, toggle its discussion
41 | $('.token').on('click', function(event) {
42 | if (window.jazzy.docset) {
43 | return;
44 | }
45 | var $link = $(this);
46 | toggleItem($link, itemLinkToContent($link));
47 |
48 | // Keeps the document from jumping to the hash.
49 | var href = $link.attr('href');
50 | if (history.pushState) {
51 | history.pushState({}, '', href);
52 | } else {
53 | location.hash = href;
54 | }
55 | event.preventDefault();
56 | });
57 |
58 | // Clicks on links to the current, closed, item need to open the item
59 | $("a:not('.token')").on('click', function() {
60 | if (location == this.href) {
61 | openCurrentItemIfClosed();
62 | }
63 | });
64 |
65 | // KaTeX rendering
66 | if ("katex" in window) {
67 | $($('.math').each( (_, element) => {
68 | katex.render(element.textContent, element, {
69 | displayMode: $(element).hasClass('m-block'),
70 | throwOnError: false,
71 | trust: true
72 | });
73 | }))
74 | }
75 |
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/Documents/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | $(function(){
6 | var $typeahead = $('[data-typeahead]');
7 | var $form = $typeahead.parents('form');
8 | var searchURL = $form.attr('action');
9 |
10 | function displayTemplate(result) {
11 | return result.name;
12 | }
13 |
14 | function suggestionTemplate(result) {
15 | var t = '';
16 | t += '' + result.name + '';
17 | if (result.parent_name) {
18 | t += '' + result.parent_name + '';
19 | }
20 | t += '
';
21 | return t;
22 | }
23 |
24 | $typeahead.one('focus', function() {
25 | $form.addClass('loading');
26 |
27 | $.getJSON(searchURL).then(function(searchData) {
28 | const searchIndex = lunr(function() {
29 | this.ref('url');
30 | this.field('name');
31 | this.field('abstract');
32 | for (const [url, doc] of Object.entries(searchData)) {
33 | this.add({url: url, name: doc.name, abstract: doc.abstract});
34 | }
35 | });
36 |
37 | $typeahead.typeahead(
38 | {
39 | highlight: true,
40 | minLength: 3,
41 | autoselect: true
42 | },
43 | {
44 | limit: 10,
45 | display: displayTemplate,
46 | templates: { suggestion: suggestionTemplate },
47 | source: function(query, sync) {
48 | const lcSearch = query.toLowerCase();
49 | const results = searchIndex.query(function(q) {
50 | q.term(lcSearch, { boost: 100 });
51 | q.term(lcSearch, {
52 | boost: 10,
53 | wildcard: lunr.Query.wildcard.TRAILING
54 | });
55 | }).map(function(result) {
56 | var doc = searchData[result.ref];
57 | doc.url = result.ref;
58 | return doc;
59 | });
60 | sync(results);
61 | }
62 | }
63 | );
64 | $form.removeClass('loading');
65 | $typeahead.trigger('focus');
66 | });
67 | });
68 |
69 | var baseURL = searchURL.slice(0, -"search.json".length);
70 |
71 | $typeahead.on('typeahead:select', function(e, result) {
72 | window.location = baseURL + result.url;
73 | });
74 | });
75 |
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.docset/Contents/Resources/docSet.dsidx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.docset/Contents/Resources/docSet.dsidx
--------------------------------------------------------------------------------
/docs/docsets/PusherSwift.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/docsets/PusherSwift.tgz
--------------------------------------------------------------------------------
/docs/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/img/carat.png
--------------------------------------------------------------------------------
/docs/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/img/dash.png
--------------------------------------------------------------------------------
/docs/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/img/gh.png
--------------------------------------------------------------------------------
/docs/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/docs/img/spinner.gif
--------------------------------------------------------------------------------
/docs/js/jazzy.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | window.jazzy = {'docset': false}
6 | if (typeof window.dash != 'undefined') {
7 | document.documentElement.className += ' dash'
8 | window.jazzy.docset = true
9 | }
10 | if (navigator.userAgent.match(/xcode/i)) {
11 | document.documentElement.className += ' xcode'
12 | window.jazzy.docset = true
13 | }
14 |
15 | function toggleItem($link, $content) {
16 | var animationDuration = 300;
17 | $link.toggleClass('token-open');
18 | $content.slideToggle(animationDuration);
19 | }
20 |
21 | function itemLinkToContent($link) {
22 | return $link.parent().parent().next();
23 | }
24 |
25 | // On doc load + hash-change, open any targetted item
26 | function openCurrentItemIfClosed() {
27 | if (window.jazzy.docset) {
28 | return;
29 | }
30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
31 | $content = itemLinkToContent($link);
32 | if ($content.is(':hidden')) {
33 | toggleItem($link, $content);
34 | }
35 | }
36 |
37 | $(openCurrentItemIfClosed);
38 | $(window).on('hashchange', openCurrentItemIfClosed);
39 |
40 | // On item link ('token') click, toggle its discussion
41 | $('.token').on('click', function(event) {
42 | if (window.jazzy.docset) {
43 | return;
44 | }
45 | var $link = $(this);
46 | toggleItem($link, itemLinkToContent($link));
47 |
48 | // Keeps the document from jumping to the hash.
49 | var href = $link.attr('href');
50 | if (history.pushState) {
51 | history.pushState({}, '', href);
52 | } else {
53 | location.hash = href;
54 | }
55 | event.preventDefault();
56 | });
57 |
58 | // Clicks on links to the current, closed, item need to open the item
59 | $("a:not('.token')").on('click', function() {
60 | if (location == this.href) {
61 | openCurrentItemIfClosed();
62 | }
63 | });
64 |
65 | // KaTeX rendering
66 | if ("katex" in window) {
67 | $($('.math').each( (_, element) => {
68 | katex.render(element.textContent, element, {
69 | displayMode: $(element).hasClass('m-block'),
70 | throwOnError: false,
71 | trust: true
72 | });
73 | }))
74 | }
75 |
--------------------------------------------------------------------------------
/docs/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | $(function(){
6 | var $typeahead = $('[data-typeahead]');
7 | var $form = $typeahead.parents('form');
8 | var searchURL = $form.attr('action');
9 |
10 | function displayTemplate(result) {
11 | return result.name;
12 | }
13 |
14 | function suggestionTemplate(result) {
15 | var t = '';
16 | t += '' + result.name + '';
17 | if (result.parent_name) {
18 | t += '' + result.parent_name + '';
19 | }
20 | t += '
';
21 | return t;
22 | }
23 |
24 | $typeahead.one('focus', function() {
25 | $form.addClass('loading');
26 |
27 | $.getJSON(searchURL).then(function(searchData) {
28 | const searchIndex = lunr(function() {
29 | this.ref('url');
30 | this.field('name');
31 | this.field('abstract');
32 | for (const [url, doc] of Object.entries(searchData)) {
33 | this.add({url: url, name: doc.name, abstract: doc.abstract});
34 | }
35 | });
36 |
37 | $typeahead.typeahead(
38 | {
39 | highlight: true,
40 | minLength: 3,
41 | autoselect: true
42 | },
43 | {
44 | limit: 10,
45 | display: displayTemplate,
46 | templates: { suggestion: suggestionTemplate },
47 | source: function(query, sync) {
48 | const lcSearch = query.toLowerCase();
49 | const results = searchIndex.query(function(q) {
50 | q.term(lcSearch, { boost: 100 });
51 | q.term(lcSearch, {
52 | boost: 10,
53 | wildcard: lunr.Query.wildcard.TRAILING
54 | });
55 | }).map(function(result) {
56 | var doc = searchData[result.ref];
57 | doc.url = result.ref;
58 | return doc;
59 | });
60 | sync(results);
61 | }
62 | }
63 | );
64 | $form.removeClass('loading');
65 | $typeahead.trigger('focus');
66 | });
67 | });
68 |
69 | var baseURL = searchURL.slice(0, -"search.json".length);
70 |
71 | $typeahead.on('typeahead:select', function(e, result) {
72 | window.location = baseURL + result.url;
73 | });
74 | });
75 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // iOS Example Obj-C
4 | //
5 |
6 | #import
7 |
8 | @interface AppDelegate : UIResponder
9 |
10 | @property (strong, nonatomic) UIWindow *window;
11 |
12 | @end
13 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // iOS Example Obj-C
4 | //
5 |
6 | #import "AppDelegate.h"
7 |
8 | @interface AppDelegate ()
9 |
10 | @end
11 |
12 | @implementation AppDelegate
13 |
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
16 | return YES;
17 | }
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | NSAppTransportSecurity
38 |
39 | NSAllowsArbitraryLoads
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // iOS Example Obj-C
4 | //
5 |
6 | #import
7 | #import "PusherSwift/PusherSwift-Swift.h"
8 |
9 | @interface ViewController : UIViewController
10 |
11 | @property (nonatomic, strong, readwrite) Pusher *client;
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/iOS Example Obj-C.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/iOS Example Obj-C/iOS Example Obj-C/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // iOS Example Obj-C
4 | //
5 |
6 | #import
7 | #import "AppDelegate.h"
8 |
9 | int main(int argc, char * argv[]) {
10 | @autoreleasepool {
11 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/iOS Example Swift/.swiftlint.yml:
--------------------------------------------------------------------------------
1 | disabled_rules:
2 | - line_length
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // iOS Example
4 | //
5 |
6 | import UIKit
7 |
8 | @UIApplicationMain
9 | class AppDelegate: UIResponder, UIApplicationDelegate {
10 |
11 | var window: UIWindow?
12 |
13 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
14 |
15 | return true
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Carthage.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/../Carthage/Build/iOS/ $(inherited)
2 |
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "pusher-logo-20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "pusher-logo-20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "idiom" : "iphone",
17 | "size" : "29x29",
18 | "scale" : "2x"
19 | },
20 | {
21 | "idiom" : "iphone",
22 | "size" : "29x29",
23 | "scale" : "3x"
24 | },
25 | {
26 | "idiom" : "iphone",
27 | "size" : "40x40",
28 | "scale" : "2x"
29 | },
30 | {
31 | "idiom" : "iphone",
32 | "size" : "40x40",
33 | "scale" : "3x"
34 | },
35 | {
36 | "size" : "60x60",
37 | "idiom" : "iphone",
38 | "filename" : "pusher-logo-60@2x.png",
39 | "scale" : "2x"
40 | },
41 | {
42 | "size" : "60x60",
43 | "idiom" : "iphone",
44 | "filename" : "pusher-logo-60@3x.png",
45 | "scale" : "3x"
46 | },
47 | {
48 | "idiom" : "ipad",
49 | "size" : "20x20",
50 | "scale" : "1x"
51 | },
52 | {
53 | "idiom" : "ipad",
54 | "size" : "20x20",
55 | "scale" : "2x"
56 | },
57 | {
58 | "idiom" : "ipad",
59 | "size" : "29x29",
60 | "scale" : "1x"
61 | },
62 | {
63 | "idiom" : "ipad",
64 | "size" : "29x29",
65 | "scale" : "2x"
66 | },
67 | {
68 | "idiom" : "ipad",
69 | "size" : "40x40",
70 | "scale" : "1x"
71 | },
72 | {
73 | "idiom" : "ipad",
74 | "size" : "40x40",
75 | "scale" : "2x"
76 | },
77 | {
78 | "idiom" : "ipad",
79 | "size" : "76x76",
80 | "scale" : "1x"
81 | },
82 | {
83 | "idiom" : "ipad",
84 | "size" : "76x76",
85 | "scale" : "2x"
86 | },
87 | {
88 | "idiom" : "ipad",
89 | "size" : "83.5x83.5",
90 | "scale" : "2x"
91 | }
92 | ],
93 | "info" : {
94 | "version" : 1,
95 | "author" : "xcode"
96 | }
97 | }
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-20@2x.png
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-20@3x.png
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-60@2x.png
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pusher/pusher-websocket-swift/48e71f918754df0c7e714f35d88e62c1b125ff6e/iOS Example Swift/iOS Example Swift/Images.xcassets/AppIcon.appiconset/pusher-logo-60@3x.png
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSAllowsArbitraryLoads
28 |
29 |
30 | UILaunchStoryboardName
31 | LaunchScreen
32 | UIMainStoryboardFile
33 | Main
34 | UIRequiredDeviceCapabilities
35 |
36 | armv7
37 |
38 | UISupportedInterfaceOrientations
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UISupportedInterfaceOrientations~ipad
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationPortraitUpsideDown
48 | UIInterfaceOrientationLandscapeLeft
49 | UIInterfaceOrientationLandscapeRight
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/iOS Example Swift/iOS Example Swift/iOS Example.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------