A messages UI for iPhone and iPad.

JSMessagesViewController is a UIViewController subclass that is very similar to the iOS Messages app.

Note: this is only a messaging UI, not a messaging app.

Messages Screenshot 1     Messages Screenshot 2

See more screenshots in the Screenshots/ directory.

Features

  • Highly customizable
  • Arbitrary message sizes
  • Copy & paste messages
  • Support for group messages
  • Data detectors (recognizes phone numbers, links, dates, etc.)
  • Timestamps
  • Avatars
  • Subtitles
  • Lots of bubble styles, or use your own!
  • Swipe down to hide keyboard
  • Dynamically resizes input text view as you type
  • Smooth animations
  • Automatically enables/disables send button (if text view is empty or not)
  • Send/Receive sound effects
  • Storyboards support (if that's how you roll)
  • Universal for iPhone and iPad

Requirements

  • iOS 6.0+
  • ARC

Installation

From CocoaPods

pod 'JSMessagesViewController'

From source

  • Drag the JSMessagesViewController/ folder to your project.
  • Add the AudioToolbox.framework to your project, if you want to use the sound effects

Too cool for ARC?

  • Add the -fobjc-arc compiler flag to all source files in your project in Target Settings > Build Phases > Compile Sources.

Getting Started

  1. Subclass JSMessagesViewController
  2. Setup your viewDidLoad like the following:
- (void)viewDidLoad
{
    self.delegate = self;
    self.dataSource = self;
    [super viewDidLoad];

    self.title = @"Messages";

    self.messageInputView.textView.placeHolder = @"New Message";
}
  1. Implement the JSMessagesViewDelegate protocol
  2. Implement the JSMessagesViewDataSource protocol
  3. Implement - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section from the UITableViewDataSource protocol.
  4. Present your subclassed ViewController programatically or via StoryBoards. Your subclass should be the rootViewController of a UINavigationController.
  5. Be a badass programming-motherfucker and read the fucking documentation. (Yes, there's documentation! Seriously!)
  6. See the included demo project: JSMessagesDemo.xcodeproj

Documentation

Documentation is available here via CocoaDocs. Thanks @CocoaDocs!

Customization

Stuff here coming soon!

How To Contribute

  1. Find an issue to work on, or create a new one.
  2. Fork me.
  3. Create a new branch with a sweet fucking name: git checkout -b issue_<##>_<featureOrFix>.
  4. Do some motherfucking programming.
  5. Keep your code nice and clean by adhering to Google's Objective-C Style Guide and Apple's Coding Guidelines for Cocoa.
  6. Don't break shit, especially master.
  7. Update the documentation header comments.
  8. Update the pod spec and project version numbers, adhering to the semantic versioning specification.
  9. Submit a pull request.
  10. See step 1.

Credits

Created by @jesse_squires, a programming-motherfucker.

Assets extracted using @0xced / iOS-Artwork-Extractor.

Originally inspired by @soffes / SSMessagingViewController.

Many thanks to the contributors of this project.

Square message bubbles designed by @michaelschultz.

About

I initially developed this control to use in Hemoglobe for private messages between users.

As it turns out, messaging is a popular thing that iOS devs want to do — I know, this is shocking. Thus, I am supporting this project in my free time and have added features way beyond what Hemoglobe ever needed.

Check out my work at Hexed Bits.

Apps Using This Control

Hemoglobe

Oxwall Messenger

FourChat

Libraries for developers

Contact me to have your app listed here.

Related Projects

SSMessagingViewController

AcaniChat

UIBubbleTableView

MIT License

You are free to use this as you please. No attribution necessary, but much appreciated.

Copyright © 2013 Jesse Squires

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.