TSMessages icon indicating copy to clipboard operation
TSMessages copied to clipboard

Use custom view for TSMessage (model and view)

Open XBeg9 opened this issue 10 years ago • 7 comments

Now we can subclass and create own controls under TSMessageView. I have also separate view and model (item). Please check example TSMessageCustomItem and TSMessageCustomView.

TSMessageCustomItem *item = [TSMessageCustomItem itemWithTitle:@"Test" subtitle:@"description" type:TSMessageNotificationTypeSuccess inViewController:self tapHandler:^(TSMessageCustomItem *item) {
        NSLog(@"Message did pressed");
    } iconHandler:^(TSMessageCustomItem *item) {
        NSLog(@"Icon did pressed");
    } disclosureView:nil disclosureHandler:^(TSMessageCustomItem *item) {
        NSLog(@"Disclosure view did pressed");
    }];
[TSMessage showNotificationMessageWithItem:item];

XBeg9 avatar Apr 10 '14 13:04 XBeg9

Wow, this Pull Request is huge! Thanks a lot for your contribution. I hope I'll get to take a look at it in the next days.

KrauseFx avatar Apr 10 '14 16:04 KrauseFx

@KrauseFx please check whether or not it has any implications when we would later try to integrate this into the develop branch

dennisreimann avatar Apr 10 '14 17:04 dennisreimann

So what's the real deal here? Are we going to implement this in the 0.X Versions and rebuild this from the scratch in the 1.X develop branch?

mRs- avatar Apr 16 '14 06:04 mRs-

@mRs- I think this should be in the 1.0 release. On the first glance, this PR looks really great and offers a nice way for developers to extend the functionality of TSMessages without touching the core. I still want to take a look at all changes in detail.

How about merging this PR into the develop branch and experiment with it a little?

KrauseFx avatar Apr 16 '14 19:04 KrauseFx

Added fix for height calculation.

XBeg9 avatar Apr 17 '14 08:04 XBeg9

@KrauseFx I am apologize in advance if something is not developed carefully, it took me only 1 night for very urgent project. I haven't enough time now to clean everything, but if you want me to help in something don't hesitate.

XBeg9 avatar Apr 17 '14 08:04 XBeg9

Any chance of seeing this (or something like it) implemented?

mkantor avatar Jul 23 '14 23:07 mkantor