Swiftpack.co - pvzig/SKClient as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by pvzig.
pvzig/SKClient 4.1.0
Create a custom SlackKit client
⭐️ 0
🕓 5 years ago
linux macOS iOS
.package(url: "https://github.com/pvzig/SKClient.git", from: "4.1.0")

SKClient has been consolidated into SlackKit

Create a custom SlackKit client.

Installation

CocoaPods

Add SKClient to your pod file:

use_frameworks!
pod 'SKClient'

and run

# Use CocoaPods version >= 1.4.0
pod install

Carthage

Add SKClient to your Cartfile:

github "pvzig/SKClient"

and run

carthage bootstrap

Drag the built SKClient.framework into your Xcode project.

Swift Package Manager

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.

To use the library in your project import it:

import SKClient

Usage

Subclass Client to create a custom SlackKit 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:

let bot = SlackKit()
bot.addRTMBotWithAPIToken(“xoxb-SLACK_AUTH_TOKEN”, client: MyClient())

GitHub

link
Stars: 0
Last commit: 5 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4.1.0
6 years ago
  • Swift 4

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics