FLEXManager+Extensibility.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // FLEXManager+Extensibility.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 2/2/20.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXManager.h"
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface FLEXManager (Extensibility)
  11. #pragma mark - Globals Screen Entries
  12. /// Adds an entry at the bottom of the list of Global State items.
  13. /// Call this method before this view controller is displayed.
  14. /// @param entryName The string to be displayed in the cell.
  15. /// @param objectFutureBlock When you tap on the row, information about the object returned
  16. /// by this block will be displayed. Passing a block that returns an object allows you to display
  17. /// information about an object whose actual pointer may change at runtime (e.g. +currentUser)
  18. /// @note This method must be called from the main thread.
  19. /// The objectFutureBlock will be invoked from the main thread and may return nil.
  20. /// @note The passed block will be copied and retain for the duration of the application,
  21. /// you may want to use __weak references.
  22. - (void)registerGlobalEntryWithName:(NSString *)entryName objectFutureBlock:(id (^)(void))objectFutureBlock;
  23. /// Adds an entry at the bottom of the list of Global State items.
  24. /// Call this method before this view controller is displayed.
  25. /// @param entryName The string to be displayed in the cell.
  26. /// @param viewControllerFutureBlock When you tap on the row, view controller returned
  27. /// by this block will be pushed on the navigation controller stack.
  28. /// @note This method must be called from the main thread.
  29. /// The viewControllerFutureBlock will be invoked from the main thread and may not return nil.
  30. /// @note The passed block will be copied and retain for the duration of the application,
  31. /// you may want to use __weak references.
  32. - (void)registerGlobalEntryWithName:(NSString *)entryName
  33. viewControllerFutureBlock:(UIViewController * (^)(void))viewControllerFutureBlock;
  34. /// Removes all registered global entries.
  35. - (void)clearGlobalEntries;
  36. #pragma mark - Simulator Shortcuts
  37. /// Simulator keyboard shortcuts are enabled by default.
  38. /// The shortcuts will not fire when there is an active text field, text view, or other responder
  39. /// accepting key input. You can disable keyboard shortcuts if you have existing keyboard shortcuts
  40. /// that conflict with FLEX, or if you like doing things the hard way ;)
  41. /// Keyboard shortcuts are always disabled (and support is #if'd out) in non-simulator builds
  42. @property (nonatomic) BOOL simulatorShortcutsEnabled;
  43. /// Adds an action to run when the specified key & modifier combination is pressed
  44. /// @param key A single character string matching a key on the keyboard
  45. /// @param modifiers Modifier keys such as shift, command, or alt/option
  46. /// @param action The block to run on the main thread when the key & modifier combination is recognized.
  47. /// @param description Shown the the keyboard shortcut help menu, which is accessed via the '?' key.
  48. /// @note The action block will be retained for the duration of the application. You may want to use weak references.
  49. /// @note FLEX registers several default keyboard shortcuts. Use the '?' key to see a list of shortcuts.
  50. - (void)registerSimulatorShortcutWithKey:(NSString *)key
  51. modifiers:(UIKeyModifierFlags)modifiers
  52. action:(dispatch_block_t)action
  53. description:(NSString *)description;
  54. @end
  55. NS_ASSUME_NONNULL_END