You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

70 lines
2.5 KiB

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