All Projects → EnesKaraosman → Swiftychat

EnesKaraosman / Swiftychat

Licence: apache-2.0
SwiftUI Chat UI (Client) Framework & Documentation to get started!

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swiftychat

Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (+108%)
Mutual labels:  chatbot, chat, messaging, chat-application, message
Falconmessenger
🌟🌟🌟🌟🌟 Falcon Messenger is a Fast and Beautiful cloud-based messaging app. With iOS and IPadOS Support. Available on the App Store.
Stars: ✭ 310 (+520%)
Mutual labels:  chat, messaging, chat-application, message
Messenger
Open source, native iOS Messenger, with realtime chat conversations (full offline support).
Stars: ✭ 4,264 (+8428%)
Mutual labels:  chatbot, chat, messaging, chat-application
Chat21 Ios Sdk
DEPRECATED
Stars: ✭ 15 (-70%)
Mutual labels:  chat, messaging, chat-application
Chatlayout
ChatLayout is an alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation as well as all the tools available in UICollectionView. It supports dynamic cells and supplementary view sizes.
Stars: ✭ 184 (+268%)
Mutual labels:  chat, messaging, chat-application
Chat21 Android Sdk
Android Chat SDK built on Firebase
Stars: ✭ 204 (+308%)
Mutual labels:  chat, messaging, chat-application
Js Bot
js-bot: A powerfull chat bot based on coolq-http-api
Stars: ✭ 136 (+172%)
Mutual labels:  chatbot, chatbot-framework, chat-application
Basic Vue Chat
Easy to use Vue chat.
Stars: ✭ 64 (+28%)
Mutual labels:  chatroom, chat, chat-application
Venom
Venom is the most complete javascript library for Whatsapp, 100% Open Source.
Stars: ✭ 3,457 (+6814%)
Mutual labels:  chatbot, chat, message
Stream Chat Swift
Official iOS SDK for Stream Chat
Stars: ✭ 277 (+454%)
Mutual labels:  chat, messaging, chat-application
Vue Advanced Chat
A beautiful chat rooms component made with Vue.js - compatible with Vue, React & Angular
Stars: ✭ 351 (+602%)
Mutual labels:  chatroom, chat, chat-application
Webapp
Tinode web chat using React
Stars: ✭ 156 (+212%)
Mutual labels:  chat, messaging, chat-application
Im service
golang im server
Stars: ✭ 1,694 (+3288%)
Mutual labels:  chat, messaging, chat-application
Nio
💬 Nio is an upcoming matrix client for iOS.
Stars: ✭ 235 (+370%)
Mutual labels:  chat, messaging, chat-application
Android yichat lite
android client
Stars: ✭ 118 (+136%)
Mutual labels:  chat, messaging, chat-application
Chat-Bot
Chatbot – is a computer program that simulates a natural human conversation. Users communicate with a chatbot via the chat interface or by voice, like how they would talk to a real person.
Stars: ✭ 26 (-48%)
Mutual labels:  chatbot, chat-application, chatbot-framework
Darkwire.io
End-to-end encrypted instant web chat
Stars: ✭ 594 (+1088%)
Mutual labels:  chatroom, chat, chat-application
Chat
Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
Stars: ✭ 8,238 (+16376%)
Mutual labels:  chat, messaging, chat-application
Jackal
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).
Stars: ✭ 899 (+1698%)
Mutual labels:  chat, messaging
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-64%)
Mutual labels:  messaging, message

Version Swift 5.3

SwiftyChat

Content

About

Simple Chat Interface to quick start with built-in message cells.
Fully written in pure SwiftUI.

Features

  • [x] HTML String support like <li>, <a> (not like h1 or font based tag)
  • [x] Attributed string support that contains address, date, phoneNumber, url (text is automatically scanned)
  • [x] Landscape orientation support (autoscales message cells with the given cellWidth property, if exists)
  • [x] User Avatar (with different position options, optional usage)
  • [x] Dismiss keyboard (on tapping outside).
  • [x] Multiline Input Bar added (investigate BasicInputView)
  • [x] Scroll to bottom for iOS14 (use proper init).
  • [ ] Scroll to bottom for iOS13.
  • [ ] Swipe to dismiss keyboard.

Quick Preview

Basic Example Preview
Text (Light) Text (Dark)
Advanced Example Preview
Contact, QuickReply, Text, Carousel Map, Image ContextMenu

Installation

SPM: https://github.com/EnesKaraosman/SwiftyChat.git

Message Kinds

public enum ChatMessageKind {
    
    /// A text message,
    /// supports emoji 👍🏻 (auto scales if text is all about emojis)
    case text(String)
    
    /// An image message, from local(UIImage) or remote(URL).
    case image(ImageLoadingKind)
    
    /// A location message, pins given location & presents on MapKit.
    case location(LocationItem)
    
    /// A contact message, generally for sharing purpose.
    case contact(ContactItem)
    
    /// Multiple options, disables itself after selection.
    case quickReply([QuickReplyItem])
    
    /// `CarouselItem`s that contains title, subtitle, image & button in a scrollable view
    case carousel([CarouselItem])
    
    /// A video message, opens the given URL.
    case video(VideoItem)
}

Usage

  • ChatView

Here below is minimum code required to get started (see up & running)
For detail, visit example project here

@State var messages: [MockMessages.ChatMessageItem] = [] // for quick test assign MockMessages.generatedMessages()

// ChatMessageItem & ChatUserItem is a sample objects/structs 
// that conforms `ChatMessage` & `ChatUser` protocols.
ChatView<MockMessages.ChatMessageItem, MockMessages.ChatUserItem> {
    // InputView here, continue reading..
}
// ▼ Required
.environmentObject(
    // All parameters initialized by default, 
    // change as you want.
    ChatMessageCellStyle()
)
...
...
  • InputView

You can investigate existing BasicInputView in project.
You can use it if it suits your need, or create a new one.
Recommended way is just clone this BasicInputView and modify (ex. add camera icon etc.)

// InputBarView variables
@State private var message = ""
@State private var isEditing = false

var inputBarView: some View {
    BasicInputView(
        message: $message, // Typed text.
        isEditing: $isEditing,
        placeholder: "Type something",
        onCommit: { messageKind in
            self.messages.append(
                .init(user: MockMessages.sender, messageKind: messageKind, isSender: true)
            )
        }
    )
    .padding(8)
    .padding(.bottom, isEditing ? 0 : 8)
    .accentColor(.chatBlue)
    .background(Color.primary.colorInvert())
    // ▼ An extension that wraps view inside AnyView
    .embedInAnyView()
}

// Pass in ChatView
ChatView(messages: $messages) {
    inputBarView 
}
...
...

Style and Customization

public class ChatMessageCellStyle: ObservableObject {
    
    let incomingTextStyle: TextCellStyle
    let outgoingTextStyle: TextCellStyle
    
    let incomingCellEdgeInsets: EdgeInsets
    let outgoingCellEdgeInsets: EdgeInsets
    
    let contactCellStyle: ContactCellStyle
    
    let imageCellStyle: ImageCellStyle
    
    let quickReplyCellStyle: QuickReplyCellStyle
    
    let carouselCellStyle: CarouselCellStyle
    
    let locationCellStyle: LocationCellStyle
    
    let incomingAvatarStyle: AvatarStyle
    let outgoingAvatarStyle: AvatarStyle
    
}

You must initiate this class to build a proper style & inject it as environmentObject,
All styles has default initializer;

For detail documentation, visit Styles.md


Please feel free to contribute.
* Create PR for a feature/bug you'd like to add/fix.

Dependencies

Inspiration

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].