TBToolbarButton.h 904 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // FLEXToolbarButton.h
  3. //
  4. // Created by Tanner on 6/11/17.
  5. //
  6. #import <UIKit/UIKit.h>
  7. typedef void (^TBToolbarAction)(NSString *buttonTitle, BOOL isSuggestion);
  8. @interface TBToolbarButton : UIButton
  9. /// Set to `default` to use the system appearance on iOS 13+
  10. @property (nonatomic) UIKeyboardAppearance appearance;
  11. + (instancetype)buttonWithTitle:(NSString *)title;
  12. + (instancetype)buttonWithTitle:(NSString *)title action:(TBToolbarAction)eventHandler;
  13. + (instancetype)buttonWithTitle:(NSString *)title action:(TBToolbarAction)action forControlEvents:(UIControlEvents)controlEvents;
  14. /// Adds the event handler for the button.
  15. ///
  16. /// @param eventHandler The event handler block.
  17. /// @param controlEvent The type of event.
  18. - (void)addEventHandler:(TBToolbarAction)eventHandler forControlEvents:(UIControlEvents)controlEvents;
  19. @end
  20. @interface TBToolbarSuggestedButton : TBToolbarButton @end