Latest 1.0.1
Homepage https://github.com/mcudich/CSSLayout
License MIT
Platforms ios 9.3
Authors

CSSLayout is a tiny Swift wrapper around Facebook’s css-layout framework.

Basic Usage

Imagine a simple UIView, with two subviews (represented as containerNode, childNode and otherChildNode below).

let containerNode = CSSNode(flexDirection: CSSFlexDirectionColumn, alignItems: CSSAlignCenter)
let childNode = CSSNode(size: CSSSize(width: 50, height: 50))
let otherChildNode = CSSNode(alignSelf: CSSAlignStretch)
containerNode.children = [childNode, otherChildNode]

let computedLayout = containerNode.layout()

// At this point, computedLayout can be used to set the frames of the views represented by these nodes.
container.frame = computedLayout.frame
child.frame = computedLayout.children[0].frame
otherChild.frame = computedLayout.children[1].frame

Latest podspec

{
    "name": "CSSLayout",
    "version": "1.0.1",
    "summary": "Swift wrapper around Facebook's css-layout.",
    "description": "CSSLayout is a tiny Swift wrapper around Facebook's css-layout framework.",
    "homepage": "https://github.com/mcudich/CSSLayout",
    "license": "MIT",
    "authors": {
        "Matias Cudich": "[email protected]"
    },
    "source": {
        "git": "https://github.com/mcudich/CSSLayout.git",
        "tag": "1.0.1",
        "submodules": true
    },
    "social_media_url": "https://twitter.com/mcudich",
    "platforms": {
        "ios": "9.3"
    },
    "source_files": [
        "Sources/**/*",
        "Carthage/Checkouts/css-layout/CSSLayout/*"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This