This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Derived from: https://gist.github.com/RichardBronosky/2878446 | |
| realpath(){ | |
| echo "$(cd "$(dirname "$1")"; echo -n "$(pwd)/$(basename "$1")")"; | |
| } | |
| IPA_SRC="$(realpath $1)" | |
| PROVISIONING_PROFILE="$(realpath $2)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WeView *container = [[WeView alloc] init]; | |
| [[[container addSubviewsWithHorizontalLayout:@[ | |
| label, | |
| imageView, | |
| button,] | |
| setMargin:5] | |
| setSpacing:5]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WeView *rootView = [[WeView alloc] init]; | |
| // Add background image. | |
| UIImage *image = [UIImage imageNamed:@"Images/thun-stockhornkette-1904 1600.jpg"]; | |
| UIImageView *background = [[UIImageView alloc] initWithImage:image]; | |
| WeView *backgroundWrapper = [[WeView alloc] init]; | |
| [[backgroundWrapper addSubviewWithFillLayoutWAspectRatio:background] | |
| setVAlign:V_ALIGN_TOP]; | |
| // The background will exceed the backgroundWrapper's bounds, so we need to clip. | |
| backgroundWrapper.clipsToBounds = YES; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIButton *button = ...; | |
| UIView *superview = ...; | |
| NSLayoutConstraint *cn = [NSLayoutConstraint constraintWithItem:button | |
| attribute:NSLayoutAttributeCenterX | |
| relatedBy:NSLayoutRelationEqual | |
| toItem:superview | |
| attribute:NSLayoutAttributeCenterX | |
| multiplier:1.0 | |
| constant:0.0]; | |
| [superview addConstraint:cn]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UIButton *button = ...; | |
| UIView *superview = ...; | |
| NSDictionary *variableMap = NSDictionaryOfVariableBindings(label, superview); | |
| NSLayoutConstraint *cn = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[button]-12-[superview]" | |
| options:0 | |
| metrics:nil | |
| views:variableMap]; | |
| [superview addConstraint:cn]; | |
| cn = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[superview]-(<=1)-[button]" | |
| options:NSLayoutFormatAlignAllCenterY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "WeView.h" | |
| UIButton *button = ...; | |
| WeView *panelView = [[WeView alloc] init]; | |
| [[[[panelView addSubviewWithCustomLayout:button] | |
| setHAlign:H_ALIGN_CENTER] | |
| setVAlign:V_ALIGN_BOTTOM] | |
| setMargin:20]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Apache License | |
| Version 2.0, January 2004 | |
| http://www.apache.org/licenses/ | |
| TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
| 1. Definitions. | |
| "License" shall mean the terms and conditions for use, reproduction, and | |
| distribution as defined by Sections 1 through 9 of this document. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WeView *container = [[WeView alloc] init]; | |
| [[[[[container addSubviewsWithHorizontalLayout:@[ | |
| label, | |
| imageView, | |
| button,] | |
| setMargin:5] | |
| setSpacing:5] | |
| setHAlign:H_ALIGN_LEFT] | |
| setVAlign:V_ALIGN_TOP]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WeView *container = [[WeView alloc] init]; | |
| [[[container addSubviewsWithHorizontalLayout:@[ | |
| label, | |
| imageView, | |
| button,] | |
| setMargin:5] | |
| setSpacing:5]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WeView *container = [[WeView alloc] init]; | |
| [[[container addSubviewsWithHorizontalLayout:@[ | |
| [label setHStretches], // Indicates that this view should be stretched horizontally. | |
| [imageView setHStretchWeight:2.f], // Indicates that this view be stretched horizontally with a specific weight. | |
| button,]] | |
| setMargin:5] | |
| setSpacing:5]; |