A library to access the Zulip API with Swift.
Swift Package Manager
swift-zulip-api can be installed with the
Swift Package Manager.
dependencies: [ .package( url: "https://github.com/zulip/swift-zulip-api.git", from: "0.3.0" ) ]
swift-zulip-api can also be installed with CocoaPods.
pod install from the terminal.
// Set up a Zulip configuration. let config = Config( emailAddress: "email@example.com", apiKey: "yourapikey", realmURL: "https://example.com" ) // Create the Zulip client. let zulip = Zulip(config: config)
swift-zulip-api is split into a few different namespaces, each with their own
let messages = zulip.messages()
let streams = zulip.streams()
let users = zulip.users()
let events = zulip.events()
Each of the function docs has examples for how to use the functions. There is also a full Swift example file if you want to see every function being used in an actual example program. The example can be run by using
swift run SwiftZulipAPIExample
from the terminal.
swift-zulip-api supports writing Bots to automatically respond to users. Each
bot will respond when it is mentioned in a message.