RRMessageController 1.0

RRMessageController 1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by remi robert.



  • By
  • remirobert


RRMessageController is a UIViewController, allows you to write a message with photos as attachment. A messages UI for iPhone. Support text && image.


Usage


With block :

- (void) newMessage {
    RRSendMessageViewController *controller = [[RRSendMessageViewController alloc] init];

    [controller presentController:self :^(RRMessageModel *model, BOOL isCancel) {
        if (isCancel == true) {
            self.message.text = @"";
        }
        else {
            self.message.text = model.text;
        }
        [controller dismissViewControllerAnimated:YES completion:nil];
    }];
}

With delegate :

#pragma mark RRSendMessageController Delegate

- (void) messageCancel {
    [self.controllerMessage dismissViewControllerAnimated:YES completion:nil];
}

- (void) getMessage:(RRMessageModel *)message {
    self.message.text = message.text;
    [self.controllerMessage dismissViewControllerAnimated:YES completion:nil];
}

- (void) newMessage {
    [self presentViewController:self.controllerMessage animated:YES completion:nil];
}

- (void) initMessageController {
    self.controllerMessage = [[RRSendMessageViewController alloc] init];
    self.controllerMessage.delegate = self;
}

You can launch a RRSendMessgeController with a existant message:

RRMessageModel *defaultMessage = [[RRMessageModel alloc] init];
defaultMessage.text = @"salut !";
defaultMessage.photos = [self getRandomPhotos];

RRSendMessageViewController *controller = [[RRSendMessageViewController alloc] initWithMessage:defaultMessage];