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.

61 lines
2.2 KiB

5 years ago
  1. //
  2. // SlackTextViewController
  3. // https://github.com/slackhq/SlackTextViewController
  4. //
  5. // Copyright 2014-2016 Slack Technologies, Inc.
  6. // Licence: MIT-Licence
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import "SLKTypingIndicatorProtocol.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. /** @name A custom view to display an indicator of users typing. */
  12. @interface SLKTypingIndicatorView : UIView <SLKTypingIndicatorProtocol>
  13. /** The amount of time a name should keep visible. If is zero, the indicator will not remove nor disappear automatically. Default is 6.0 seconds*/
  14. @property (nonatomic, readwrite) NSTimeInterval interval;
  15. /** If YES, the user can dismiss the indicator by tapping on it. Default is NO. */
  16. @property (nonatomic, readwrite) BOOL canResignByTouch;
  17. /** The color of the text. Default is grayColor. */
  18. @property (nonatomic, strong) UIColor *textColor;
  19. /** The font of the text. Default is system font, 12 pts. */
  20. @property (nonatomic, strong) UIFont *textFont;
  21. /** The font to be used when matching a username string. Default is system bold font, 12 pts. */
  22. @property (nonatomic, strong) UIFont *highlightFont;
  23. /** The inner padding to use when laying out content in the view. Default is {10, 40, 10, 10}. */
  24. @property (nonatomic, assign) UIEdgeInsets contentInset;
  25. /**
  26. Inserts a user name, only if that user name is not yet on the list.
  27. Each inserted name has an attached timer, which will automatically remove the name from the list once the interval is reached (default 6 seconds).
  28. The control follows a set of display rules, to accomodate the screen size:
  29. - When only 1 user name is set, it will display ":name is typing"
  30. - When only 2 user names are set, it will display ":name & :name are typing"
  31. - When more than 2 user names are set, it will display "several people are typing"
  32. @param username The user name string.
  33. */
  34. - (void)insertUsername:(NSString *_Nullable)username;
  35. /**
  36. Removes a user name, if existent on the list.
  37. Once there are no more items on the list, the indicator will automatically try to hide (by setting it self to visible = NO).
  38. @param username The user name string.
  39. */
  40. - (void)removeUsername:(NSString *_Nullable)username;
  41. @end
  42. NS_ASSUME_NONNULL_END