Update README.md
Create a custom SlackKit client.
Add SKClient to your pod file:
use_frameworks! pod 'SKClient'
and run
# Use CocoaPods version >= 1.4.0 pod install
Add SKClient to your Cartfile:
github "pvzig/SKClient"
carthage bootstrap
Drag the built SKClient.framework into your Xcode project.
SKClient.framework
Add SKClient to your Package.swift
import PackageDescription let package = Package( dependencies: [ .package(url: "https://github.com/pvzig/SKClient.git", .upToNextMinor(from: "4.1.0")) ] )
Run swift build on your application’s main directory.
swift build
To use the library in your project import it:
import SKClient
Subclass Client to create a custom SlackKit client.
Client
class MyClient: Client { override func notificationForEvent(_ event: Event, type: EventType) { … } override func initialSetup(JSON: [String: Any]) { … } }
Pass your custom client to SlackKit when adding an RTM bot:
SlackKit
let bot = SlackKit() bot.addRTMBotWithAPIToken(“xoxb-SLACK_AUTH_TOKEN”, client: MyClient())
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
SKClient has been consolidated into SlackKit
Create a custom SlackKit client.
Installation
CocoaPods
Add SKClient to your pod file:
and run
Carthage
Add SKClient to your Cartfile:
and run
Drag the built
SKClient.framework
into your Xcode project.Swift Package Manager
Add SKClient to your Package.swift
Run
swift build
on your application’s main directory.To use the library in your project import it:
Usage
Subclass
Client
to create a custom SlackKit client.Pass your custom client to
SlackKit
when adding an RTM bot: