Latest 1.0.0
Homepage https://github.com/yangentao/YetLayout
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

iOS auto layout by swift


CI Status
Version
License
Platform

let lb = UILabel(frame:CGRect.zero)
self.view.addSubView(lb)

基本用法,属性开头

lb.layout.width.eq(300).active()
lb.layout.width.eq(300).priority(800).ident("mylabel").active()
lb.layout.width.eq(imageView).width.multi(2).offset(8).priority(800).ident("mylabel2").active()

属性相同时, 后面的属性可以省略
lb.layout.width.eq(imageView).active()

lb.layout.left.eq(imageView).right.active()
lb.layout.left.eqParent.active()

组合用法, 函数开头

lb.layout.centerParent().width(200).height(200)
lb.layout.fillX().topParent(16).height(200)
lb.layout.toRightOf(imageView).width(200).topParent(30).height(150)

删除和更新, 更新只能更新constant属性

lb.layout.removeAll()
lb.layout.remove(ident: "mylabel")

lb.layout.width.eq(200).update()
lb.layout.width.eq(200).remove()

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

YetLayout is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'YetLayout'

Author

yangentao, [email protected]

License

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

Latest podspec

{
    "name": "YetLayout",
    "version": "1.0.0",
    "summary": "iOS Auto Layout by Swift",
    "description": "iOS Auto Layout by Swift, Easy to Use.",
    "homepage": "https://github.com/yangentao/YetLayout",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yangentao": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yangentao/YetLayout.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YetLayout/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This