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

Storyboards Support #219

Open
PanayotCankov opened this Issue Jul 13, 2015 · 6 comments

Comments

Projects
None yet
5 participants
@PanayotCankov
Member

PanayotCankov commented Jul 13, 2015

Provide support for using Xcode IB with Storyboard and JavaScript for controllers.

This feature will involve generation of Objective-C headers out of the application JavaScript files so that the Xcode's IB can be used for the UI. As directions - we can use TypeScript with out TypeScript definitions (or another language service that is capable of providing static analysis of the JavaScript).

It should integrate with a "live-sync" like solution that will enable watchers on the JavaScript files to regenerate the headers files on save for easier workflow.

It will have certain known limitations. For example dragging a button from the IB on the header to create an IBOutlet may not work since the generated property in the header may not be generated back in the JavaScript.

@fealebenpae

This comment has been minimized.

Contributor

fealebenpae commented Jul 13, 2015

the generated property in the header may not be generated back in the JavaScript

Analyze the header with Clang and insert the property declaration in JavaScript.

@PanayotCankov

This comment has been minimized.

Member

PanayotCankov commented Jul 13, 2015

👍 We'll do our best.

@TheBrousse

This comment has been minimized.

TheBrousse commented Jul 13, 2015

I believe a minimum viable product would be where the developer would have to name his actions and outlets properly in the JavaScript file. And the linking feature would be executed only at compile time.

If the variable (action, outlet, etc.) is not declared, the compilation should simply fail with a useable error message.

Something like:
IBOutlet "myNewButton" is not defined in JavaScript source file "win.ios.js"

As time progresses and the tooling improves, we can help developers by generating these variables for them. Or even checking them when the file is saved (as @PanayotCankov suggested)

@PanayotCankov

This comment has been minimized.

Member

PanayotCankov commented Jul 14, 2015

Well, if you have to write the header files by hand and have to name the actions and outlets properly in the JavaScript file, and can get the errors at run-time instead of compile-time then we currently support Storyboards.

Would you like me to write out an article about what and how Storyboards are supported and give it a try. After that we can decide whether its satisfactory or identify areas for improvement.

@TheBrousse

This comment has been minimized.

TheBrousse commented Jul 14, 2015

Yes, that would be great. I think the goal here is to show the power of all you can do with {N} and that such things are possible.

Once developer actually use this feature, it will be easier to determine how it can be improved with the tooling.

@jasssonpet

This comment has been minimized.

Contributor

jasssonpet commented Jul 14, 2015

I just want to reference our Gameraww example in this issue, which uses a storyboard: https://github.com/NativeScript/ios-runtime/tree/master/examples/Gameraww

@pkoleva pkoleva removed the 1 - Backlog label Jan 5, 2017

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