terryworona / TWMessageBarManager

An iOS manager for presenting system-wide notifications via a dropdown message bar.
MIT License
1.77k stars 191 forks source link

Customization #80

Closed KBLNY closed 9 years ago

KBLNY commented 9 years ago

Hey,

Thanks for your work, it's so great!! However, I'm still striving by using my custom protocol.

How Am I supposed to use when I call showMessageWithTitle?

Thanks for your help

terryworona commented 9 years ago

I don't understand the question.

 I'm still striving by using my custom protocol

Please elaborate?

A concrete example with sample code will help.

KBLNY commented 9 years ago

I implemented "An object conforming to the TWMessageBarStyleSheet protocol defines the message bar's look and feel:" with the 3 required methods:

However, I don't know how I should use this implementation. Can you help?

terryworona commented 9 years ago

Set the manager's stylesheet property:

[TWMessageBarManager sharedInstance].styleSheet = yourCustomStyleSheet;
KBLNY commented 9 years ago

Ok, but what should I put as value for the parameter "type" when I use the showMessageWithTitle: method?

terryworona commented 9 years ago

A message bar type:

typedef NS_ENUM(NSInteger, TWMessageBarMessageType) {
    TWMessageBarMessageTypeError,
    TWMessageBarMessageTypeSuccess,
    TWMessageBarMessageTypeInfo
};

Closing this question.

Please read the documentation or play with the demo application bundled with the library to learn more.

KBLNY commented 9 years ago

Ok, thanks it works !

I read the documentation and I played with the demo. But it sounds weird for me, when you specified a custom stylesheet that you have to choose a default bar type (Info, Success or Error) which will be ignored, since I have specified my own stylesheet.

In addition, how can I use a second stylesheet? At the end, I would have something like : Error, Info, Success, Critical (1st custom stylesheet) and "Push Notification" (2nd custom stylesheet).