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

Added support for a minimum duration for a toast notification #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added support for a minimum duration for a toast notification #23

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 10, 2014

You can now set a minimum duration for the notification to display. This allows you to keep notifications visible even after the network calls have completed, but still afford you the luxury of calling dismiss after the time interval has passed if you need to. For instance: I make network call that I expect to take 1 second, but I want the notification to be visible for 3 seconds. With this method I can set the minimumDuration to 3.0, and then in my completion block for the network call I can still call dismissNotification. The notification will still dismiss after 3 seconds. If the network call takes 5 seconds (poor internet connection) then the dismiss won't get called until the completion block is called at 5 seconds.

You can now set a minimum duration for the notification to display.  This allows you to keep notifications visible even after the network calls have completed, but still afford you the luxury of calling dismiss after the time interval has passed if you need to.  For instance: I make  network call that I expect to take 1 second, but I want the notification to be visible for 3 seconds.  With this method I can set the minimumDuration to 3.0, and then in my completion block for the network call I can still call dismissNotification.  The notification will still dismiss after 3 seconds.  If the network call takes 5 seconds (poor internet connection) then the dismiss won't get called until the completion block is called at 5 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants