当前位置: 首页 > 工具软件 > iOS Toast > 使用案例 >

IOS上的Toast

亢琦
2023-12-01

Setup Instructions

  1. Add Toast+UIView.h & Toast+UIView.m to your project.
  2. Link against QuartzCore.
  3. If you're using ARC, you'll need to add the -fno-objc-arc compiler flag to Toast+UIView.m.

Examples

// basic usage
[self.view makeToast:@"This is a piece of toast."];

// toast with duration, title, and position
[self.view makeToast:@"This is a piece of toast with a title." 
             duration:3.0
             position:@"top"
                title:@"Toast Title"];

// toast with an image
[self.view makeToast:@"This is a piece of toast with an image." 
            duration:3.0
            position:[NSValue valueWithCGPoint:CGPointMake(110, 110)]
               image:[UIImage imageNamed:@"toast.png"]];

// display toast with an activity spinner
[self.view makeToastActivity];

See the demo project for more examples. 

 类似资料: