CRToast icon indicating copy to clipboard operation
CRToast copied to clipboard

toast notification is showing after kCRToastTimeIntervalKey, and the [CRToastManager isShowingNotification] returns NO

Open ijinmao opened this issue 9 years ago • 5 comments

I came across this instance:

The toast notification is still showing after kCRToastTimeIntervalKey.

And [CRToastManager isShowingNotification] returns NO, but statusBar is covered by toast View.

ijinmao avatar May 14 '15 08:05 ijinmao

Thanks for the report!

Could you include which Xcode and iOS version you are using? Also if this happens on device only or in the simulator too.

Ashton-W avatar May 14 '15 09:05 Ashton-W

Thanks for the reply~

Xcode version: 6.3 iOS version: 8.0 Test on iPhone 5c and iPad air

My app running process is:

When a user deletes his/her photo, app request to server, CRToast is showing "Deleting..." on statusBar before server responses(I set kCRToastTimeIntervalKey to DBL_MAX).

When request responses, app calls [CRToastManager dismissNotification:YES] in the response completion block, and then(next line of codes) app calls CRToast to show "deleted"(set kCRToastTimeIntervalKey to one sec).

But sometimes CRToastView is still showing "Deleting..." after server response.

ijinmao avatar May 14 '15 11:05 ijinmao

Which version of CRToast are you using by chance?

dmiedema avatar May 16 '15 20:05 dmiedema

I copied the CRToast directory of master branch to my project.

ijinmao avatar May 17 '15 02:05 ijinmao

@ijinmao are you sure you are calling the dismiss method on main thread? if your response completion block is in the background thread, any update ui is uncertain. may be you can try wrapping the call in a dispathc_async block?

dispatch_async(dispatch_get_main_queue(), ^{
    [CRToastManager dismissNotification:YES];
}];

mamnun avatar May 21 '15 01:05 mamnun