65

GitHub - alexdrone/Render: Swift and UIKit a la React.

 6 years ago
source link: https://github.com/alexdrone/Render
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Render Neutrino Swift Platform License

Render

Render is a declarative library for building efficient UIs on iOS inspired by React.

Render 4.* (stable) project page

Render Neutrino is the new version of Render, re-built from the ground up. The documentation is in progress.

  • Declarative: Render uses a declarative API to define UI components. You simply describe the layout for your UI based on a set of inputs and the framework takes care of the rest (diff and reconciliation from virtual view hierarchy to the actual one under the hood).
  • Flexbox layout: Render includes the robust and battle-tested Facebook's Yoga as default layout engine.
  • Fine-grained recycling: Any component such as a text or image can be recycled and reused anywhere in the UI.

From Why React matters:

[The framework] lets us write our UIs as pure function of their states.

Right now we write UIs by poking at them, manually mutating their properties when something changes, adding and removing views, etc. This is fragile and error-prone. [...]

[The framework] lets us describe our entire UI for a given state, and then it does the hard work of figuring out what needs to change. It abstracts all the fragile, error-prone code out away from us.

Installing the framework

If you are using CocoaPods:

Add the following to your Podfile:

pod 'RenderNeutrino'

If you are using Carthage:

Add the following line to your Cartfile:

github "alexdrone/Render" "master"    

Manually:

cd {PROJECT_ROOT_DIRECTORY}
curl "https://raw.githubusercontent.com/alexdrone/Render/master/bin/dist.zip" > render_neutrino_dist.zip && unzip render_neutrino_dist.zip

Drag RenderNeutrino.framework in your project and add it as an embedded binary.

Installing the Tool-chain

(Needs admin privileges)

sudo chown -R $(whoami) /usr/local/bin &&
sudo curl "https://raw.githubusercontent.com/alexdrone/Render/master/tools/render-generate" > render-generate && mv render-generate /usr/local/bin/render-generate && chmod +x /usr/local/bin/render-generate &&
sudo curl "https://raw.githubusercontent.com/alexdrone/Render/master/tools/render-watch.sh" > render-watch && mv render-watch /usr/local/bin/render-watch && chmod +x /usr/local/bin/render-watch

Documentation:

Getting started

Components life-cycle

TableViews and CollectionViews

Layouts

Animations

Component-based Navigation bar

Advanced features

Internals

Mod: Stylesheet and Hot-Reload

Mod: Inspector

Credits:

Layout engine:

In the Stylesheet Mod:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK