Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some customisation APIs #396

Open
alexito4 opened this issue Mar 25, 2020 · 5 comments
Open

Some customisation APIs #396

alexito4 opened this issue Mar 25, 2020 · 5 comments

Comments

@alexito4
Copy link

alexito4 commented Mar 25, 2020

Hi! First of all great work with the latest release, we've been using FLEX for a while and I'm so happy it keeps being maintained.

I wanted to raise this issue to discuss the potential inclusion of some more customisation APIs. I've added a bunch of extra screens tailored to our App and I had to do some workarounds for them, maybe is worth adding some stuff to the public API.

Screenshot 2020-03-25 at 14 48 49

Maybe some of it is already doable and I just haven't found the way of doing it, that's entirely possible 😅

Menu order

I would like to be able to change the order or even enable/disable what's available on the menu.

We use our own tools much more than a lot of the runtime screens for example, that and the network log ^^ So it would be nice to be able to change the order of the menu to put at the top what's most used.

I've seen 4.0 has bookmarks, but is not clear to me how to adopt that in our custom tools. And I'm still not sure that it would be as nice as being able to change the order for us.

UPDATE: Custom tools have been moved to the top #439

Support "actions"

Some of the "tools" that we have simply perform an action, there is no need to show any screen. But right now FLEX only lets us register a block that must return an object or a viewController.

I'm using the dirty trick of returning a viewController that auto-hides itself, it kinda works but the UI breaks a bit every time (specially since iOS 13 new modals).

@implementation FlexDebugAutoHideViewController

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    [self.navigationController popViewControllerAnimated:NO];
}

@end

It would be better to have an API that allowed to register a global entry to just execute a closure. (+ shortcut, see below)

and I sometimes wished to have some of those actions available on the floating bar directly

Support modal presentation

This may be a minor one, but some custom screens are easier to work with if they're modally presented. Right now I need to use the previous workaround + reach into the topViewController of the app to present it manually.

I did this years ago so maybe I could reconsider and just use push instead, I'm just writing it here for completeness.

Support simulator shortcuts on every other register method.

For any custom tool that we add we usually want to have a quick access to it in the simulator. Right now I have to rely on registering the action/screen with my custom methods and inside them follow up to registerSimulatorShortcutWithKey.

If would be nice if the existing registerGlobalEntryWithName would accept a shortcut key too.


That's it :)

I'm maintaining this in our own extension of FLEX so is not a big deal to keep it that way. But I've been doing for a long time and thought it would be worth raising it just in case it could benefit other people.

Thank you.

@NSExceptional
Copy link
Collaborator

NSExceptional commented Mar 25, 2020

We use our own tools much more than a lot of the runtime screens for example, that and the network log

You know, I wanted to move the custom section to the top but I totally forgot. If I did that, would you still want more ways to customize the appearance of that screen?

Some of the "tools" that we have simply perform an action, there is no need to show any screen. But right now FLEX only lets us register a block that must return an object or a viewController.

Actually, 4.0 does add this! It was necessary to make Address Explorer work without pushing something first. Here's what I'm referring to. Unfortunately… it appears I forgot to add an appropriate method in FLEXManager+Extensibility.h. Whoops I will add this in 4.0.1.

Support modal presentation

With actions, you'll be able to present it however you want :)

Support simulator shortcuts on every other register method

This is a very good idea! I'll add this to my todo list as well.

@alexito4
Copy link
Author

Thanks for the quick reply!

I wanted to move the custom section to the top but I totally forgot. If I did that, would you still want more ways to customize the appearance of that screen?

To be honest that may be enough! In that way we would have the custom and then the network which are the most used tools 👍

When I wrote this originally I was thinking on exposing FLEXGlobalsEntry (so you don't need +Extensibility.h and with that expose class methods that create the predefined entries. Then people could provide that in an array of sections as they want, with a default with the current behaviour. But that may be too much if I'm the only one asking for that 😂

with custom entries at the top I would be happy anyway ^^

Actually, 4.0 does add this! [...] Whoops I will add this in 4.0.1.

Very nice! I will migrate to that once is out. Thanks!

Support modal presentation

With actions, you'll be able to present it however you want :)

Support simulator shortcuts on every other register method

This is a very good idea! I'll add this to my todo list as well.

That's great! I was checking my old code now and realised the shortcut workaround relies on the modal workaround that relies action workaround 😂 .

This is because shortcuts trigger an action, so I need to use my modal presentation for that. There is no easy way to add a shortcut that triggers the push of a custom entry. Hopefully an official api would make this easier :)

@matrush
Copy link
Collaborator

matrush commented Mar 25, 2020

Haha I was thinking about moving custom tools to top too. Looking forward to seeing it!

@alexito4
Copy link
Author

For anyone reading this, custom tools have been moved to the top #439 👍

@NSExceptional
Copy link
Collaborator

NSExceptional commented Jan 27, 2021

Support "actions"

Release 4.4.0 will support this!

It also adds public APIs for presenting your own modal screen the same way FLEX's built-in simulator shortcuts do, so that you don't have to worry about accessing the private FLEXManager.explorerViewController and dismissing anything it has itself presented.

Sorry for taking so long, but better late than never right!

I have not forgotten about the rest, but this is all I have time for at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants