MyLayout is a simple and easy objective-c framework for iOS view layout

Overview

Version Carthage compatible License Platform Support Weibo QQ GitHub stars

Logo

MyLayout

MyLayout is a simple and easy objective-c framework for iOS view layout. MyLayout provides some simple functions to build a variety of complex interface. It integrates the functions including: Autolayout and SizeClass of iOS, five layout classes of Android, float and flex-box and bootstrap of HTML/CSS. The MyLayout's Swift version are named: TangramKit

cn Chinese (Simplified): 中文说明

Usage

  • There is a container view S which width is 100 and height is wrap to all subviews height. there are four subviews A,B,C,D arranged from top to bottom.
  • Subview A's left margin is 20% width of S, right margin is 30% width of S, height is equal to width of A.
  • Subview B's left margin is 40, width is filled in to residual width of S,height is 40.
  • Subview C's width is filled in to S, height is 40.
  • Subview D's right margin is 20, width is 50% width of S, height is 40

demo

    MyLinearLayout *S = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
    S.subviewSpace = 10;
    S.widthSize.equalTo(@100);
    
    UIView *A = UIView.new;
    A.leftPos.equalTo(@0.2);
    A.rightPos.equalTo(@0.3);
    A.heightSize.equalTo(A.widthSize);
    [S addSubview:A];
    
    UIView *B = UIView.new;
    B.leftPos.equalTo(@40);
    B.widthSize.equalTo(@60);
    B.heightSize.equalTo(@40);
    [S addSubview:B];
    
    UIView *C = UIView.new;
    C.leftPos.equalTo(@0);
    C.rightPos.equalTo(@0);
    C.heightSize.equalTo(@40);
    [S addSubview:C];
    
    UIView *D = UIView.new;
    D.rightPos.equalTo(@20);
    D.widthSize.equalTo(S.widthSize).multiply(0.5);
    D.heightSize.equalTo(@40);
    [S addSubview:D];
    

Performance comparison

demo

create time(ms)/per subview Frame MyLayout AutoLayout Masonry UIStackView
MyLinearLayout 0.08 0.164 0.219 0.304 0.131
MyFrameLayout 0.05 0.149 0.209 0.273 0.131
MyRelativeLayout 0.079 0.182 0.116 0.359 0.131
MyFlowLayout 0.08 0.107 0.198 0.258 0.131
MyFloatLayout 0.044 0.148 0.203 0.250 0.131
layout time(ms)/per subview Frame MyLayout AutoLayout Masonry UIStackView
MyLinearLayout 0 0.049 0.269 0.269 0.272
MyFrameLayout 0 0.042 0.243 0.243 0.272
MyRelativeLayout 0 0.068 0.274 0.274 0.272
MyFlowLayout 0 0.036 0.279 0.279 0.272
MyFloatLayout 0 0.055 0.208 0.208 0.272

Architecture

demo

MyLayoutPos

MyLayoutPos is represent to the position of a view. UIView provides six extension variables:leftPos, topPos, bottomPos, rightPos, centerXPos, centerYPos to set view's margin or space distance between self and others. You can use equalTo method to set NSNumber or MyLayoutPos or NSArray value. there are six simple variables:myLeft,myTop,myBottom,myRight,myCenterX,myCenterY use to set NSNumber value. eg. A.leftPos.equalTo(@10); <==> A.myLeft = 10;

MyLayoutSize

MyLayoutSize is represent to the size of a view. UIView provides two extension variables:widthSize,heightSize to set view's width and height dimension. You can use equalTo method to set NSNumber or MyLayoutSize or NSArray value. there are two simple variables: myWidth, myHeight use to set NSNumber value. eg. A.widthSize.equalTo(@10); <==> A.myWidth = 10;

MyLinearLayout

Is equivalent to: UIStackView of iOS and LinearLayout of Android.

Linear layout is a single line layout view that the subviews are arranged in sequence according to the added order(from top to bottom or from left to right). So the subviews' origin&size constraints are established by the added order. Subviews arranged in top-to-bottom order is called vertical linear layout view, and the subviews arranged in left-to-right order is called horizontal linear layout.

演示效果图

Sample code:

-(void)loadView {
    [super loadView];
    
    MyLinearLayout *S = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
    S.myWidth = 120;
    S.subviewSpace = 10;
    
    UIView *A = [UIView new];
    A.myHorzMargin = 5;
    A.myHeight = 40;
    [S addSubview:A];
    
    UIView *B = [UIView new];
    B.myLeft = 20;
    B.mySize = CGSizeMake(40,40);
    [S addSubview:B];
    
    UIView *C = [UIView new];
    C.myRight = 40;
    C.mySize = CGSizeMake(50,40);
    [S addSubview:C];
    
    UIView *D = [UIView new];
    D.myHorzMargin = 10;
    D.myHeight = 40;
    [S addSubview:D];
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
    A.backgroundColor = [UIColor greenColor];
    B.backgroundColor = [UIColor blueColor];
    C.backgroundColor = [UIColor orangeColor];
    D.backgroundColor = [UIColor cyanColor];
 }

MyRelativeLayout

Is equivalent to: AutoLayout of iOS and RelativeLayout of Android.

Relative layout is a layout view that the subviews layout and position through mutual constraints.The subviews in the relative layout are not depended to the adding order but layout and position by setting the subviews' constraints.

演示效果图

Sample code:

-(void)loadView {
    [super loadView];
    
    MyRelativeLayout *S = [MyRelativeLayout new];
    S.widthSize.equalTo(@170);
    S.heightSize.equalTo(@280);
    
    UIView *A = [UIView new];
    A.leftPos.equalTo(@20);
    A.topPos.equalTo(@20);
    A.widthSize.equalTo(@40);
    A.heightSize.equalTo(A.widthSize);
    [S addSubview:A];
    
    UIView *B = [UIView new];
    B.leftPos.equalTo(A.centerXPos);
    B.topPos.equalTo(A.bottomPos).offset(10);
    B.widthSize.equalTo(@60);
    B.heightSize.equalTo(A.heightSize);
    [S addSubview:B];
    
    UIView *C = [UIView new];
    C.leftPos.equalTo(B.rightPos).offset(10);
    C.bottomPos.equalTo(B.bottomPos);
    C.widthSize.equalTo(@40);
    C.heightSize.equalTo(B.heightSize).multiply(0.5);
    [S addSubview:C];
    
    UIView *D = [UIView new];
    D.bottomPos.equalTo(C.topPos).offset(10);
    D.rightPos.equalTo(@15);
    D.heightSize.equalTo(A.heightSize);
    D.widthSize.equalTo(D.heightSize);
    [S addSubview:D];
    
    UIView *E = [UIView new];
    E.centerYPos.equalTo(@0);
    E.centerXPos.equalTo(@0);
    E.heightSize.equalTo(@40);
    E.widthSize.equalTo(S.widthSize).add(-20);
    [S addSubview:E];
    //.. F, G
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
    A.backgroundColor = [UIColor greenColor];
    B.backgroundColor = [UIColor blueColor];
    C.backgroundColor = [UIColor orangeColor];
    D.backgroundColor = [UIColor cyanColor];
    E.backgroundColor = [UIColor magentaColor];
}

MyFrameLayout

Is equivalent to: FrameLayout of Android.

Frame layout is a layout view that the subviews can be overlapped and gravity in a special location of the superview.The subviews' layout position&size is not depended to the adding order and establish dependency constraint with the superview. Frame layout devided the vertical orientation to top,vertical center and bottom, while horizontal orientation is devided to left,horizontal center and right. Any of the subviews is just gravity in either vertical orientation or horizontal orientation.

演示效果图

Sample code:

 -(void)loadView {
    [super loadView];
    
    MyFrameLayout *S = [MyFrameLayout new];
    S.mySize = CGSizeMake(320,500);
    
    UIView *A = [UIView new];
    A.mySize = CGSizeMake(40,40);
    [S addSubview:A];
    
    UIView *B = [UIView new];
    B.mySize = CGSizeMake(40,40);
    B.myRight = 0;
    [S addSubview:B];
    
    UIView *C = [UIView new];
    C.mySize = CGSizeMake(40,40);
    C.myCenterY = 0;
    [S addSubview:C];
    
    UIView *D = [UIView new];
    D.mySize = CGSizeMake(40,40);
    D.myCenter = CGPointZero;
    [S addSubview:D];
    
    //..E,F,G
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
    A.backgroundColor = [UIColor greenColor];
    B.backgroundColor = [UIColor blueColor];
    C.backgroundColor = [UIColor orangeColor];
    D.backgroundColor = [UIColor cyanColor];  
  }

MyTableLayout

Is equivalent to: TableLayout of Android and table of HTML.

Table layout is a layout view that the subviews are multi-row&col arranged like a table. First you must create a rowview and add it to the table layout, then add the subview to the rowview. If the rowviews arranged in top-to-bottom order,the tableview is caled vertical table layout,in which the subviews are arranged from left to right; If the rowviews arranged in in left-to-right order,the tableview is caled horizontal table layout,in which the subviews are arranged from top to bottom.

演示效果图

Sample code:

 -(void)loadView {
    [super loadView];
    
    MyTableLayout *S = [MyTableLayout tableLayoutWithOrientation:MyOrientation_Vert];
    S.myWidth = MyLayoutSize.wrap;
    S.subviewHSpace = 10;
    S.subviewVSpace = 10;
    
    [S addRow:MyLayoutSize.wrap colSize:MyLayoutSize.wrap];
    
    UIView *A = [UIView new];
    A.mySize = CGSizeMake(50,40);
    [S addSubview:A];
    
    UIView *B = [UIView new];
    B.mySize = CGSizeMake(100,40);
    [S addSubview:B];
    
    UIView *C = [UIView new];
    C.mySize = CGSizeMake(30,40);
    [S addSubview:C];
    
    [S addRow:MyLayoutSize.wrap colSize:MyLayoutSize.wrap];
    
    UIView *D = [UIView new];
    D.mySize = CGSizeMake(200,40);
    [S addSubview:D];
    
    //...E,F  
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
    A.backgroundColor = [UIColor greenColor];
    B.backgroundColor = [UIColor blueColor];
    C.backgroundColor = [UIColor orangeColor];
    D.backgroundColor = [UIColor cyanColor];
}  

MyFlowLayout

Is equivalent to: flexbox of CSS3.

Flow layout is a layout view presents in multi-line that the subviews are arranged in sequence according to the added order, and when meeting with a arranging constraint it will start a new line and rearrange. The constrains mentioned here includes count constraints and size constraints. The orientation of the new line would be vertical and horizontal, so the flow layout is divided into: count constraints vertical flow layout, size constraints vertical flow layout, count constraints horizontal flow layout, size constraints horizontal flow layout. Flow layout often used in the scenes that the subviews is arranged regularly, it can be substitutive of UICollectionView to some extent. the MyFlowLayout is almost implement the flex-box function of the HTML/CSS.

演示效果图

Sample code:

  -(void)loadView {
    [super loadView];
    
    MyFlowLayout *S = [MyFlowLayout flowLayoutWithOrientation:MyOrientation_Vert arrangedCount:4];
    S.myHeight = MyLayoutSize.wrap;
    S.myWidth = 300;
    S.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    S.gravity = MyGravity_Horz_Fill;
    S.subviewSpace = 10;
    
    for (int i = 0; i < 10; i++) {
        UIView *A = [UIView new];
        A.heightSize.equalTo(A.widthSize);
        [S addSubview:A];
        
        A.backgroundColor = [UIColor greenColor];
    }
    
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
}

MyFloatLayout

Is equivalent to: float of CSS.

Float layout is a layout view that the subviews are floating gravity in the given orientations, when the size is not enough to be hold, it will automatically find the best location to gravity. float layout's conception is reference from the HTML/CSS's floating positioning technology, so the float layout can be designed in implementing irregular layout. According to the different orientation of the floating, float layout can be divided into left-right float layout and up-down float layout.

演示效果图

Sample code:

 -(void)loadView {
    [super loadView];
    
    MyFloatLayout *S  = [MyFloatLayout floatLayoutWithOrientation:MyOrientation_Vert];
    S.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    S.subviewSpace = 10;
    S.myWidth = 300;
    S.myHeight = MyLayoutSize.wrap;
    
    UIView *A = [UIView new];
    A.mySize = CGSizeMake(80,70);
    [S addSubview:A];
    
    UIView *B = [UIView new];
    B.mySize = CGSizeMake(150,40);
    [S addSubview:B];
    
    UIView *C = [UIView new];
    C.mySize = CGSizeMake(70,40);
    [S addSubview:C];
    
    UIView *D = [UIView new];
    D.mySize = CGSizeMake(100,140);
    [S addSubview:D];
    
    UIView *E = [UIView new];
    E.mySize = CGSizeMake(150,40);
    E.reverseFloat = YES;
    [S addSubview:E];
    
    UIView *F = [UIView new];
    F.mySize = CGSizeMake(120,60);
    [S addSubview:F];
    
    
    [self.view addSubview:S];
    S.backgroundColor = [UIColor redColor];
    A.backgroundColor = [UIColor greenColor];
    B.backgroundColor = [UIColor blueColor];
    C.backgroundColor = [UIColor orangeColor];
    D.backgroundColor = [UIColor cyanColor];
    E.backgroundColor = [UIColor blackColor];
    F.backgroundColor = [UIColor whiteColor];
}     

MyPathLayout

Is unique characteristic layout view of iOS.

Path layout is a layout view that the subviews are according to a specified path curve to layout. You must provide a type of Functional equation,a coordinate and a type of distance setting to create a Path Curve than all subview are equidistance layout in the Path layout. path layout usually used to create some irregular and gorgeous UI layout.

演示效果图

Sample code:

-(void)loadView {
   [super loadView];
   
   MyPathLayout *S = [MyPathLayout new];
   S.mySize = CGSizeMake(320,320);
   S.coordinateSetting.isReverse = YES;
   S.coordinateSetting.origin = CGPointMake(0.5, 0.2);
   
   S.polarEquation = ^(CGFloat angle) {
       return 80 * (1 + cos(angle));
   };
   
   for (int i = 0; i < 4; i++) {
       UIView *A = [UIView new];
       A.mySize = CGSizeMake(40,40);
       [S addSubview:A];
       
       A.backgroundColor = [UIColor greenColor];
   }

   [self.view  addSubview:S];
   S.backgroundColor = [UIColor redColor];
}

MyGridLayout

Is unique characteristic layout view of iOS.

Grid layout is a view to a rectangular area according to the row or column divided into multiple sub areas, sub area according to the requirements of layout can continue recursive partitioning, grid layout inside the child view will be in accordance with the sequence to add to the corresponding leaf area filling in the layout of the mechanism. Grid layout through a system of the layout of the custom to the position and size, added to the inside of the grid layout child view will no longer need to specify the location and size but by grid layout of the grid to complete, so can be very convenient to adjust the layout structure, so as to realize the ability of dynamic layout.

演示效果图

Sample code:

-(void)loadView {
   [super loadView];
   
   MyGridLayout *S = [MyGridLayout new];
   S.mySize = CGSizeMake(320,320);
   S.backgroundColor = [UIColor redColor];
   [self.view addSubview:S];

   //add grids
   [S addRow:50];
   id
    g2 = [S 
   addRow:MyLayoutSize.fill];
   [g2 
   addCol:
   0.2];
   [g2 
   addCol:
   0.2];
   
   id
   
     g23 = [g2 
    addCol:
    0.6];
   [g23 
    addRow:
    0.5];
   [g23 
    addRow:
    0.5];
   
   
   
    //add subviews
   UIView *A = [UIView 
    new];
   A.
    backgroundColor = [UIColor 
    greenColor];
   [S 
    addSubview:A];
   
   UIView *B = [UIView 
    new];
   B.
    backgroundColor = [UIColor 
    blueColor];
   [S 
    addSubview:B];

   UIView *C = [UIView 
    new];
   C.
    backgroundColor = [UIColor 
    orangeColor];
   [S 
    addSubview:C];

   UIView *D = [UIView 
    new];
   D.
    backgroundColor = [UIColor 
    cyanColor];
   [S 
    addSubview:D];

   UIView *E = [UIView 
    new];
   E.
    backgroundColor = [UIColor 
    blackColor];
   [S 
    addSubview:E];    
}

   
  

MySizeClass

Is equivalent to: Size Classes of iOS.

MyLayout provided support to SizeClass in order to fit the different screen sizes of devices. You can combinate the SizeClass with any of the 6 kinds of layout views mentioned above to perfect fit the UI of all equipments. there are two UIView extension method:

-(instancetype)fetchLayoutSizeClass:(MySizeClass)sizeClass;
-(instancetype)fetchLayoutSizeClass:(MySizeClass)sizeClass copyFrom:(MySizeClass)srcSizeClass;

to set Size Classes Characteristics like below:

//default is all Size Classes
 MyLinearLayout *rootLayout = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert];
    rootLayout.padding = UIEdgeInsetsMake(10, 10, 10, 10);
    rootLayout.myHeight = MyLayoutSize.empty;
    rootLayout.gravity = MyGravity_Horz_Fill;

//MySizeClass_wAny | MySizeClass_hCompact is iPhone landscape orientation.
 MyLinearLayout *lsc = [rootLayout fetchLayoutSizeClass:MySizeClass_wAny | MySizeClass_hCompact copyFrom:MySizeClass_wAny | MySizeClass_hAny];
 
    lsc.orientation = MyOrientation_Horz;
    lsc.myWidth = MyLayoutSize.empty;
    lsc.gravity = MyGravity_Vert_Fill;

Demo sample

演示效果图 演示效果图 演示效果图 演示效果图 演示效果图 演示效果图 演示效果图 演示效果图

How To Get Started

Download MyLayout and try out the included iPad and iPhone example apps Read FAQ, or articles below:

http://www.jianshu.com/p/4c1eb0dd676f 布局框架和原理介绍
http://blog.csdn.net/yangtiang/article/details/46483999 线性布局
http://blog.csdn.net/yangtiang/article/details/46795231 相对布局
http://blog.csdn.net/yangtiang/article/details/46492083 框架布局
http://blog.csdn.net/yangtiang/article/details/48011431 表格布局
http://blog.csdn.net/yangtiang/article/details/50652946 流式布局
http://www.jianshu.com/p/0c075f2fdab2 浮动布局 http://www.jianshu.com/p/4ac229057396 路径布局

Because my english is poor so I just only can support chinese articles,and I wish somebody can help me translate to english.

Communication

  • If you need help, use Stack Overflow or Baidu. (Tag 'mylayout')
  • If you'd like to contact me, use qq:156355113 or weibo:欧阳大哥 or email:[email protected]
  • If you found a bug, and can provide steps to reliably reproduce it, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Installation

MyLayout supports multiple methods for installing the library in a project.

Copy to your project

  1. Copy Lib folder from the demo project to your project
  2. Add#import "MyLayout.h" to your project's PCH file or the referenced header file。

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like MyLayout in your projects. You can install it with the following command:

$ gem install cocoapods

To integrate MyLayout into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

pod 'MyLayout'

Then, run the following command:

$ pod install

Use Carthage

  1. Create a Cartfile file.

    github "youngsoft/MyLinearLayout"
    
  2. Run carthage update.

  3. On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop MyLayout framework from the Carthage/Build folder on disk.

  4. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

    /usr/local/bin/carthage copy-frameworks
    

    and add the path under “Input Files”, e.g.:

    $(SRCROOT)/Carthage/Build/iOS/MyLayout.framework
    

FAQ

  • If you use MyLayout runtime cause 100% CPU usage said appeared constraint conflict, please check the subview's constraint set.
  • If you use MyLayout exception crashed in MyBaseLayout willMoveToSuperview method. it does not matter, just remove the exception break setting in CMD+7.
  • If you set wrapConentWidth or wrapContentHeight while set widthSize or heightSize in layout view may be constraint conflict。
  • If you set the layout view as a UIViewController's root view. please set wrapContentWidth and wrapContentHeight to NO.
  • Just only MyLinearLayout and MyFrameLayout's subview support relative margin.
  • If subview added in layout view, the setFrame method can't setting the origin but the size.

License

MyLayout is released under the MIT license. See LICENSE for details.

Version History

CHANGELOG.md

