Add toast to UIView.
Refactored on the basis of Toast.
- iOS 8.0+
LCToast | Toast | |
---|---|---|
image position | top center | left center |
subtitle | ❌ | ✅ |
automatic calculation of hidden time interval | ✅ | ❌ |
dismiss activity when toast shown | ✅ | ❌ |
click to hide the activity | ✅ | ❌ |
modify toast point | ❌ | ✅ |
[self.view lc_showToast:@"床前明月光,疑是地上霜。举头望明月,低头思故乡。"];
LCToastPositionTop | LCToastPositionCenter | LCToastPositionBottom |
---|---|---|
[self.view lc_showToast:@"春种一粒粟,秋收万颗子。四海无闲田,农夫犹饿死。锄禾日当午,汗滴禾下土。谁知盘中餐,粒粒皆辛苦。" image:[UIImage imageNamed:@"warning"] position:(LCToastPositionCenter)];
[self.view lc_showLoading];
To integrate LCToast into your Xcode project using CocoaPods, specify it in your Podfile
:
pod 'LCToast'
- Download everything in the LCToast folder;
- Add (drag and drop) the source files in LCToast to your project;
- Import
UIView+LCToast.h
.
LCToast is provided under the MIT license. See LICENSE file for details.