Code Monkey home page Code Monkey logo

collectionlayout's Introduction

CollectionLayout

As the norm of apps nowadays is actually a scrollView rather a view, the default system of Apple to build a view using .xib and AutoLayout has rather become clunky and low performance. Furthermore, the manual way of building layout has proven to be a problem when it comes to process require fast iteration and less error-prone ( mostly due to communication between designer-developer ).

Inspired by this talk about backend-driven native UIs by John Sundell, I'm trying to recreate a system of my own by following his words : using a collection view in order to allow a block-based view creation, allow for a higher performance and easier to use layout design option.

However I did some improvement of my own, such as abstracting away the view layout logic into a protocol, allowing Views to layout subview in a similar way a collectionView laying out its cells. This allows view component to be nested inside each other, such as StackViewComponent ( allow stacking component ) and ScrollViewComponent ( allow adding views in a scrollView ).

The cells are also current route all the logic ( delegate, datasource ) from the collection cells into the main view controller. Similar component types will need to separate its behavior by tag.

The current state of project is just a proof of concept, rather than a complete implementation.For a more complete layout option, try Render by Alexdrone, Few.swift or Facebook/Yoga

Usage

Clone and run the workspace file Example folder.

Further documentation will be added later on, should this library became more mature.

Further improvement

  • JSON conversion
  • Tests and documentation sample

Author

Do Son, [email protected]

License

CollectionLayout is available under the MIT license. See the LICENSE file for more info.

collectionlayout's People

Contributors

dodinhthyson avatar doraeminemon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.