Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A community-driven replacement for JSQMessagesViewController

License

NotificationsYou must be signed in to change notification settings

Taisiya-prog/MessageKit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CircleCIcodecovCarthage compatibleSwiftCocoaPodsXcodeMITContributions Welcome

Goals

  • Provide a 🚨safe🚨 environment for others to learn and grow through Open Source.
  • Make adding Chat:speech_balloon: to a project easy.
  • Enable beautiful and customizable Chat UI's.
  • Provide an awesome Open Source project for the iOS open source community.
  • Help others learn.

Vision

SeeVISION.md for Goals, Scope, & Technical Considerations.

Installation

CocoaPodsRecommended

# Swift 4.2pod'MessageKit'

If you are already using Swift 5, use the3.0.0-swift5 branch until the offical release is made

To integrate MessageKit using Carthage, add the following to yourCartfile:

github "MessageKit/MessageKit"

Manual

Requirements

  • iOS9 or later
  • Swift 4.2 or later

Getting Started

Cell Structure

Each default cell is a subclass ofMessageContentCell which has 7 parts. From top down we have a:cellTopLabel,messageTopLabel,messageContainerView,messageBottomLabel,cellBottomLabel with theavatarView andaccessoryView on either side respectively. Above we see the basicTextMessageCell which uses aMessageLabel as its main content.

This structure will allow you to create a layout that suits your needs as you can customize the size, appearance and padding of each. If you need something more advanced you can implement a custom cell, which we show how to do in theExample project.

MessageInputBar Structure

TheMessageInputBar, derrived fromInputBarAccessoryView is a flexible and robust way of creating any kind of input layout you wish. It is self-sizing which means as the user types it will grow to fill available space. It is centered around themiddleContentView which by default holds theInputTextView. This is surrounded byInputStackView's that will also grow in high based on the needs of their subviewsintrinsicContentSize. See theExample project for examples on how to taylor the layout for your own needs.

Guides

Please have a look at theQuick Start guide and theFAQs.

We recommend you start by looking at theExample project or write a question with the "messagekit" tag onStack Overflow. You can also look at previous issues here on GitHib with the"Question" tag.

For more on how to use the MessageInputBar, see the dependency it is based onInputBarAccessoryView. You can also see this short guide

Default Cells

The type of cell rendered for a given message is based on theMessageKind

publicenumMessageKind{case text(String) // TextMessageCellcase attributedText(NSAttributedString) // TextMessageCellcase photo(MediaItem) // MediaMessageCellcase video(MediaItem) // MediaMessageCellcase location(LocationItem) // LocationMessageCellcase emoji(String) // TextMessageCellcase audio(AudioItem) // AudioMessageCellcase contact(ContactItem) // ContactMessageCell    /// A custom message.    /// - Note: Using this case requires that you implement the following methods and handle this case:    ///   - MessagesDataSource: customCell(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> UICollectionViewCell    ///   - MessagesLayoutDelegate: customCellSizeCalculator(for message: MessageType, at indexPath: IndexPath, in messagesCollectionView: MessagesCollectionView) -> CellSizeCalculatorcase custom(Any?)}

If you choose to use the.custom kind you are responsible for all of the cells layout. AnyUICollectionViewCell can be returned for custom cells which means any of the styling you provide from theMessageDisplayDelegate will not effect your custom cell. Even if you subclass your cell fromMessageContentCell.

Contributing

Great! Look over these things first.

What's Next?

Check out theReleases to see what we are working on next.

Contact

Have a question or an issue about MessageKit? Create anissue!

Interested in contributing to MessageKit? Click here to join ourSlack.

Apps using this library

Add your app to the list of apps using this library and make a pull request.

Please provide attribution, it is greatly appreciated.

Core Team

Thanks

Many thanks tothe contributors of this project.

License

MessageKit is released under theMIT License.

Inspiration

Inspired byJSQMessagesViewController 👈 💯

About

A community-driven replacement for JSQMessagesViewController

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift99.6%
  • Other0.4%

[8]ページ先頭

©2009-2025 Movatter.jp