|
Packit |
1fb8d4 |
/***************************************************************************
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Toast+UIView.h
|
|
Packit |
1fb8d4 |
Toast
|
|
Packit |
1fb8d4 |
Version 0.1
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Copyright (c) 2011 Charles Scalesse.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit |
1fb8d4 |
copy of this software and associated documentation files (the
|
|
Packit |
1fb8d4 |
"Software"), to deal in the Software without restriction, including
|
|
Packit |
1fb8d4 |
without limitation the rights to use, copy, modify, merge, publish,
|
|
Packit |
1fb8d4 |
distribute, sublicense, and/or sell copies of the Software, and to
|
|
Packit |
1fb8d4 |
permit persons to whom the Software is furnished to do so, subject to
|
|
Packit |
1fb8d4 |
the following conditions:
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
The above copyright notice and this permission notice shall be included
|
|
Packit |
1fb8d4 |
in all copies or substantial portions of the Software.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
Packit |
1fb8d4 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit |
1fb8d4 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
Packit |
1fb8d4 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
Packit |
1fb8d4 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
Packit |
1fb8d4 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
Packit |
1fb8d4 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
***************************************************************************/
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#import <Foundation/Foundation.h>
|
|
Packit |
1fb8d4 |
#import <UIKit/UIKit.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
@interface UIView (Toast)
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#define ToastDurationLong 5.0
|
|
Packit |
1fb8d4 |
#define ToastDurationNormal 3.0
|
|
Packit |
1fb8d4 |
#define ToastDurationShort 1.0
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// each makeToast method creates a view and displays it as toast
|
|
Packit |
1fb8d4 |
-(void)makeToast:(NSString *)message;
|
|
Packit |
1fb8d4 |
-(void)makeToast:(NSString *)message duration:(float)interval position:(id)point;
|
|
Packit |
1fb8d4 |
-(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title;
|
|
Packit |
1fb8d4 |
-(void)makeToast:(NSString *)message duration:(float)interval position:(id)point title:(NSString *)title image:(UIImage *)image;
|
|
Packit |
1fb8d4 |
-(void)makeToast:(NSString *)message duration:(float)interval position:(id)point image:(UIImage *)image;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
// the showToast method displays an existing view as toast
|
|
Packit |
1fb8d4 |
-(void)showToast:(UIView *)toast;
|
|
Packit |
1fb8d4 |
-(void)showToast:(UIView *)toast duration:(float)interval position:(id)point;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
@end
|