Permalink
Browse files

Swift 4

  • Loading branch information...
pvzig committed Feb 19, 2018
1 parent 48f80cc commit c2f3731a69df85f852d089839edd14b6ed461b02
View
@@ -1 +1 @@
3.1.1
4.0
View
@@ -1,4 +1,4 @@
github "SlackKit/SKCore" >= 4.0.0
github "SlackKit/SKClient" >= 4.0.0
github "SlackKit/SKRTMAPI" >= 4.0.0
github "SlackKit/SKServer" >= 4.0.0
github "SlackKit/SKCore" >= 4.1.0
github "SlackKit/SKClient" >= 4.1.0
github "SlackKit/SKRTMAPI" >= 4.1.0
github "SlackKit/SKServer" >= 4.1.0
View
@@ -1,14 +1,20 @@
// swift-tools-version:4.0
import PackageDescription
let package = Package(
name: "SlackKit",
targets: [
Target(name: "SlackKit")
products: [
.library(name: "SlackKit", targets: ["SlackKit"])
],
dependencies: [
.Package(url: "https://github.com/SlackKit/SKCore", majorVersion: 4),
.Package(url: "https://github.com/SlackKit/SKClient", majorVersion: 4),
.Package(url: "https://github.com/SlackKit/SKRTMAPI", majorVersion: 4),
.Package(url: "https://github.com/SlackKit/SKServer", majorVersion: 4)
.package(url: "https://github.com/SlackKit/SKCore", .upToNextMinor(from: "4.1.0")),
.package(url: "https://github.com/SlackKit/SKClient", .upToNextMinor(from: "4.1.0")),
.package(url: "https://github.com/SlackKit/SKRTMAPI", .upToNextMinor(from: "4.1.0")),
.package(url: "https://github.com/SlackKit/SKServer", .upToNextMinor(from: "4.1.0"))
],
targets: [
.target(name: "SlackKit",
dependencies: ["SKCore", "SKClient", "SKRTMAPI", "SKServer"],
path: "Sources")
]
)
View
30 Podfile
@@ -2,27 +2,27 @@ use_frameworks!
target 'SlackKit macOS' do
platform :osx, '10.11'
pod 'SKCore'
pod 'SKClient'
pod 'SKWebAPI'
pod 'SKRTMAPI'
pod 'SKServer'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
target 'SlackKit iOS' do
platform :ios, '9.0'
pod 'SKCore'
pod 'SKClient'
pod 'SKWebAPI'
pod 'SKRTMAPI'
pod 'SKServer'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
target 'SlackKit tvOS' do
platform :tvos, '9.0'
pod 'SKCore'
pod 'SKClient'
pod 'SKWebAPI'
pod 'SKRTMAPI'
pod 'SKServer'
pod 'SKCore', '~> 4.1.0'
pod 'SKClient', '~> 4.1.0'
pod 'SKWebAPI', '~> 4.1.0'
pod 'SKRTMAPI', '~> 4.1.0'
pod 'SKServer', '~> 4.1.0'
end
View
@@ -1,6 +1,6 @@
<p align="center"><img src="https://cloud.githubusercontent.com/assets/8311605/24083714/e921a0d4-0cb2-11e7-8384-d42113ef5056.png" alt="SlackKit" width="500"/></p>
![Swift Version](https://img.shields.io/badge/Swift-3.1.1-orange.svg)
![Swift Version](https://img.shields.io/badge/Swift-4.0.3-orange.svg)
![Plaforms](https://img.shields.io/badge/Platforms-macOS,iOS,tvOS,Linux-lightgrey.svg)
![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
@@ -25,10 +25,11 @@ import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/SlackKit/SlackKit.git", majorVersion: 4)
.package(url: "https://github.com/SlackKit/SlackKit.git", .upToNextMinor(from: "4.1.0"))
]
)
```
#### Carthage
Add `SlackKit` to your `Cartfile`:
View
@@ -1,20 +1,20 @@
Pod::Spec.new do |s|
s.name = "SlackKit"
s.version = "4.0.0"
s.summary = "Write Slack apps in Swift"
s.homepage = "https://github.com/pvzig/SlackKit"
s.license = 'MIT'
s.author = { "Peter Zignego" => "peter@launchsoft.co" }
s.source = { :git => "https://github.com/SlackKit/SlackKit.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/pvzig'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.requires_arc = true
s.source_files = 'Sources/*.swift'
s.frameworks = 'Foundation'
s.dependency 'SKCore'
s.dependency 'SKClient'
s.dependency 'SKRTMAPI'
s.dependency 'SKServer'
s.name = "SlackKit"
s.version = "4.1.0"
s.summary = "Write Slack apps in Swift"
s.homepage = "https://github.com/pvzig/SlackKit"
s.license = 'MIT'
s.author = { "Peter Zignego" => "peter@launchsoft.co" }
s.source = { :git => "https://github.com/SlackKit/SlackKit.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/pvzig'
s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.11'
s.tvos.deployment_target = '9.0'
s.requires_arc = true
s.source_files = 'Sources/*.swift'
s.frameworks = 'Foundation'
s.dependency 'SKCore'
s.dependency 'SKClient'
s.dependency 'SKRTMAPI'
s.dependency 'SKServer'
end
@@ -276,7 +276,7 @@
2684F1741E95AA6900536DCC /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0830;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = "Peter Zignego";
TargetAttributes = {
2684F17C1E95AA6900536DCC = {
@@ -420,15 +420,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -458,6 +464,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -473,15 +480,21 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -503,6 +516,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -531,7 +545,7 @@
PRODUCT_NAME = SlackKit;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -558,7 +572,7 @@
PRODUCT_NAME = SlackKit;
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -585,7 +599,7 @@
PRODUCT_NAME = SlackKit;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
@@ -612,7 +626,7 @@
PRODUCT_NAME = SlackKit;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
};
name = Release;
};
@@ -638,7 +652,7 @@
PRODUCT_NAME = SlackKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Debug;
@@ -665,7 +679,7 @@
PRODUCT_NAME = SlackKit;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.0;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
name = Release;
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -36,6 +37,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -36,6 +37,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
@@ -36,6 +37,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -11,7 +11,7 @@ public class ClientConnection {
public var client: Client?
public var rtm: SKRTMAPI?
public var webAPI: WebAPI?
public init(client: Client?, rtm: SKRTMAPI?, webAPI: WebAPI?) {
self.client = client
self.rtm = rtm
View
@@ -35,7 +35,7 @@ public final class SlackKit: RTMAdapter {
internal var callbacks = [TypedEvent]()
internal(set) public var server: SKServer?
internal(set) public var clients: [String: ClientConnection] = [:]
/// Return the `SKRTMAPI` instance of the first client
public var rtm: SKRTMAPI? {
return clients.values.first?.rtm
@@ -54,7 +54,6 @@ public final class SlackKit: RTMAdapter {
} else {
clients[token] = ClientConnection(client: nil, rtm: nil, webAPI: webAPI)
}
}
public func addRTMBotWithAPIToken(
@@ -65,7 +64,7 @@ public final class SlackKit: RTMAdapter {
) {
let rtm = SKRTMAPI(withAPIToken: token, options: options, rtm: rtm)
rtm.adapter = self
if let clientConnection = clients[token] {
clientConnection.rtm = rtm
} else {
@@ -108,6 +107,8 @@ public final class SlackKit: RTMAdapter {
executeCallbackForEvent(event, type: type, clientConnection: clientConnection)
}
public func connectionClosed(with error: Error, instance: SKRTMAPI) {}
// MARK: - Callbacks
public func notificationForEvent(_ type: EventType, event: @escaping EventClosure) {
callbacks.append((type, event))

0 comments on commit c2f3731

Please sign in to comment.