Toast messages and spinners in iOS

I found this code while looking for an iOS notification similar to Android Toast.
The code is available in a Github project found here: https://github.com/scalessec/Toast
It was just what I needed!

P.S. You can also make great loaders with this code 😉

To install:

  1. Add a pod entry to your Podfile pod
    pod 'Toast', '~> 3.0'
  2. Install the pod(s) by running
    pod install
  3. Include MBProgressHUD wherever you need it with:
    #import "Toast/UIView+Toast.h"

 

Code:

Put the following code wherever you want to invoke the toast.

[self.view makeToast:@"This is a piece of toast with a specific duration." duration:3.0];

For displaying a loader with the activityspinner use

[self.view makeToastActivity:CSToastPositionCenter];

And to hide it:

[self.view hideToastActivity];