Latest 1.1.9
License MIT
Platforms ios 7.0, requires ARC
Frameworks Foundation, UIKit, AVFoundation, Photos

A simple iOS photo attachment control with feed of photos from library and camera streaming for capture photo.

IMessageAttachment inspired and copied from iMessage attachment control.
Attachment control from iMessage:
Alt    Alt

IMessageAttachment example:
Alt    Alt   

IMessageAttachment implementetion in a project:
Alt    Alt

Works on iOS 8+.


IMessageAttachment is just a UICollectionView with controls, designed for use with keyboard like in iMessage application. Setup IMessageCollectionView in your viewController, set the delegate (which must conform to IMessageViewControllerDelegate) and implement the 1 required delegate methods to provide UIImage from controls.

See the code snippet below for an example of how to implement the IMessageAttachment control. There is also a simple demo app within the project.

// define IMessageCollectionView
@property (nonatomic, weak) IBOutlet IMessageCollectionView *attachmentCollectionView;
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *attachmentCollectionViewHeightConstraint;

// set delegate in viewDidLoad()
self.attachmentCollectionView.VCDelegate = self;

// define IMessageViewControllerProtocol
- (void)pickedAttachmentImage:(UIImage *)attachmentImage {
    [self.attachmentContent addObject:attachmentImage];

You can update attachmentCollectionView’s height automatically by take keyboard’s height. And it’s required thing if you wanna work like iMessage attachment control with keyboard.

// setup notification
[[NSNotificationCenter defaultCenter] addObserver:self

// update attachmentCollectionView's height
- (void)updateAttachmentHeight:(NSNotification*)notification {
    NSDictionary* keyboardInfo = [notification userInfo];
    NSValue* keyboardFrameBegin = [keyboardInfo valueForKey:UIKeyboardFrameBeginUserInfoKey];
    CGFloat height = [keyboardFrameBegin CGRectValue].size.height;

    self.attachmentCollectionViewHeightConstraint.constant = height;
    [self.attachmentCollectionView updateCollectionViewHeight:height];

That’s all.


IMessageAttachment is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "IMessageAttachment"

Or you can copy IMessageAttachment folder to your project.


To run the example project, clone the repo, and run pod install from the Example directory first.

Then import the IMessageCollectionView into your source files:

#import "IMessageCollectionView.h"


Mark Prutskiy, [email protected] HealthJoy


IMessageAttachment is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "IMessageAttachment",
    "version": "1.1.9",
    "license": "MIT",
    "summary": "Photo attachment control from iMessage app",
    "homepage": "",
    "authors": {
        "Mark Prutskiy": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.9"
    "platforms": {
        "ios": "7.0"
    "source_files": "IMessageAttachment/Classes/**/*",
    "ios": {
        "resource_bundles": {
            "IMessageAttachment": [
    "requires_arc": true,
    "frameworks": [

Pin It on Pinterest

Share This