Comments
  • MyLayout 能不能結合autolayout,動態算出custom view 的高度?

    MyLayout 能不能結合autolayout,動態算出custom view 的高度?

    歐陽大哥你好,

    我原本有個cell, 長這樣 https://i.imgur.com/15MZNS8.png title, subtitle 可能會有多行,透過autoLayout, 可以動態得到適合的高度

    新的layout需要在subtitle 底下加一個vertical FlowLayout 像這樣 https://i.imgur.com/15MZNS8.png 黃色部分是FlowLayout

    請問有沒有辨法讓這個FlowLayou.wrapContentHeight = YES 並且像原先一樣用autoLayout, 讓整個cell高度為 title.height + subtitle.height + FlowLayout.height + subviewSpaces

    感謝你!

    opened by Elvis5566 5
  • 对于 MyFlowLayout 的使用困惑

    对于 MyFlowLayout 的使用困惑

    我看了下现有的 FLLTest2ViewController 的处理,只是设置了对应的 padding 和 weight ,width 和 height 均为 1。然后我也尝试这么设置了。但是结果是,所有的标签都是左对齐,理论上按照现有的情况进行设置的话,应该是自动排布。还是说我用错了类?应该使用 FloatView? P.S. 外部的父 view 是 scrollView image

    - (void)setupView {
        _layout.wrapContentHeight = YES;
        _layout.subviewSpace = 16.f;
        _layout.padding = UIEdgeInsetsMake(24.f, 24.f, 24.f, 24.f);
        _layout.weight = 1;
        _layout.myMargin = 0;
        
        [self addSubview:_layout];
    }
    
    - (UIButton *)createButtonWithModel:(BBSPostTagModel *)model {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        button.tag = model.tagID;
        [button setTitle:model.title forState:UIControlStateNormal];
        button.titleLabel.font = [UIFont systemFontOfSize:15.f];
        button.layer.cornerRadius = 19.f;
        [button setTitleColor:RGBColorHex(0x4B4F56) forState:UIControlStateNormal];
        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
        [button setBackgroundColor:RGBColorHex(0xF6F7F9)];
        button.widthSize.equalTo(button.widthSize).add(32.f);
        button.myHeight = 37.f;
        [button sizeToFit];
        
        [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
        
        return button;
    }
    
    opened by zkhCreator 5
  • 设置视图的widthSize.max后,再设置widthSize.max(MyLayoutSize.empty); 导致崩溃

    设置视图的widthSize.max后,再设置widthSize.max(MyLayoutSize.empty); 导致崩溃

    version:1.9.8

        if (arc4random()%2) {
            self.widthSize.max(kNumberAdaptor(164)); // 最大宽度
        }else{
            self.widthSize.max(MyLayoutSize.empty); // 清空
        }
    

    log:

    *** Assertion failure in -[MyBaseLayout myGetBoundLimitMeasure:subview:anchorType:subviewSize:selfLayoutSize:isUBound:](), MyBaseLayout.m:2254
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Constraint exception!! <JHLiveNameView: 0x7ffd06c18900; frame = (105.667 386; 164 40); layer = <CALayer: 0x600000029080>> has invalid lBound or uBound setting'
    
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x0000000106ae61e6 __exceptionPreprocess + 294
    	1   libobjc.A.dylib                     0x000000010617b031 objc_exception_throw + 48
    	2   CoreFoundation                      0x0000000106aeb472 +[NSException raise:format:arguments:] + 98
    	3   Foundation                          0x0000000105c5464f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
    	4   UIFactory                           0x00000001057a800f -[MyBaseLayout myGetBoundLimitMeasure:subview:anchorType:subviewSize:selfLayoutSize:isUBound:] + 2015
    	5   UIFactory                           0x00000001057a83b2 -[MyBaseLayout myValidMeasure:subview:calcSize:subviewSize:selfLayoutSize:] + 706
    	6   UIFactory                           0x000000010578d138 -[MyLinearLayout myDoHorzOrientationLayoutWithContext:] + 10312
    	7   UIFactory                           0x0000000105784317 -[MyLinearLayout calcLayoutSize:subviewEngines:context:] + 855
    	8   UIFactory                           0x000000010579d3b3 -[MyBaseLayout doLayoutSubviews] + 2211
    	9   UIFactory                           0x00000001057a0cd8 -[MyBaseLayout layoutSubviews] + 312
    	10  UIKit                               0x00000001079e87a8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1515
    	11  QuartzCore                          0x0000000107752456 -[CALayer layoutSublayers] + 177
            12 .....
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    ***
    
    opened by xjh093 4
  • 关于相对布局居中的问题

    关于相对布局居中的问题

    我想在相对布局的父布局视图上布局A,B,C三个子视图,让A靠左,C靠右,B居中,而且限定B的最大宽度是C的左边减去A的右边,我设置了B的lBound和uBound,框架中默认是设置这两个之后,B是在最小边界和最大边界的中间显示,那么我设置B的myCenterX = 0就没有作用了,如果我想让B在父布局上居中,同时又约束最大边界和最小边界,该如何实现呢,其实约束B的最大宽度就可以,但是我A,C的宽度都是未知的,所以想通过约束边界实现

    opened by coderWeil 3
  • 你好,怎样可以获取 myFlowLayout  的内容高度?

    你好,怎样可以获取 myFlowLayout 的内容高度?

    #import "CGFlowLayout.h"

    @implementation CGFlowLayout

    -(CGSize)intrinsicContentSize { CGSize sz = [self sizeThatFits:CGSizeMake(SCREEN_WIDTH, 0)]; return sz; } 按照你这样做并不能获取高度,返回的height = 0。通过self.flowLayout.wrapContentHeight 和 self.flowLayout.myHeight 配合

    • [x] 得到的高度也为0,我是用你 myFlowLayout 做流式布局 ,放在一个动态高度的 cell 上,所以需要得到 这一块的内容高度。

    [self.flowLayout mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.bottomLine1.mas_bottom).offset(0); make.left.equalTo(self.contentView); make.width.mas_equalTo(SCREEN_WIDTH); //make.height.mas_equalTo(130); make.bottom.equalTo(self.contentView); }];

    image @@@@

    opened by pttyy 3
  • 刷新数据后 scrollView的contentsize不对

    刷新数据后 scrollView的contentsize不对

    ` if(contentLayout!=nil){ [contentLayout removeAllSubviews]; contentLayout=nil; } contentLayout = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Vert]; contentLayout.padding = UIEdgeInsetsMake(0, 0, 10, 0); //设置布局内的子视图离自己的边距. contentLayout.myHorzMargin = 0; //同时指定左右边距为0表示宽度和父视图一样宽 contentLayout.heightSize.lBound(scrollView.heightSize, 10, 1); //高度虽然是wrapContentHeight的。但是最小的高度不能低于父视图的高度加10.

    [scrollView addSubview:contentLayout];`
    

    由于添加的都是单个view 所以是先移除再添加,但是刷新完数据后 scrollView的contentsize就变成了只比界面高10 添加的内容也添加好了 就contentsize有问题

    opened by Whaiyan 3
  • MyRelativeLayout布局错误

    MyRelativeLayout布局错误

    控制器的VIew为普通View在ViewDidLoad中创建 MyRelativeLayout 并加入到self.view中,通过生产的MyRelativeLayout对象做布局会崩溃在下面的函数中 suv = nil sbvsc = nil

    myCalcSubViewTopBottom:(UIView*)sbv sbvsc:(UIView*)sbvsc lsc:(MyRelativeLayout*)lsc sbvmyFrame:(MyFrame*)sbvmyFrame selfSize:(CGSize)selfSize

    opened by applebest 3
  • 对动画设置为0秒,completion不执行的问题

    对动画设置为0秒,completion不执行的问题

    使用这个动画接口: - (void)layoutAnimationWithDuration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^__nullable)(BOOL finished))completion 如果duration 为0时候,我看completion不执行。

    opened by laniolove 2
  • [崩溃] -[MyBaseLayout myValidMargin:subview:calcPos:selfLayoutSize:]

    [崩溃] -[MyBaseLayout myValidMargin:subview:calcPos:selfLayoutSize:]

    场景: 在ViewController中的- (void)loadView方法布局,容器是UIScrollowView

    崩溃栈信息

    Kernel Triage:
    VM - Compressor failed a blocking pager_get
    
    
    Thread 0 name:
    Thread 0 Crashed:
    0   libobjc.A.dylib               	0x000000019b1025e0 objc_msgSend + 32
    1   LeoaoApp                      	0x0000000105af3dc8 -[MyBaseLayout myValidMargin:subview:calcPos:selfLayoutSize:] + 12631496 (MyBaseLayout.m:2331)
    2   LeoaoApp                      	0x0000000105b30750 -[MyLinearLayout myDoHorzOrientationLayoutWithContext:] + 12879696 (MyLinearLayout.m:982)
    3   LeoaoApp                      	0x0000000105b2b1b4 -[MyLinearLayout calcLayoutSize:subviewEngines:context:] + 12857780 (MyLinearLayout.m:163)
    4   LeoaoApp                      	0x0000000105af0144 -[MyBaseLayout myEstimateLayoutSize:inSizeClass:subviews:] + 12616004 (MyBaseLayout.m:0)
    5   LeoaoApp                      	0x0000000105af5ec0 -[MyBaseLayout myWidthSizeValueOfSubviewEngine:withContext:] + 12639936 (MyBaseLayout.m:2649)
    6   LeoaoApp                      	0x0000000105b2ee44 -[MyLinearLayout myDoHorzOrientationLayoutWithContext:] + 12873284 (MyLinearLayout.m:0)
    7   LeoaoApp                      	0x0000000105b2b1b4 -[MyLinearLayout calcLayoutSize:subviewEngines:context:] + 12857780 (MyLinearLayout.m:163)
    8   LeoaoApp                      	0x0000000105af0144 -[MyBaseLayout myEstimateLayoutSize:inSizeClass:subviews:] + 12616004 (MyBaseLayout.m:0)
    9   UIKitCore                     	0x000000018531dae4 -[_UITAMICAdaptorView updateForAvailableSize] + 124 (_UITAMICAdaptorView.m:111)
    10  UIKitCore                     	0x000000018562ba14 -[_UITAMICAdaptorView _geometryChanged:forAncestor:] + 84 (_UITAMICAdaptorView.m:130)
    11  UIKitCore                     	0x00000001851754c0 -[UIView _notifyGeometryObserversWithChangeInfo:] + 280 (UIView.m:8875)
    12  UIKitCore                     	0x000000018519668c -[UIView(Geometry) setFrame:] + 836 (UIView.m:10170)
    13  LeoaoApp                      	0x0000000105aec794 -[MyBaseLayout setFrame:] + 12601236 (MyBaseLayout.m:1096)
    14  LeoaoApp                      	0x0000000105aeecf4 -[MyBaseLayout doLayoutSubviews] + 12610804 (MyBaseLayout.m:1562)
    15  LeoaoApp                      	0x0000000105aefe64 -[MyBaseLayout layoutSubviews] + 12615268 (MyBaseLayout.m:1722)
    16  UIKitCore                     	0x000000018519ac6c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2620 (UIView.m:18320)
    17  QuartzCore                    	0x00000001868f4280 CA::Layer::layout_if_needed(CA::Transaction*) + 536 (CALayer.mm:10036)
    18  QuartzCore                    	0x00000001868e6aa8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144 (CALayer.mm:2478)
    19  QuartzCore                    	0x00000001868fb0b0 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 500 (CAContextInternal.mm:2584)
    20  QuartzCore                    	0x0000000186904174 CA::Transaction::commit() + 680 (CATransactionInternal.mm:449)
    21  QuartzCore                    	0x00000001868e621c CA::Transaction::flush_as_runloop_observer(bool) + 100 (CATransactionInternal.mm:941)
    22  UIKitCore                     	0x0000000185551c28 _UIApplicationFlushCATransaction + 76 (UIApplication.m:0)
    23  UIKitCore                     	0x00000001857ebad8 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:67)
    24  UIKitCore                     	0x0000000185e63294 schedulerStepScheduledMainSection + 144 (_UIUpdateCycleScheduler.m:1204)
    25  UIKitCore                     	0x0000000185e62760 runloopSourceCallback + 60 (_UIUpdateCycleScheduler.m:1292)
    26  CoreFoundation                	0x0000000182c1e030 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1972)
    27  CoreFoundation                	0x0000000182c2ecf0 __CFRunLoopDoSource0 + 208 (CFRunLoop.c:2016)
    28  CoreFoundation                	0x0000000182b68ff8 __CFRunLoopDoSources0 + 268 (CFRunLoop.c:2053)
    29  CoreFoundation                	0x0000000182b6e804 __CFRunLoopRun + 820 (CFRunLoop.c:2951)
    30  CoreFoundation                	0x0000000182b823c8 CFRunLoopRunSpecific + 600 (CFRunLoop.c:3268)
    31  GraphicsServices              	0x000000019e39338c GSEventRunModal + 164 (GSEvent.c:2200)
    32  UIKitCore                     	0x0000000185528060 -[UIApplication _run] + 1100 (UIApplication.m:3457)
    33  UIKitCore                     	0x00000001852a5b8c UIApplicationMain + 2124 (UIApplication.m:5013)
    34  LeoaoApp                      	0x0000000105235514 main + 3462420 (main.m:34)
    35  dyld                          	0x0000000108835a24 start + 520 (dyldMain.cpp:876)
    
    
    opened by LinkRober 2
  • 嵌套布局问题

    嵌套布局问题

    您好, 一个布局布好了;

      v3 = [[UIView alloc ]initWithFrame:CGRectMake(0, 450, 200   ,600)];
      v3.backgroundColor = [UIColor yellowColor];
        
      [self.view addSubview:v3];
        
        layout = MyFlexLayout.new.myFlex
        .width(MyLayoutSize.fill)
        .height(MyLayoutSize.wrap)
        .addTo(v3);
    
        l = UILabel.new.myFlex
        .width(MyLayoutSize.wrap)
        .height(MyLayoutSize.wrap)
        .align_self(MyFlexGravity_Center)
        .addTo(layout);
    
        l.backgroundColor = [UIColor whiteColor];
        l.text = @"AAAA";
        
        layout.backgroundColor = [UIColor grayColor];
    

    然后点击事件向这个布局里添加布局

     MyFlexLayout *subLayout = MyFlexLayout.new.myFlex
        .flex_wrap(MyFlexWrap_Wrap)
        .width(300)
        .height(MyLayoutSize.wrap)
        .align_self(MyFlexGravity_Flex_Start)
        .addTo(layout);
    
        subLayout.backgroundColor = [UIColor yellowColor];
        
        for (int i=0; i<15; i ++) {
             UIView *v = UIView.new.myFlex.margin_left(5).margin_top(5)
               .width(60).height(60).addTo(subLayout);
               v.backgroundColor = [UIColor blueColor];
        }
    

    像这种情况,任何布局都不会改变,添加上去的view会直接突出到底,但是如果给subLayout一个固定的高度,布局就正常了,请问怎么解决subLayout不能自动高度的问题?

    opened by fly486 2
  • flex 无法改变容器视图的高度

    flex 无法改变容器视图的高度

    当点击事件改变 layout的高度为 fill时候,layout的颜色位置不变,但是实际大小应该是变了,因为lable的位置改变了,当改变layout的高度为数字的时候,位置和颜色位置都不改变。

    上述所有情况,在重设view的frame时正常显示执行

        v = [[UIView alloc ]initWithFrame:CGRectMake(0, 450, 200   ,200)];
        v.backgroundColor = [UIColor yellowColor];
        
        [self.view addSubview:v];
        
        layout = MyFlexLayout.new.myFlex
        .width(MyLayoutSize.fill)
        .height(MyLayoutSize.wrap)
        .addTo(v);
        
        layout.backgroundColor = [UIColor grayColor];
        
        lab = UILabel.new.myFlex
        .width(MyLayoutSize.wrap)
        .height(MyLayoutSize.wrap)
        .align_self(MyFlexGravity_Center)
        .addTo(layout);
        lab.backgroundColor = [UIColor whiteColor];
        lab.text = @"AAAAA";
        
        layout.backgroundColor = [UIColor grayColor];
        [layout setTarget:self action:@selector(layoutTouch)];
    
    
    -(void)layoutTouch
    {
        [layout resetMyLayoutSetting];
        layout.myFlex.justify_content(MyFlexGravity_Center).height(100);
       // layout.myFlex.justify_content(MyFlexGravity_Center).height(MyLayoutSize.fill);
        //v.frame = CGRectMake(0, 450, 400, 400);
        [layout layoutAnimationWithDuration:1.3];
    }
    
    opened by fly486 2
  • 框架升级后界面无法显示

    框架升级后界面无法显示

    您好作者,目前刚接手一个项目,项目还是使用MyLayout:1.6.1,通过pod install 升级到1.9.8,发现界面无法显示,因为页面牵扯到很多业务逻辑,是否有一些快捷方式知道定位到出错地方(注:1.6.1版本可以显示界面,1.9.8版无法显示,目前无报错和崩溃信息,已替换了被弃用的属性,如:xxx.wrapContentHeight = true,改成了 xxx.myHeight = MyLayoutSize.wrap,topPadding 改成 paddingTop 等)。现在有点找不到解决方法,或者希望作者给一点建议。

    opened by EdenChow 2
  • 希望MyRelativeLayout添加对子视图未设置布局时的 frame 的支持

    希望MyRelativeLayout添加对子视图未设置布局时的 frame 的支持

    UIButton *view = [UIButton.alloc initWithFrame:(CGRectMake(20, 100, 60, 40))]; view.backgroundColor = UIColor.orangeColor; [MyRelativeLayout.view addSubview:view];

    目前view的显示 frame 为 (0, 0, 60, 40)

    期望view 的显示 frame 为 (20, 100, 60, 40)

    5EDBB9537212CC93C4AFA9E85FBCE6F9

    4439E273F9BFDF37F3481E01480DD1FC

    opened by kchtin 0
  • 使用Masonry布局问题

    使用Masonry布局问题

    子视图为自定义样式,使用Masonry布局,无法展示;demo代码如下:

    UIView *view = [[UIView alloc] init];
    view.backgroundColor = [UIColor grayColor];
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.backgroundColor = [UIColor redColor];
    imageView.clipsToBounds = YES;
    imageView.layer.cornerRadius = 8;
    [view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(view).offset(5);
        make.top.greaterThanOrEqualTo(view).offset(2);
        make.centerY.equalTo(view);
        make.width.height.equalTo(@16);
    }];
    
    UILabel *label = [[UILabel alloc] init];
    label.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.5];
    label.text = [NSString stringWithFormat:@"  label%d  ", i];
    label.clipsToBounds = YES;
    label.layer.cornerRadius = 8;
    label.layer.borderColor = [UIColor lightGrayColor].CGColor;
    label.layer.borderWidth = 0.5;
    [view addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imageView.mas_right).offset(5);
        make.right.lessThanOrEqualTo(view).offset(-5);
        make.top.greaterThanOrEqualTo(view).offset(8);
        make.centerY.equalTo(view);
        make.height.greaterThanOrEqualTo(@16);
    }];
    [self.flowLayout addSubview:view];
    
    
    -(MyFlowLayout *)flowLayout {
        if(_flowLayout == nil) {
            _flowLayout = [MyFlowLayout flowLayoutWithOrientation:MyOrientation_Vert arrangedCount:0];
            _flowLayout.subviewHSpace = 16; // 子视图之间的水平间距
            _flowLayout.subviewVSpace = 8; // 子视图之间的垂直间距
            _flowLayout.padding = UIEdgeInsetsMake(5, 5, 5, 5); // 视图四周的内边距值
        }
        return _flowLayout;
    }
    
    
    opened by PaulPaulBoBo 8
Releases(1.9.8)
  • 1.9.8(Aug 4, 2020)

  • 1.6.0(Aug 5, 2018)

  • 1.5.3(May 11, 2018)

  • 1.5.2(May 6, 2018)

  • 1.5.1(Apr 23, 2018)

  • 1.5.0(Oct 8, 2017)

  • 1.4.3(Sep 21, 2017)

  • 1.4.2(Aug 30, 2017)

  • 1.4.1(Jun 22, 2017)

  • 1.4.0(Jun 16, 2017)

  • 1.3.9(Jun 12, 2017)

  • 1.3.8(Jun 2, 2017)

  • 1.3.7(May 31, 2017)

  • 1.3.6(May 4, 2017)

  • 1.3.5(Apr 16, 2017)

  • 1.3.4(Mar 4, 2017)

  • 1.3.3(Feb 24, 2017)

  • 1.3.2(Jan 21, 2017)

  • 1.3.1(Dec 28, 2016)

  • 1.3.0(Dec 20, 2016)

  • 1.2.9(Dec 3, 2016)

  • 1.2.8(Dec 3, 2016)

  • 1.2.7(Nov 13, 2016)

    1. 为线性布局MyLinearLayout新增加了属性shrinkType。这个属性可以用来控制当子视图中有比重尺寸或者相对间距,而又有固定尺寸比布局视图的尺寸还大时,如果缩小这些固定尺寸视图的尺寸值的方法。(具体例子见AllTest7ViewController)
    2. 为布局视图添加了rotationToDeviceOrientationBlock属性。这个block给予用户在布局视图第一次完成或者有屏幕旋转时进行界面布局处理的机会。我们可以通过这个block块来处理设备屏幕旋转而需要改动布局的场景。这个block块不像beginLayoutBlock以及endLayoutBlock那样只调用一次,而是第一次布局完成以及每次屏幕旋转并布局完成后都会调用,因此要注意循环引用的问题。(具体见例子见:LLTest6ViewController)
    3. 线性布局MyLinearLayout中去掉了当子视图中有设置比重,或者子视图中设置相对间距时而又设置了布局视图的wrapContentWidth或者wrapContentHeight属性时,wrapContentWidth或者wrapContentHeight设置失效的限制。具体例子请看(AllTest7ViewController)
    4. 线性布局MyLinearLayout中的水平线性布局中修复了一个当子视图中有比重尺寸或者相对间距,而又有固定尺寸比布局视图的尺寸还大时,缩小那些具有固定尺寸的子视图的宽度的一个BUG。见(AllTest3ViewController)中的左右文字拉升的情况。
    5. 添加了MyLayoutDime中的uBound和lBound方法中最大最小值设置时可以等于自己的情况,这样目的是为了保证视图本身的尺寸不被压缩。具体见(AllTest7ViewController)
    6. 添加了在调试时使用po 视图对象.absPos.sizeClass 或者expr -o -- 视图.absPos.sizeClass 方法时可以输出布局设置的各种布局属性值。
    7. 添加了将布局视图作为非布局视图的子视图的四周边距值可以是相对边距的支持,也就是当布局视图作为非布局视图的子视图时设置的topPos,rightPos,topPos,bottomPos的值是大于0且小于1时表明的是相对边距。
    8. 修复了视图尺寸MyLayoutDime的uBound,lBound方法的最大最小尺寸设置为父布局视图时,而布局视图又有padding时,没有减去padding值的BUG。
    9. 添加了AllTest7ViewController这个新的DEMO,用来解决一些实践中各种屏幕尺寸下布局的完美处理方案。
    Source code(tar.gz)
    Source code(zip)
  • 1.2.4(Aug 18, 2016)

    1.浮动布局MyFloatLayout增加了新属性noBoundaryLimit,用来实现那些只要单向浮动且没有边界限制的场景。具体例子见FOLTest6ViewController。 2.优化了布局方法estimateLayoutRect,优化了那些布局套布局的尺寸的评估的计算方法,加快了对动态高度评估计算的速度。 3.添加了2个DEMO,一个是RLTest4ViewController用来介绍布局在滚动条上滚动式停靠的实现。一个是FOLTest6ViewController用来介绍用浮动布局实现一些用户配置方面的DEMO。

    Source code(tar.gz)
    Source code(zip)
  • 1.2.3(Aug 2, 2016)

    1.添加了新的布局:路径布局MyPathLayout。通过路径布局您只需要提供一个生成路径曲线的方程、以及指定子视图在路径曲线之中的距离等信息就可以让子视图按照指定的路径曲线进行布局,因此路径布局可以实现一些非常酷炫的效果。具体例子见:PLTest1,2,3,4ViewController 2.添加了子视图的新方法:@property(nonatomic,copy) void (^viewLayoutCompleteBlock)(MyBaseLayout* layout, UIView *v); 这个方法是在每个子视图布局完成后会调用一次,然后自动销毁。您可以实现这个block来进行一些子视图布局完成后的设置,一般实现这个块用来完成一些特定的动画效果,以及取值操作。具体例子见RLTest1ViewController,PLTest1ViewController 3.添加了对布局视图里面的子视图通过transform进行坐标变换的支持功能,在您对子视图进行坐标变换操作时,您可以可以通过设置扩展属性来确定子视图的尺寸和位置。具体能力见PLTest系列DEMO。 4.完善了智能边界线的能力,如果您在布局视图中设置了subviewMargin属性的话,布局系统将会自动的将智能边界线一分为2.具体例子见TLTest3ViewController 5.布局基类的属性:adjustScrollViewContentSize被设置为过期,改为通过adjustScrollViewContentSizeMode属性来设置当布局视图加入到UIScrollView时调整其contentSize的方式。 6.修正了一个线性布局中当布局视图的尺寸没有子视图尺寸大,而子视图又设置了weight属性时可能导致的计算不正确的问题。

    Source code(tar.gz)
    Source code(zip)
Owner
欧阳大哥2013
坚持原创 以造轮子为乐。 Adhere to the original To build the wheels。
欧阳大哥2013
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends UIView/NSView, NSArray, and NSLayoutConstrai

PureLayout 7.6k Jan 6, 2023
Auto Layout (and manual layout) in one line.

Auto Layout (and manual layout) in one line. Quick Look view.bb.centerX().below(view2).size(100) It’s equivalent to iOS 9 API: view.centerXAnchor.cons

Javier Zhang 74 Oct 19, 2022
AppStoreClone - Understanding the complex layout of app store using UICompositional layout in swift

AppStoreClone Understanding the complex layout of app store using UICompositiona

Dheeraj Kumar Sharma 8 Dec 28, 2022
A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewFlowLayout.

WrapLayout A custom layout built on top of SwiftUI's Layout API that lays elements out in multiple lines. Similar to flex-wrap in CSS, CollectionViewF

Hiroshi Kimura 6 Sep 27, 2022
FlightLayout is a light weight, and easy to learn layout framework as an extension of the UIView.

FlightLayout Introduction FlightLayout is a light weight, and easy to learn layout framework as an extension of the UIView. Functionally, it lives som

Anton 23 Apr 21, 2022
Written in pure Swift, QuickLayout offers a simple and easy way to manage Auto Layout in code.

