GZToast 0.1.3

GZToast 0.1.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Aug 2016

Maintained by Samuel ZhaoY.



GZToast 0.1.3

  • By
  • zy.zhao

GZToast is a toast widget which enabe user to build up toast view in iOS apps with three common default styles. At the same time, developer can also easily insert an customized toasting content of one's own. Users can also define popup time and completion callback of one's own

This project now support screen rotation.

What's next:

  • Optimization on current example project sturcture, remove unused config file.
  • Will be providing later stage animation optimization in later stage.
  • Test cases to be provided.

Example

  • To run the example project, clone the repo, and run pod install from the Example directory first.

Default style1: pure toast in text

[[GZToastView toastWithText:@"toast style 1"] showForDuration:4
                                                     onCompletion:^{
                                                      NSLog(@"Toast complete");
                                                     }];

Default style2:

[[GZToastView toastWithText:@"toast style 2: icon with corresponding toast description. Adding the long desc to see the overall layout."
                          icon:[UIImage imageNamed:@"Icon.png"]]
     showForDuration:4
        onCompletion:^{
            NSLog(@"Toast complete");
     }];

Default style3:

[[GZToastView toastWithText:@"toast style 3: icon with corresponding toast description. Adding the long desc to see the overall layout."
                          icon:[UIImage imageNamed:@"Icon.png"]
                         title:@"Title"]
     showForDuration:4
     onCompletion:^{
         NSLog(@"Toast complete");
     }];

Customized style:

UIActivityIndicatorView* indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    indicator.frame = CGRectMake(0, 0, 55, 55);
    [indicator startAnimating];
    [[GZToastView toastWithCustomizedContent:indicator] showForDuration:4
                                                           onCompletion:^{
                                                               NSLog(@"Toast complete");
                                                               [indicator stopAnimating];
                                                           }];

Feature list

  • Support default toast style: Pure Text Toast/Icon + Toast Text/Icon + Toast title + Toast Text
  • Work well with customized toast content
  • Auto support screen rotation
  • Provide option for bottom style/centeral popup in screen

Screen Shot

HTML5 Icon HTML5 Icon
HTML5 Icon HTML5 Icon
HTML5 Icon HTML5 Icon

Installation

Source

Since this is a small project, you can also copy the source code:

GZToastView.h
GZToastView.m

to you project.

samuel.zhao.yue, [email protected]

License

Toast is available under the MIT license. See the LICENSE file for more info.