FLEXKBToolbarButton.h 1003 B

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