QuickLayout QuickLayout offers an additional way, to easily manage the Auto Layout using only code. You can harness the power of QuickLayout to align

Daniel Huri 243 Oct 28, 2022
An easy way to create and layout UI components for iOS (Swift version).

Introduction Cupcake is a framework that allow you to easily create and layout UI components for iOS 8.0+. It use chaining syntax and provides some fr

nerdycat 288 Oct 9, 2022
LayoutKit is a fast view layout library for iOS, macOS, and tvOS.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. LayoutKit is a fast view layout library for iOS, macOS, a

LinkedIn's Attic 3.2k Dec 27, 2022
LayoutKit is a fast view layout library for iOS, macOS, and tvOS.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. LayoutKit is a fast view layout library for iOS, macOS, a

LinkedIn's Attic 3.2k Jan 4, 2023
Auto Layout made easy

EasyPeasy is a Swift framework that lets you create Auto Layout constraints programmatically without headaches and never ending boilerplate code. Besi

Carlos Vidal 1.9k Dec 23, 2022
Auto Layout In Swift Made Easy

Swiftstraints Swiftstraints can turn verbose auto-layout code: let constraint = NSLayoutConstraint(item: blueView, attr

null 119 Jan 29, 2022
An flexbox layout aimed at easy to use, which depend on Yoga.

DDFlexbox A flexbox framework for easy using. Install pod 'DDFlexbox' Template install Recommend using templates to create flexbox views. cd Script/

Daniel 12 Mar 23, 2022
UIView category which makes it easy to create layout constraints in code

FLKAutoLayout FLKAutoLayout is a collection of categories on UIView which makes it easy to setup layout constraints in code. FLKAutoLayout creates sim

Florian Kugler 1.5k Nov 24, 2022
Easy Auto Layout

RKAutoLayout Easy AutoLayout TL;DR let view1: UIView = UIView() let view2: UIView = UIView() view1.addSubview(view2) /// Add all view1.rk_alAdd(

Roman Kotov 1 Mar 24, 2019
Flow layout / tag cloud / collection view in SwiftUI.

SwiftUIFlowLayout A Flow Layout is a container that orders its views sequentially, breaking into a new "line" according to the available width of the

Gordan Glavaš 115 Dec 28, 2022
Programmatic view layout for the rest of us.

Façade Important Facade is no longer under active development, and as such if you create any issues or submit pull requests, it's not very likely to b

Mike 696 Aug 3, 2022
A Code challenge I solved leveraging a lot on Composite collection view layout written in swift

AsthmApp Mobile app designed as a support aid for people with Asthma Accounts Google and Firebase [email protected] dICerytiMPSI Facebook asthmp.ap

null 0 Dec 13, 2021
A Code challenge I solved leveraging a lot on Composite collection view layout...written in swift

Space44 Code Challenge Space44 Code Challenge iOS application for Space 44 hiring process, it leverages on Image download and composite collection vie

null 0 Dec 16, 2021
A flexible collection view with proper horizontal layout flow

FlexCollection A very simple flexible collection view using SwiftUI that automat

null 1 Dec 29, 2021