Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call a block when the message is gone #21

Closed
Pierre46 opened this issue May 17, 2013 · 8 comments
Closed

call a block when the message is gone #21

Pierre46 opened this issue May 17, 2013 · 8 comments
Labels

Comments

@Pierre46
Copy link

Is it possible to have a block that is call when the message is gone ? Cause there is CallBack which is call only when the user dismissed the message by tapping on it or swiping it to the top. Do you think that we can also have a method like [TSMessage hide...]; in order to hide that actual message ? Anyway, great job ! thank you

@KrauseFx
Copy link
Owner

Dismissing the currently displayed message is easily possible

[[[TSMessage sharedMessage].messages lastObject] fadeMeOut];

But yes, I could provide a convenience method for that.

Why would you want to know when the message is hidden automatically?

@Pierre46
Copy link
Author

Well cause I'm using TSMessage to show the user all notifications I get from a device I'm connected to by WIFI. Which work perfectly, it looks really nice. But for example if I loose connection with the device I wish to show a message to inform the user that I lost connection. After couple second, (the time for the user to read the message) the message disappear and then do an action like come back to the main page...
If I use performSelector: witDelay: it doesn't works well cause the message doesn't show necessarily right after calling [TSMessages show....]; (if a message was already showing, it wait that the message disappear to show the next one)

@Pierre46
Copy link
Author

In order to use messages property on the share instance, your messages have to be declare in the .h file and not in the .m file ;)

@KrauseFx
Copy link
Owner

Providing a - (BOOL)hideActiveMessage is a good idea, I'll implement this little feature now.

@KrauseFx
Copy link
Owner

Dismissing the currently active notification by code is now possible: e5ab6fc

@KrauseFx
Copy link
Owner

Dismissing the currently shown notification is now possible.
Calling a block after the message is gone, no matter if triggered by user or the timeout is not yet implemented.

@Pierre46
Copy link
Author

Great ! Thank you Felix, you doing a really good job !

@jlorich
Copy link

jlorich commented Mar 9, 2015

PR #212 adds the option to execute the callback function when the message is faded out due to timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants