Skip to content

Commit 9323ce9

Browse files
committed
Merge branch 'master' into feature/282-reorganise-project
2 parents ef196d5 + 8d96956 commit 9323ce9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+648
-469
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,7 @@ fastlane/screenshots
6161
.swift-version
6262
test_push.rb
6363
SwiftLibExampleCertificate.pem
64+
65+
# macOS
66+
67+
.DS_Store

.swiftlint.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
excluded:
2+
- Carthage
3+
- Package.swift
4+
5+
identifier_name:
6+
excluded:
7+
- id
8+
- ex
9+
- to
10+
- ws
11+
12+
# This generates a compiler error if more than this many SwiftLint warnings are present
13+
# (This threshold can become more restrictive as remaining warnings are resolved via refactoring)
14+
warning_threshold: 25

Consumption-Tests/.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled_rules:
2+
- line_length

Consumption-Tests/Shared/Swift/ViewController+Extensions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct DebugConsoleMessage: Codable {
2121
}
2222

2323
extension ViewController {
24-
24+
2525
func makeAndLaunchPusher() -> Pusher {
2626

2727
// Only use your secret here for testing or if you're sure that there's security risk
@@ -38,7 +38,7 @@ extension ViewController {
3838
pusher.connect()
3939

4040
// bind to all events globally
41-
let _ = pusher.bind(eventCallback: { (event: PusherEvent) in
41+
_ = pusher.bind(eventCallback: { (event: PusherEvent) in
4242
var message = "Received event: '\(event.eventName)'"
4343

4444
if let channel = event.channelName {
@@ -58,7 +58,7 @@ extension ViewController {
5858
let myChannel = pusher.subscribe("my-channel")
5959

6060
// bind a callback to event "my-event" on that channel
61-
let _ = myChannel.bind(eventName: "my-event", eventCallback: { (event: PusherEvent) in
61+
_ = myChannel.bind(eventName: "my-event", eventCallback: { (event: PusherEvent) in
6262

6363
// convert the data string to type data for decoding
6464
guard let json: String = event.data,
@@ -88,13 +88,13 @@ extension ViewController {
8888

8989
// triggers a client event on that channel
9090
chan.trigger(eventName: "client-test", data: ["test": "some value"])
91-
91+
9292
return pusher
9393
}
9494
}
9595

9696
extension ViewController: PusherDelegate {
97-
97+
9898
// PusherDelegate methods
9999

100100
func changedConnectionState(from old: ConnectionState, to new: ConnectionState) {

Consumption-Tests/Shared/Swift/iOS/AppDelegate.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
66
var window: UIWindow?
77

88
#if swift(>=4.2)
9-
10-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9+
10+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
1111

1212
return true
1313
}
14-
14+
1515
#else
16-
17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
1818

1919
return true
2020
}
21-
21+
2222
#endif
23-
23+
2424
}

Consumption-Tests/Shared/Swift/iOS/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class ViewController: UIViewController {
2121
super.viewDidLoad()
2222
self.pusher = makeAndLaunchPusher()
2323
}
24-
24+
2525
}

Consumption-Tests/Shared/Swift/macOS/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import Cocoa
33
@NSApplicationMain
44
class AppDelegate: NSObject, NSApplicationDelegate {
55

6-
7-
86
func applicationDidFinishLaunching(_ aNotification: Notification) {
97
// Insert code here to initialize your application
108
}
@@ -13,6 +11,4 @@ class AppDelegate: NSObject, NSApplicationDelegate {
1311
// Insert code here to tear down your application
1412
}
1513

16-
1714
}
18-

Consumption-Tests/Shared/Swift/tvOS/AppDelegate.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
21
import UIKit
32

43
@UIApplicationMain
54
class AppDelegate: UIResponder, UIApplicationDelegate {
65

76
var window: UIWindow?
87

9-
108
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
119
// Override point for customization after application launch.
1210
return true
@@ -29,6 +27,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2927
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3028
}
3129

32-
3330
}
34-

Consumption-Tests/Shared/Swift/tvOS/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ class ViewController: UIViewController {
2121
super.viewDidLoad()
2222
self.pusher = makeAndLaunchPusher()
2323
}
24-
24+
2525
}

PusherSwift.xcodeproj/project.pbxproj

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@
470470
33831C861A9CF61600B124F1 /* Headers */,
471471
33831C871A9CF61600B124F1 /* Resources */,
472472
50355EA8A07B4B8038A4DDF1 /* Frameworks */,
473+
5333AD0A24FE4A8C006E8DF0 /* Run SwiftLint autocorrect */,
474+
5333AD0824F928F1006E8DF0 /* Run SwiftLint */,
473475
);
474476
buildRules = (
475477
);
@@ -508,6 +510,8 @@
508510
73D8A1F72435E5F3001FDE05 /* Headers */,
509511
73D8A1F92435E5F3001FDE05 /* Resources */,
510512
73D8A1FA2435E5F3001FDE05 /* Frameworks */,
513+
5333AD0B24FE4AAC006E8DF0 /* Run SwiftLint autocorrect */,
514+
5333AD0924F92916006E8DF0 /* Run SwiftLint */,
511515
);
512516
buildRules = (
513517
);
@@ -632,6 +636,78 @@
632636
shellPath = /bin/sh;
633637
shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\ntv*) plat=tvOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone\n";
634638
};
639+
5333AD0824F928F1006E8DF0 /* Run SwiftLint */ = {
640+
isa = PBXShellScriptBuildPhase;
641+
buildActionMask = 2147483647;
642+
files = (
643+
);
644+
inputFileListPaths = (
645+
);
646+
inputPaths = (
647+
);
648+
name = "Run SwiftLint";
649+
outputFileListPaths = (
650+
);
651+
outputPaths = (
652+
);
653+
runOnlyForDeploymentPostprocessing = 0;
654+
shellPath = /bin/sh;
655+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
656+
};
657+
5333AD0924F92916006E8DF0 /* Run SwiftLint */ = {
658+
isa = PBXShellScriptBuildPhase;
659+
buildActionMask = 2147483647;
660+
files = (
661+
);
662+
inputFileListPaths = (
663+
);
664+
inputPaths = (
665+
);
666+
name = "Run SwiftLint";
667+
outputFileListPaths = (
668+
);
669+
outputPaths = (
670+
);
671+
runOnlyForDeploymentPostprocessing = 0;
672+
shellPath = /bin/sh;
673+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
674+
};
675+
5333AD0A24FE4A8C006E8DF0 /* Run SwiftLint autocorrect */ = {
676+
isa = PBXShellScriptBuildPhase;
677+
buildActionMask = 2147483647;
678+
files = (
679+
);
680+
inputFileListPaths = (
681+
);
682+
inputPaths = (
683+
);
684+
name = "Run SwiftLint autocorrect";
685+
outputFileListPaths = (
686+
);
687+
outputPaths = (
688+
);
689+
runOnlyForDeploymentPostprocessing = 0;
690+
shellPath = /bin/sh;
691+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
692+
};
693+
5333AD0B24FE4AAC006E8DF0 /* Run SwiftLint autocorrect */ = {
694+
isa = PBXShellScriptBuildPhase;
695+
buildActionMask = 2147483647;
696+
files = (
697+
);
698+
inputFileListPaths = (
699+
);
700+
inputPaths = (
701+
);
702+
name = "Run SwiftLint autocorrect";
703+
outputFileListPaths = (
704+
);
705+
outputPaths = (
706+
);
707+
runOnlyForDeploymentPostprocessing = 0;
708+
shellPath = /bin/sh;
709+
shellScript = "if which swiftlint >/dev/null; then\n swiftlint autocorrect\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
710+
};
635711
73D8A2222435F24E001FDE05 /* Copy Carthage Frameworks */ = {
636712
isa = PBXShellScriptBuildPhase;
637713
buildActionMask = 2147483647;

0 commit comments

Comments
 (0)