Skip to content
This repository was archived by the owner on Jan 28, 2019. It is now read-only.

Commit ca83556

Browse files
committed
Swift 4
1 parent d5e1fc5 commit ca83556

File tree

11 files changed

+77
-46
lines changed

11 files changed

+77
-46
lines changed

.swiftlint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ disabled_rules:
44
line_length: 140
55
excluded: # paths to ignore during linting. Takes precedence over `included`.
66
- Carthage
7-
- Pods
7+
- Pods
8+
- .build

Cartfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
github "SlackKit/SKCore" >= 4.0.0
2-
github "SlackKit/SKWebAPI" >= 4.0.0
3-
github "daltoniam/Starscream" ~> 2.0
1+
github "SlackKit/SKCore" >= 4.1.0
2+
github "SlackKit/SKWebAPI" >= 4.1.0
3+
github "daltoniam/Starscream" ~> 3.0

Package.swift

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1+
// swift-tools-version:4.0
12
import PackageDescription
23

34
let package = Package(
45
name: "SKRTMAPI",
5-
targets: [
6-
Target(name: "SKRTMAPI")
6+
products: [
7+
.library(name: "SKRTMAPI", targets: ["SKRTMAPI"])
78
],
89
dependencies: [
9-
.Package(url: "https://github.com/SlackKit/SKCore", majorVersion: 4),
10-
.Package(url: "https://github.com/SlackKit/SKWebAPI", majorVersion: 4)
11-
]
10+
.package(url: "https://github.com/SlackKit/SKCore", .upToNextMajor(from: "4.0.0")),
11+
.package(url: "https://github.com/SlackKit/SKWebAPI", .upToNextMajor(from: "4.0.0"))
12+
],
13+
targets: []
1214
)
1315

