master
1//
2// TSMessageView.h
3// Toursprung
4//
5// Created by Felix Krause on 24.08.12.
6// Copyright (c) 2012 Toursprung. All rights reserved.
7//
8
9#import <UIKit/UIKit.h>
10#import "TSMessage.h"
11
12#define TSMessageViewAlpha 0.95
13
14@interface TSMessageView : UIView
15
16/** The displayed title of this message */
17@property (nonatomic, readonly) NSString *title;
18
19/** The displayed content of this message (optional) */
20@property (nonatomic, readonly) NSString *content;
21
22/** The view controller this message is displayed in */
23@property (nonatomic, readonly) UIViewController *viewController;
24
25/** The duration of the displayed message. If it is 0.0, it will automatically be calculated */
26@property (nonatomic, assign) CGFloat duration;
27
28/** The position of the message (top or bottom) */
29@property (nonatomic, assign) TSMessageNotificationPosition messagePosition;
30
31/** Is the message currenlty fully displayed? Is set as soon as the message is really fully visible */
32@property (nonatomic, assign) BOOL messageIsFullyDisplayed;
33
34/** Inits the notification view. Do not call this from outside this library.
35 @param title The title of the notification view
36 @param content The subtitle/content of the notification view (optional)
37 @param notificationType The type (color) of the notification view
38 @param duration The duration this notification should be displayed (optional)
39 @param viewController The view controller this message should be displayed in
40 @param callback The block that should be executed, when the user tapped on the message
41 @param buttonTitle The title for button (optional)
42 @param buttonCallback The block that should be executed, when the user tapped on the button
43 @param position The position of the message on the screen
44 @param dismissAble Should this message be dismissed when the user taps/swipes it?
45 */
46- (id)initWithTitle:(NSString *)title
47 withContent:(NSString *)content
48 withType:(TSMessageNotificationType)notificationType
49 withDuration:(CGFloat)duration
50 inViewController:(UIViewController *)viewController
51 withCallback:(void (^)())callback
52 withButtonTitle:(NSString *)buttonTitle
53 withButtonCallback:(void (^)())buttonCallback
54 atPosition:(TSMessageNotificationPosition)position
55 shouldBeDismissed:(BOOL)dismissAble;
56
57/** Fades out this notification view */
58- (void)fadeMeOut;
59
60@end