Code Monkey home page Code Monkey logo

cocoaui's Introduction

CocoaUI

Build adaptive UI for iOS Apps with Flow-Layout mechanism and CSS properties.

Author Platform Language License

AAA BBB
OS iOS 9.x, 8.x, 7.x
Language Objective-C, Swift(see https://github.com/XiaoCC/CocoaUI-Swift)
License New BSD License
Author ideawu
Website http://www.cocoaui.com/

Demos:

Dependency

  • libxml2

Setup

  1. Download the source files from GitHub: git, .zip
  2. Use Xcode the open the IKit Project
  3. Build the schema IKit-universal, set the schema Build Configuration to Release(default is Debug)
  4. Add the header files folder and static library to you own project(see Quick Start):
  • header files folder: build/release-universal/include/IKit
  • static libarry file: build/release-universal/include/libIKit.a

Usage

Sample Code(Objective-C)

CocoaUI makes things ass-kicking easy! -

[superview.style set:@"padding: 10;"];

Without CocoaUI, here's the equivalent code you'd have to write using Apple's Foundation API directly:

UIView *superview = self;
UIView *view1 = [[UIView alloc] init];
view1.translatesAutoresizingMaskIntoConstraints = NO;
[superview addSubview:view1];
UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10);
[superview addConstraints:@[
    //view1 constraints
    [NSLayoutConstraint constraintWithItem:view1
                                 attribute:NSLayoutAttributeTop
                                 relatedBy:NSLayoutRelationEqual
                                    toItem:superview
                                 attribute:NSLayoutAttributeTop
                                multiplier:1.0
                                  constant:padding.top],
    [NSLayoutConstraint constraintWithItem:view1
                                 attribute:NSLayoutAttributeLeft
                                 relatedBy:NSLayoutRelationEqual
                                    toItem:superview
                                 attribute:NSLayoutAttributeLeft
                                multiplier:1.0
                                  constant:padding.left],
    [NSLayoutConstraint constraintWithItem:view1
                                 attribute:NSLayoutAttributeBottom
                                 relatedBy:NSLayoutRelationEqual
                                    toItem:superview
                                 attribute:NSLayoutAttributeBottom
                                multiplier:1.0
                                  constant:-padding.bottom],
    [NSLayoutConstraint constraintWithItem:view1
                                 attribute:NSLayoutAttributeRight
                                 relatedBy:NSLayoutRelationEqual
                                    toItem:superview
                                 attribute:NSLayoutAttributeRight
                                multiplier:1
                                  constant:-padding.right],
]];

CocoaUI supports most CSS layout and styling feature, the key of CocoaUI is Flow Layout.

Example Apps

Learning CocoaUI

Documentation

http://www.cocoaui.com/en/docs

About Source Code

IKit

The CocoaUI library.

IObj

A dynamic JSON object/model library for Objective-C.

Test

Demo app for CocoaUI

CocoaUIViewer

A Write and Seen tool helps you easily develop XML UI.

cocoaui's People

Contributors

ideawu avatar

Watchers

 avatar  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.