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

OSX support #42

Closed
tbaranes opened this issue Jan 7, 2016 · 13 comments
Closed

OSX support #42

tbaranes opened this issue Jan 7, 2016 · 13 comments

Comments

@tbaranes
Copy link

tbaranes commented Jan 7, 2016

Starting a first suggestion in #28 for OSX support, you seemed to be interested in it. Is there any work started yet? If no, would you be interested in a PR to handle it? (if I have the time to work on it...) Or just some helps?

We are really interested on this since we already using Netfox in our iOS application :)

@kasketis
Copy link
Owner

kasketis commented Jan 7, 2016

Hi tbaranes,

Unfortunately no work have started yet due to lack of free time.
Of course I'm interested in any PR that handles it

Thanks!

@tbaranes
Copy link
Author

tbaranes commented Jan 7, 2016

Alright, I'll look at it once I have time... one day 😆

@tbaranes
Copy link
Author

tbaranes commented Jan 7, 2016

I just looked at the code, and I already have some questions!

How do you prefer that the library's architecture evolve to be OSX compliant? I think the easier way to implement it, and staying generic, is to abstract NFXGenericController to be mac compliant by using the same public methods. I just made a try NFXHelper class. Also, we will probably have to divide some classes (NFX, ...) to avoid too much if os(iOS)..., the best solution is probably extension for each platform.

Also, is it ok to put the iOS interface in a NSWindow or do you want be more "mac"?

That's just a first look into it, I don't have all the keys yet, and since it's a lot of big changes in the code, I prefer be sure that is everything ok with you!

EDIT: Just though, is there a reason to not use storyboards / xib ?

@kasketis
Copy link
Owner

kasketis commented Jan 8, 2016

I like the way you think :) Please keep the same public methods as you did on NFXHelper class.

I don't have any serious experience on OSX platform so I need your opinion on NSWindow.
What do you think is the best way to present the logs on OSX app developers/users?
What changes must we make on the current interface to put it in a NSWindow? Can we use it as is?
A more "mac" way requires a new UI, right?
If yes I think the following structure can handles it easy.

  • Generic (parent with the common core functionality)
    • iOS Child (ios things)
    • OSX Child (osx things)

For example

  • NFXDetailsGenericController
    • NFXDetailsController_iOS
    • NFXDetailsController_OSX

As about your last question, I prefer to create the UI via code because it's easier for collaboration and changes tracking (merges, conflicts, etc)

@tbaranes
Copy link
Author

tbaranes commented Jan 8, 2016

Yeah, abstracting as much as possible the code will be the easiest way! I did it yesterday on NFX to split the showNFX and hideNFX to be OSX compliant. It's a nice way to handle this issue.

For the mac interfaces, we have to rewrite all the code related to it. We can't use any UIKit objects when targeting OSX platform. So, we have to replace UITableView by a NSTableView, adapt the delegate / datasource... so whatever the solution choose, a new UI will be implemented. We can keep the colors, fonts... basic stuff by having a NFX... (like NFXColor, NFXFont...)

For the final display, I was thinking about a NSSplitViewController:

  • On the left the list of all the requests
  • On the right, the details when we clicked on a request.
    This way, we are keeping the same UI architecture as iOS, just changing the navigation (that will be mandatory anyway).

Also, in order to replace the shake gesture (we can't shake our mac :(), I was thinking to add an item in the top menu of the application, with a keyboard shortcut to open netfox. I have to dig a bit more to check if this solution is possible.

Happy to see you agree with my thinking 👍

@kasketis
Copy link
Owner

kasketis commented Jan 8, 2016

NSSplitViewController sounds good to me! 👍
I appreciate your help. Please keep me informed of any update 🍺

@tbaranes
Copy link
Author

I can't find a nice way to make in common ENFXGesture without some renaming. I think the nicest way in code would be to change shake by default, but that also means it will be less explicit during the usage. I will use this solution for now, and update it once we choose how to handle that case

Another solution, could be to have specific case by platform, shake on iOS, menu on mac, but we will have to duplicate the switch, selectedGesture...

Whatever is the final choice, I definitely think we should change ENFXGesture name, it will never have a chance on mac. I'm trying to keep as little as possible the number of breaking change, but can't see a way to avoid this one!

What do you think?

@kasketis
Copy link
Owner

I don't think I understand correctly the issue but is this a possible solution?

#if os(iOS)
private var selectedGesture: ENFXGesture = .shake
#else //os(OSX)
private var selectedGesture: ENFXGesture = .menu
#endif

If not could you please explain the issue to me a little bit more?

Thanks

@tbaranes
Copy link
Author

Yes, it's that, but ENFXGesture for a menu doesn't really make sense.

@tbaranes
Copy link
Author

@kasketis We started without any xibs / storyboards, but it's really painful to develop on mac without these features. Do you mind if, for mac, we use it? Anyway, creating everything programatically takes really too much time... and we can't keep going this way :(

From now on, we will use the UI with xib / storyboard to finalise the mac version. Hope you won't mind!

@kasketis
Copy link
Owner

I really don't like xibs/storyboards but I think it's ok for now for mac. If you don't mind, please use xib for each controller instead of storyboard. Thanks mate 👍 🍺

@tbaranes
Copy link
Author

Alright, xib only, it's always better that nothing for us. Thanks for your comprehension 🍻

@tbaranes tbaranes mentioned this issue Feb 8, 2016
@kasketis
Copy link
Owner

OSX support added in 1.8 version!

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

No branches or pull requests

2 participants