Swiftpack.co - Package - GetStream/stream-chat-swift

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

GetStream/stream-chat-swift

Official iOS SDK for Stream Chat

The official iOS SDK for StreamChat

The StreamChatUI SDK is the official iOS SDK for Stream Chat, a service for building chat and messaging applications.


Important ⚠️

This README refers to a beta version of StreamChatUI not suitable for production yet. The last stable version is 2.6.

StreamChatUI is a framework containing highly customizable UI components to build your chat UI with Stream chat using UIKit or SwiftUI.

If you want to build a fully custom UI and looking only for low-level chat SDK without UI components, check out StreamChat SDK.


👉 Migrating from 2.x

In order to provide new features like offline support and SwiftUI wrappers, we had to make notable breaking changes to the public API of the SDKs.

Please don't upgrade to version 3.0 before you get familiar with the changes and their impact on your codebase.

To prevent CocoaPods from updating StreamChat to version 3, you can explicitly pin the SDKs to versions 2.x in your podfile:

pod 'StreamChat', '~> 2.0'
pod 'StreamChatCore', '~> 2.0' # if needed
pod 'StreamChatClient', '~> 2.0' # if needed
  • Migrating StreamChat (UI components): If you use our Chat UI components, migration from 2.x is not recommended yet. The UI components SDK was renamed to StreamChatUI and is currently only in public beta.

  • Migrating StreamChatClient and/or StreamChatCore: Our low-level frameworks (Client + Core) were merged and renamed to StreamChat. If you use only our low-level frameworks, you can use our cheat sheet to get more familiar with the update API and better assess the impact of the changes on your codebase.


Main Features

  • Uses UIKit patterns and paradigms: The API follows the design of native system SKDs. It makes integration with your existing code easy and familiar.
  • First-class support for SwiftUI: Built-it wrappers make using the SDK with the latest Apple UI framework a seamless experience. (coming Q1/2021)
  • Familiar behavior: The UI elements are good platform citizens and behave like native elements; they respect tintColor, layoutMargins, light/dark mode, dynamic font sizes, etc.
  • Swift native API: Uses Swift's powerful language features to make the SDK usage easy and type-safe.
  • Fully open source implementation: You have access to the comple source code of the SDK here on GitHub.
  • Supports iOS 11+, Swift 5.2: We proudly support older versions of iOS, so your app can stay available to almost everyone.

Quick Links (WIP)

 

  • Register to get an API key for Stream Chat.
  • Installation: Learn more about how to install the SDK using CocoaPods or SPM.
  • Cheat Sheet: Learn how to use the SDK by real world examples.
  • Demo app: This repo includes a fully functional demo app with example usage of the SDK.

 

Main Principles

  • Progressive disclosure: The SDK can be used easily with very minimal knowledge of it. As you become more familiar with it, you can dig deeper and start customizing it on all levels.

  • Highly customizable: Every element is designed to be easily customizable. You can modify the brand color by setting tintColor, apply appearance changes using custom UI rules, or subclass existing elements and inject them everywhere in the system, no matter how deep is the logic heirarchy.

  • open by default: Everything is open unless there's a strong reason for it to not be. This means you can easily modify almost every behavior of the SDK such that it fits your needs.

  • Good platform citizen: The UI elements behave like good platform citizens. They use existing iOS patterns; their beahavior is predictable and matches system UI components; they respect tintColor, layourMargins, dynamic font sizes, and other system-defined UI constants.

Quick Overview

Channel List

Features Preview
A list of channels matching provided query
Channel name and image based on the channel members or custom data
Unread messages indicator
Preview of the last message
Online indicator for avatars
Create new channel and start right away

Message List

Features Preview
A list of message in a channel
Photo preview
Message reactions
Message grouping based on the send time
Link preview
Inline replies
Message threads
GIPHY support

Message Composer

Features Preview
Support for multiline text, expands and shrinks as needed
Image and file attachments
Replies to messages
Tagging of users
Chat commands like mute, ban, giphy

Chat Commands

Features Preview
Easily search commands by writing / symbol or tap bolt icon
GIPHY support out of box
Supports mute, unmute, ban, unban commands
WIP support of custom commands

User Tagging Suggestion

Features Preview
User mentions preview
Easily search for concrete user
Mention as many users as you want

Github

link
Stars: 122
Last commit: 3 minutes ago

Releases

StreamChat 3.0 - 2021-01-22T15:34:35

StreamChat SDK reaches another milestone with version 3.0 🎉

New features:

  • Offline support: Browse channels and send messages while offline.
  • First-class support for SwiftUI and Combine: Built-it wrappers make using the SDK with the latest Apple frameworks a seamless experience.
  • Uses UIKit patterns and paradigms: The API follows the design of native system SDKs. It makes integration with your existing code easy and familiar.
  • Currently, 3.0 version is available only using CocoaPods. We will add support for SPM soon.

To use the new version of the framework, add to your Podfile:

pod 'StreamChat', '~> 3.0'

⚠️ Breaking Changes ⚠️

In order to provide new features like offline support and SwiftUI wrappers, we had to make notable breaking changes to the public API of the SDKs.

Please don't upgrade to version 3.0 before you get familiar with the changes and their impact on your codebase.

To prevent CocoaPods from updating StreamChat to version 3, you can explicitly pin the SDKs to versions 2.x in your podfile:

pod 'StreamChat', '~> 2.0'
pod 'StreamChatCore', '~> 2.0' # if needed
pod 'StreamChatClient', '~> 2.0' # if needed

The framework naming and overall structure were changed. Since version 3.0, Stream Chat iOS SDK consists of:

StreamChat framework

Contains low-level logic and is meant to be used by users who want to build a fully custom UI. It covers functionality previously provided by StreamChatCore and StreamChatClient.

StreamChat UI framework (currently in public beta)

Contains a complete set of ready-to-use configurable UI elements that you can customize a use for building your own chat UI. It covers functionality previously provided by StreamChat.

Sample App

The best way to explore the SDKs and their usage is our sample app. It contains an example implementation of a simple IRC-style chat app using the following patterns:

  • UIKit using delegates
  • UIKit using reactive patterns and SDK's built-in Combine wrappers.
  • SwiftUI using the SDK's built-in ObservableObject wrappers.
  • Learn more about the sample app at its own README.

Documentation Quick Links

  • Cheat Sheet Real-world code examples showcasing the usage of the SDK.
  • Controller Overview This page contains a list of all available controllers within StreamChat, including their short description and typical use-cases.
  • Glossary A list of names and terms used in the framework and documentation.