1416
var dependency: Package.Dependency
17+
var target: Target
1518
#if os(macOS) || os(iOS) || os(tvOS)
16-
dependency = .Package(url: "https://github.com/daltoniam/Starscream", majorVersion: 2)
19+
target = .target(name: "SKRTMAPI", dependencies: ["SKCore", "SKWebAPI", "Starscream"])
20+
dependency = .package(url: "https://github.com/daltoniam/Starscream", .upToNextMajor(from: "3.0.0"))
1721
#else
18-
dependency = .Package(url: "https://github.com/Zewo/WebSocketClient.git", majorVersion: 0, minor: 14)
22+
target = .target(name: "SKRTMAPI", dependencies: ["SKCore", "SKWebAPI", "WebSockets", "HTTP", "URI"])
23+
dependency = .package(url: "https://github.com/vapor/engine", .upToNextMajor(from: "2.2.2"))
1924
#endif
2025
package.dependencies.append(dependency)
26+
package.targets.append(target)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SKRTMAPI: SlackKit RTM Module
2-
![Swift Version](https://img.shields.io/badge/Swift-3.1.1-orange.svg)
2+
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
33
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
44
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
55
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
@@ -21,7 +21,7 @@ pod 'SKRTMAPI'
2121
and run
2222

2323
```
24-
# Use CocoaPods version >= 1.1.0
24+
# Use CocoaPods version >= 1.4.0
2525
pod install
2626
```
2727

@@ -49,7 +49,7 @@ import PackageDescription
4949

5050
let package = Package(
5151
dependencies: [
52-
.Package(url: "https://github.com/SlackKit/SKRTMAPI.git", majorVersion: 4)
52+
.package(url: "https://github.com/SlackKit/SKRTMAPI.git", .upToNextMinor(from: "4.1.0"))
5353
]
5454
)
5555
```

SKRTMAPI.podspec

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Pod::Spec.new do |s|
2-
s.name = "SKRTMAPI"
3-
s.version = "4.0.3"
4-
s.summary = "A Swift library for connecting to the Slack RTM API"
5-
s.homepage = "https://github.com/SlackKit/SKRTMAPI"
6-
s.license = 'MIT'
7-
s.author = { "Peter Zignego" => "[email protected]" }
8-
s.source = { :git => "https://github.com/SlackKit/SKRTMAPI.git", :tag => s.version.to_s }
9-
s.social_media_url = 'https://twitter.com/pvzig'
10-
s.ios.deployment_target = '9.0'
11-
s.osx.deployment_target = '10.11'
12-
s.tvos.deployment_target = '9.0'
13-
s.requires_arc = true
14-
s.source_files = 'Sources/**/*.swift'
15-
s.frameworks = 'Foundation'
16-
s.dependency 'SKCore'
17-
s.dependency 'SKWebAPI'
18-
s.dependency 'Starscream'
2+
s.name = "SKRTMAPI"
3+
s.version = "4.1.0"
4+
s.summary = "A Swift library for connecting to the Slack RTM API"
5+
s.homepage = "https://github.com/SlackKit/SKRTMAPI"
6+
s.license = 'MIT'
7+
s.author = { "Peter Zignego" => "[email protected]" }
8+
s.source = { :git => "https://github.com/SlackKit/SKRTMAPI.git", :tag => s.version.to_s }
9+
s.social_media_url = 'https://twitter.com/pvzig'
10+
s.ios.deployment_target = '9.0'
11+
s.osx.deployment_target = '10.11'
12+
s.tvos.deployment_target = '9.0'
13+
s.requires_arc = true
14+
s.source_files = 'Sources/**/*.swift'
15+
s.frameworks = 'Foundation'
16+
s.dependency 'SKCore'
17+
s.dependency 'SKWebAPI'
18+
s.dependency 'Starscream'
1919
end

SKRTMAPI.xcodeproj/project.pbxproj

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
2684F1741E95AA6900536DCC /* Project object */ = {
250250
isa = PBXProject;
251251
attributes = {
252-
LastUpgradeCheck = 0830;
252+
LastUpgradeCheck = 0920;
253253
ORGANIZATIONNAME = "Peter Zignego";
254254
TargetAttributes = {
255255
2684F17C1E95AA6900536DCC = {
@@ -396,15 +396,21 @@
396396
CLANG_CXX_LIBRARY = "libc++";
397397
CLANG_ENABLE_MODULES = YES;
398398
CLANG_ENABLE_OBJC_ARC = YES;
399+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399400
CLANG_WARN_BOOL_CONVERSION = YES;
401+
CLANG_WARN_COMMA = YES;
400402
CLANG_WARN_CONSTANT_CONVERSION = YES;
401403
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402404
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
403405
CLANG_WARN_EMPTY_BODY = YES;
404406
CLANG_WARN_ENUM_CONVERSION = YES;
405407
CLANG_WARN_INFINITE_RECURSION = YES;
406408
CLANG_WARN_INT_CONVERSION = YES;
409+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
410+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
407411
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413+
CLANG_WARN_STRICT_PROTOTYPES = YES;
408414
CLANG_WARN_SUSPICIOUS_MOVE = YES;
409415
CLANG_WARN_UNREACHABLE_CODE = YES;
410416
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -449,15 +455,21 @@
449455
CLANG_CXX_LIBRARY = "libc++";
450456
CLANG_ENABLE_MODULES = YES;
451457
CLANG_ENABLE_OBJC_ARC = YES;
458+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
452459
CLANG_WARN_BOOL_CONVERSION = YES;
460+
CLANG_WARN_COMMA = YES;
453461
CLANG_WARN_CONSTANT_CONVERSION = YES;
454462
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
455463
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
456464
CLANG_WARN_EMPTY_BODY = YES;
457465
CLANG_WARN_ENUM_CONVERSION = YES;
458466
CLANG_WARN_INFINITE_RECURSION = YES;
459467
CLANG_WARN_INT_CONVERSION = YES;
468+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
469+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
460470
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
471+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
472+
CLANG_WARN_STRICT_PROTOTYPES = YES;
461473
CLANG_WARN_SUSPICIOUS_MOVE = YES;
462474
CLANG_WARN_UNREACHABLE_CODE = YES;
463475
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -507,7 +519,7 @@
507519
PRODUCT_NAME = SKRTMAPI;
508520
PROVISIONING_PROFILE_SPECIFIER = "";
509521
SKIP_INSTALL = YES;
510-
SWIFT_VERSION = 3.0;
522+
SWIFT_VERSION = 4.0;
511523
};
512524
name = Debug;
513525
};
@@ -534,7 +546,7 @@
534546
PRODUCT_NAME = SKRTMAPI;
535547
PROVISIONING_PROFILE_SPECIFIER = "";
536548
SKIP_INSTALL = YES;
537-
SWIFT_VERSION = 3.0;
549+
SWIFT_VERSION = 4.0;
538550
};
539551
name = Release;
540552
};
@@ -561,7 +573,7 @@
561573
PRODUCT_NAME = SKRTMAPI;
562574
SDKROOT = iphoneos;
563575
SKIP_INSTALL = YES;
564-
SWIFT_VERSION = 3.0;
576+
SWIFT_VERSION = 4.0;
565577
};
566578
name = Debug;
567579
};
@@ -588,7 +600,7 @@
588600
PRODUCT_NAME = SKRTMAPI;
589601
SDKROOT = iphoneos;
590602
SKIP_INSTALL = YES;
591-
SWIFT_VERSION = 3.0;
603+
SWIFT_VERSION = 4.0;
592604
};
593605
name = Release;
594606
};
@@ -614,7 +626,7 @@
614626
PRODUCT_NAME = SKRTMAPI;
615627
SDKROOT = appletvos;
616628
SKIP_INSTALL = YES;
617-
SWIFT_VERSION = 3.0;
629+
SWIFT_VERSION = 4.0;
618630
TVOS_DEPLOYMENT_TARGET = 9.0;
619631
};
620632
name = Debug;
@@ -641,7 +653,7 @@
641653
PRODUCT_NAME = SKRTMAPI;
642654
SDKROOT = appletvos;
643655
SKIP_INSTALL = YES;
644-
SWIFT_VERSION = 3.0;
656+
SWIFT_VERSION = 4.0;
645657
TVOS_DEPLOYMENT_TARGET = 9.0;
646658
};
647659
name = Release;

SKRTMAPI.xcodeproj/xcshareddata/xcschemes/SKRTMAPI iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0830"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

SKRTMAPI.xcodeproj/xcshareddata/xcschemes/SKRTMAPI macOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0830"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

SKRTMAPI.xcodeproj/xcshareddata/xcschemes/SKRTMAPI tvOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0830"
3+
LastUpgradeVersion = "0920"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
</Testables>
@@ -36,6 +37,7 @@
3637
buildConfiguration = "Debug"
3738
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3839
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40+
language = ""
3941
launchStyle = "0"
4042
useCustomWorkingDirectory = "NO"
4143
ignoresPersistentStateOnLaunch = "NO"

Sources/SKRTMAPI/Conformers/StarscreamRTM.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import SKCore
2727
import Starscream
2828

2929
public class StarscreamRTM: RTMWebSocket, WebSocketDelegate {
30+
3031
public weak var delegate: RTMDelegate?
3132
private var webSocket: WebSocket?
3233

@@ -55,19 +56,24 @@ public class StarscreamRTM: RTMWebSocket, WebSocketDelegate {
5556
}
5657

5758
// MARK: - WebSocketDelegate
58-
public func websocketDidConnect(socket: WebSocket) {
59+
public func websocketDidConnect(socket: WebSocketClient) {
5960
delegate?.didConnect()
6061
}
6162

62-
public func websocketDidDisconnect(socket: WebSocket, error: NSError?) {
63+
public func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
6364
webSocket = nil
6465
delegate?.disconnected()
6566
}
6667

67-
public func websocketDidReceiveMessage(socket: WebSocket, text: String) {
68+
public func websocketDidReceiveMessage(socket: WebSocketClient, text: String) {
6869
delegate?.receivedMessage(text)
6970
}
7071

71-
public func websocketDidReceiveData(socket: WebSocket, data: Data) {}
72+
public func websocketDidConnect(socket: WebSocket) {
73+
delegate?.didConnect()
74+
}
75+
76+
public func websocketDidReceiveData(socket: WebSocketClient, data: Data) {}
7277
}
78+
7379
#endif

0 commit comments

Comments
 (0)