Skip to content

Commit ad55e99

Browse files
authored
Merge pull request #60 from pusher/Noobish1/improvements
Noobish1/improvements
2 parents 0a378df + 82ae5a3 commit ad55e99

33 files changed

+866
-795
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ before_install:
3333
brew install carthage;
3434
fi
3535
- gem install cocoapods
36+
- gem install xcpretty
3637
install:
3738
- pod update
3839
- pod install
3940
before_deploy:
40-
- carthage build --no-skip-current --verbose
41-
- carthage archive PusherSwift
41+
- carthage build --no-skip-current --project-directory PusherSwift
42+
- carthage archive PusherSwift --project-directory PusherSwift
4243
deploy:
4344
provider: releases
4445
api_key:

Example/ViewController.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ class ViewController: UIViewController, ConnectionStateChangeDelegate {
1414
override func viewDidLoad() {
1515
super.viewDidLoad()
1616

17+
// Only use your secret here for testing or if you're sure that there's
18+
// no security risk
19+
let pusherClientOptions = PusherClientOptions(authMethod: .Internal(secret: "YOUR_APP_SECRET"))
20+
let pusher = Pusher(key: "YOUR_APP_KEY", options: pusherClientOptions)
21+
1722
// remove the debugLogger from the client options if you want to remove the
1823
// debug logging, or just change the function below
1924
let debugLogger = { (text: String) in debugPrint(text) }
20-
21-
// Only use your secret here for testing or if you're sure that there's
22-
// no security risk
23-
let pusher = Pusher(key: "YOUR_APP_KEY", options: ["secret": "YOUR_APP_SECRET", "debugLogger": debugLogger])
25+
pusher.connection.debugLogger = debugLogger
2426

2527
pusher.connection.stateChangeDelegate = self
28+
2629
pusher.connect()
2730

2831
pusher.bind({ (message: AnyObject?) in
@@ -43,7 +46,7 @@ class ViewController: UIViewController, ConnectionStateChangeDelegate {
4346
print(data)
4447
pusher.subscribe("presence-channel", onMemberAdded: onMemberAdded)
4548

46-
if let data = data as? Dictionary<String, AnyObject> {
49+
if let data = data as? [String : AnyObject] {
4750
if let testVal = data["test"] as? String {
4851
print(testVal)
4952
}

Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ def import_test_pods
1010
end
1111

1212
target 'PusherSwiftTests-iOS' do
13-
project 'PusherSwift'
13+
project 'PusherSwift/PusherSwift'
1414
platform :ios, '9.0'
1515
import_test_pods
1616
end
1717

1818
target 'PusherSwiftTests-tvOS' do
19-
project 'PusherSwift'
19+
project 'PusherSwift/PusherSwift'
2020
platform :tvos, '9.0'
2121
import_test_pods
2222
end
2323

2424
target 'PusherSwiftTests-OSX' do
25-
project 'PusherSwift'
25+
project 'PusherSwift/PusherSwift'
2626
platform :osx, '10.11'
2727
import_test_pods
2828
end

Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ SPEC CHECKSUMS:
1010
Nimble: 0f3c8b8b084cda391209c3c5efbb48bedeeb920a
1111
Quick: 18d057bc66451eedd5d1c8dc99ba2a5db6e60226
1212

13-
PODFILE CHECKSUM: 9b40e2712dd31189185ad3bb0207ec9d0cf0d7ba
13+
PODFILE CHECKSUM: d258825b2c6c072be15fe94234a10cb44a5a8293
1414

1515
COCOAPODS: 1.0.1

PusherSwift.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PusherSwift.xcodeproj/project.pbxproj renamed to PusherSwift/PusherSwift.xcodeproj/project.pbxproj

Lines changed: 140 additions & 152 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)