This repository has been archived by the owner on Feb 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTSMessageView.h
executable file
·73 lines (57 loc) · 2.77 KB
/
TSMessageView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//
// TSMessageView.h
// Toursprung
//
// Created by Felix Krause on 24.08.12.
// Copyright (c) 2012 Toursprung. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "TSMessage.h"
#define TSMessageViewAlpha 0.95
@protocol TSMessageViewProtocol<NSObject>
@optional
/** Can be implemented differently. Is used to define the top position from which the notification flies in from */
- (CGFloat)navigationbarBottomOfViewController:(UIViewController *)viewController;
@end
@interface TSMessageView : UIView
+ (NSMutableDictionary *)notificationDesign;
/** Use this method to load a custom design file */
+ (void)addNotificationDesignFromFile:(NSString *)file;
/** The displayed title of this message */
@property (nonatomic, readonly) NSString *title;
/** The displayed content of this message (optional) */
@property (nonatomic, readonly) NSString *content;
/** The view controller this message is displayed in */
@property (nonatomic, readonly) UIViewController *viewController;
/** The duration of the displayed message. If it is 0.0, it will automatically be calculated */
@property (nonatomic, assign) CGFloat duration;
/** The position of the message (top or bottom) */
@property (nonatomic, assign) TSMessageNotificationPosition messagePosition;
/** Is the message currenlty fully displayed? Is set as soon as the message is really fully visible */
@property (nonatomic, assign) BOOL messageIsFullyDisplayed;
@property(nonatomic, assign) id <TSMessageViewProtocol> delegate;
/** Inits the notification view. Do not call this from outside this library.
@param title The title of the notification view
@param content The subtitle/content of the notification view (optional)
@param notificationType The type (color) of the notification view
@param duration The duration this notification should be displayed (optional)
@param viewController The view controller this message should be displayed in
@param callback The block that should be executed, when the user tapped on the message
@param buttonTitle The title for button (optional)
@param buttonCallback The block that should be executed, when the user tapped on the button
@param position The position of the message on the screen
@param dismissAble Should this message be dismissed when the user taps/swipes it?
*/
- (id)initWithTitle:(NSString *)title
withContent:(NSString *)content
withType:(TSMessageNotificationType)notificationType
withDuration:(CGFloat)duration
inViewController:(UIViewController *)viewController
withCallback:(void (^)())callback
withButtonTitle:(NSString *)buttonTitle
withButtonCallback:(void (^)())buttonCallback
atPosition:(TSMessageNotificationPosition)position
shouldBeDismissed:(BOOL)dismissAble;
/** Fades out this notification view */
- (void)fadeMeOut;
@end