Jabber Guest iOS SDK
UIView+Toast.h
1 /***************************************************************************
2 
3 UIView+Toast.h
4 Toast
5 
6 Copyright (c) 2014 Charles Scalesse.
7 
8 Permission is hereby granted, free of charge, to any person obtaining a
9 copy of this software and associated documentation files (the
10 "Software"), to deal in the Software without restriction, including
11 without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense, and/or sell copies of the Software, and to
13 permit persons to whom the Software is furnished to do so, subject to
14 the following conditions:
15 
16 The above copyright notice and this permission notice shall be included
17 in all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 
27 ***************************************************************************/
28 
29 #import <UIKit/UIKit.h>
30 
31 extern NSString * const CSToastPositionTop;
32 extern NSString * const CSToastPositionCenter;
33 extern NSString * const CSToastPositionBottom;
34 
35 @interface UIView (Toast)
36 
37 // each makeToast method creates a view and displays it as toast
38 - (void)makeToast:(NSString *)message;
39 - (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position;
40 - (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position image:(UIImage *)image;
41 - (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position title:(NSString *)title;
42 - (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position title:(NSString *)title image:(UIImage *)image;
43 
44 // displays toast with an activity spinner
45 - (void)makeToastActivity;
46 - (void)makeToastActivity:(id)position;
47 - (void)hideToastActivity;
48 
49 // the showToast methods display any view as toast
50 - (void)showToast:(UIView *)toast;
51 - (void)showToast:(UIView *)toast duration:(NSTimeInterval)interval position:(id)point;
52 - (void)showToast:(UIView *)toast duration:(NSTimeInterval)interval position:(id)point
53  tapCallback:(void(^)(void))tapCallback;
54 
55 @end