项目作者: kgn

项目描述 :
Making AutoLayout Easy
高级语言: Swift
项目地址: git://github.com/kgn/KGNAutoLayout.git
创建时间: 2015-10-17T05:24:33Z
项目社区:https://github.com/kgn/KGNAutoLayout

开源协议:MIT License

下载


KGNAutoLayout

KGNAutoLayout makes AutoLayout easy!

Swift 3
Release
License

Build Status
Test Coverage
Carthage Compatible
CocoaPods Version
CocoaPods Platforms

Twitter
Follow
Star

Installing

Carthage

  1. github "kgn/KGNAutoLayout"

CocoaPods

  1. pod 'KGNAutoLayout'

Examples

Example App

Example App

Pin: Superview

  1. view.pinToEdgesOfSuperview(withOffset: 20)

" class="reference-link">pinToEdgesOfSuperview_offset20

  1. view.pinToTopEdgeOfSuperview(withOffset: 20)

" class="reference-link">pinToTopEdgeOfSuperview_offset20

  1. view.pinToRightEdgeOfSuperview(withOffset: 20)

" class="reference-link">pinToRightEdgeOfSuperview_offset20

  1. view.pinToBottomEdgeOfSuperview(withOffset: 20)

" class="reference-link">pinToBottomEdgeOfSuperview_offset20

  1. view.pinToLeftEdgeOfSuperview(withOffset: 20)

" class="reference-link">pinToLeftEdgeOfSuperview_offset20

  1. view.pinToSideEdgesOfSuperview(withOffset: 20)

" class="reference-link">pinToSideEdgesOfSuperview_offset20

  1. view.pinToTopAndBottomEdgesOfSuperview(withOffset: 20)

" class="reference-link">pinToTopAndBottomEdgesOfSuperview_offset20

Pin: Edges

  1. view.pinTopEdgeToTopEdge(of: itemView, withOffset: 20)

" class="reference-link">pinTopEdgeToTopEdgeOfItem_offset20

  1. view.pinRightEdgeToRightEdge(of: itemView, withOffset: 20)

" class="reference-link">pinRightEdgeToRightEdgeOfItem_offset20

  1. view.pinBottomEdgeToBottomEdge(of: itemView, withOffset: 20)

" class="reference-link">pinBottomEdgeToBottomEdgeOfItem_offset20

  1. view.pinLeftEdgeToLeftEdge(of: itemView, withOffset: 20)

" class="reference-link">pinLeftEdgeToLeftEdgeOfItem_offset20

Center

  1. view.centerInSuperview()

" class="reference-link">centerInSuperview

  1. view.centerHorizontallyInSuperview()

" class="reference-link">centerHorizontallyInSuperview

  1. view.centerVerticallyInSuperview()

" class="reference-link">centerVerticallyInSuperview

  1. [view1, view2, view3].centerHorizontally(to: parentView, withSeparation: 20)

" class="reference-link">centerViewsHorizontally_separation20

  1. [view1, view2, view3].centerVertically(to: parentView, withSeparation: 20)

" class="reference-link">centerViewsVertically_separation20

  1. view.centerHorizontally(to: itemView)

" class="reference-link">centerHorizontallyToItem

  1. view.centerVertically(to: itemView)

" class="reference-link">centerVerticallyToItem

Size

  1. view.size(toWidth: 80)

" class="reference-link">sizeToWidth80

  1. view.size(toMinWidth: 40)

" class="reference-link">sizeToMinWidth40

  1. view.size(toMaxWidth: 100)

" class="reference-link">sizeToMaxWidth100

  1. view.size(toHeight: 80)

" class="reference-link">sizeToHeight80

  1. view.size(toMinHeight: 40)

" class="reference-link">sizeToMinHeight40

  1. view.size(toMaxHeight: 100)

" class="reference-link">sizeToMaxHeight100

  1. view.size(toWidthAndHeight: 80)

" class="reference-link">sizeToWidthAndHeight80

  1. view.size(toMinWidthAndHeight: 40)

" class="reference-link">sizeToMinWidthAndHeight40

  1. view.size(toMaxWidthAndHeight: 100)

" class="reference-link">sizeToMaxWidthAndHeight100

  1. view.sizeWidthToWidth(of: itemView)

" class="reference-link">sizeWidthToWidthOfItem

  1. view.sizeHeightToHeight(of: itemView)

" class="reference-link">sizeHeightToHeightOfItem

  1. view.sizeHeightToWidth(of: itemView)

" class="reference-link">sizeHeightToWidthOfItem

  1. view.sizeWidthToHeight(of: itemView)

" class="reference-link">sizeWidthToHeightOfItem

  1. view.sizeWidthAndHeightToWidthAndHeight(of: itemView)

" class="reference-link">sizeWidthAndHeightToWidthAndHeightOfItem

  1. view.sizeHeightToWidth(withAspectRatio: 16/9)

" class="reference-link">sizeHeightToWidthAspectRatio16by9

  1. view.sizeWidthToHeight(withAspectRatio: 16/9)

" class="reference-link">sizeWidthToHeightAspectRatio16by9

Position

  1. view.positionAbove(itemView, withOffset: 20)

" class="reference-link">positionAboveItem_offset20

  1. view.positionToTheRight(of: itemView, withOffset: 20)

" class="reference-link">positionToTheRightOfItem_offset20

  1. view.positionBelow(itemView, withOffset: 20)

" class="reference-link">positionBelowItem_offset20

  1. view.positionToTheLeft(of: itemView, withOffset: 20)

" class="reference-link">positionToTheLeftOfItem_offset20

  1. [view1, view2, view3].positionAbove(itemView, withOffset: 20)

" class="reference-link">positionViewsAbove_offset20

  1. [view1, view2, view3].positionToTheRight(of: itemView, withOffset: 20)

" class="reference-link">positionViewsToTheRight_offset20

  1. [view1, view2, view3].positionBelow(itemView, withOffset: 20)

" class="reference-link">positionViewsBelow_offset20

  1. [view1, view2, view3].positionToTheLeft(of: itemView, withOffset: 20)

" class="reference-link">positionViewsToTheLeft_offset20

Between

  1. view.fitBetween(top: topView, andBottom: bottomView, withOffset: 20)

" class="reference-link">fitBetweenTopAndBottomItems_offset20

  1. view.fitBetween(left: leftView, andRight: rightView, withOffset: 20)

" class="reference-link">fitBetweenLeftAndRightItems_offset20

Fill

  1. parentView.fillHorizontally(withViews: [view1, view2, view3], separation: 20)

" class="reference-link">fillHorizontally_separation20

  1. parentView.fillVertically(withViews: [view1, view2, view3], separation: 20)

" class="reference-link">fillVertically_separation20

Bound

  1. itemView.boundHorizontally(withViews: [view1, view2, view3], separation: 20)

" class="reference-link">boundHorizontally_separation20

  1. itemView.boundVertically(withViews: [view1, view2, view3], separation: 20)

" class="reference-link">boundVertically_separation20

  1. itemView.boundVertically(withViews: [view1, view2, view3], separation: 20)

boundVertically_separation20

Progress:

  • [X] Travis
  • [X] Badges
  • [X] Tests
  • [X] Carthage
  • [X] CocoaPods
  • [X] Description
  • [X] Documentation
  • [X] Example App
  • [X] AppleTV
  • [X] Prebuilt Frameworks
  • Travis Test Matrix