From f67376a4c3cc054e405abfd65fd7c3ccdae552d7 Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Thu, 13 Apr 2017 11:49:30 -0700 Subject: [PATCH] Update docs --- docs/_docs/containers-ascollectionnode.md | 26 ++++++++--------- docs/_docs/containers-aspagernode.md | 14 +++++----- docs/_docs/containers-asviewcontroller.md | 18 ++++++------ docs/_docs/editable-text-node.md | 4 +-- docs/_docs/image-node.md | 2 +- docs/_docs/layout2-api-sizing.md | 34 +++++++++++++++++++---- docs/_docs/layout2-layoutspec-types.md | 2 +- docs/_docs/map-node.md | 6 ++-- docs/_docs/multiplex-image-node.md | 14 +++++----- docs/_docs/network-image-node.md | 10 +++---- docs/_docs/video-node.md | 4 +-- 11 files changed, 78 insertions(+), 56 deletions(-) diff --git a/docs/_docs/containers-ascollectionnode.md b/docs/_docs/containers-ascollectionnode.md index d19074a3a2..e59771e61a 100755 --- a/docs/_docs/containers-ascollectionnode.md +++ b/docs/_docs/containers-ascollectionnode.md @@ -22,7 +22,7 @@ nextPage: containers-aspagernode.html @@ -37,7 +37,7 @@ with your choice of **_one_** of the following methods - (ASCellNode *)collectionNode:(ASCollectionNode *)collectionNode nodeForItemAtIndexPath:(NSIndexPath *)indexPath @@ -54,7 +54,7 @@ or - (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath @@ -96,7 +96,7 @@ Consider the following `-collectionNode:nodeBlockForItemAtIndexPath:` method. @@ -35,7 +35,7 @@ and @@ -50,7 +50,7 @@ or @@ -86,8 +86,8 @@ In the example below, you can see how the index is used to access the photo mode diff --git a/docs/_docs/editable-text-node.md b/docs/_docs/editable-text-node.md index 034291953d..a1fccd44a4 100755 --- a/docs/_docs/editable-text-node.md +++ b/docs/_docs/editable-text-node.md @@ -69,8 +69,8 @@ editableTextNode.typingAttributes = @{NSForegroundColorAttributeName: [UIColor b diff --git a/docs/_docs/image-node.md b/docs/_docs/image-node.md index 4067aba045..872393b70c 100755 --- a/docs/_docs/image-node.md +++ b/docs/_docs/image-node.md @@ -27,7 +27,7 @@ imageNode.contentMode = UIViewContentModeScaleAspectFill; let imageNode = ASImageNode() imageNode.image = UIImage(named: "someImage") -imageNode.contentMode = .ScaleAspectFill +imageNode.contentMode = .scaleAspectFill diff --git a/docs/_docs/layout2-api-sizing.md b/docs/_docs/layout2-api-sizing.md index 1a52caf419..1332dfe962 100755 --- a/docs/_docs/layout2-api-sizing.md +++ b/docs/_docs/layout2-api-sizing.md @@ -27,14 +27,20 @@ ASDimensionMake(@"50%"); ASDimensionMakeWithFraction(0.5); // dimension returned in points -ASDimensionMake(@"70pt") +ASDimensionMake(@"70pt"); ASDimensionMake(70); ASDimensionMakeWithPoints(70); - - ### Example using `ASDimension` @@ -59,9 +65,11 @@ self.rightStack.style.flexBasis = ASDimensionMake(@"60%"); [horizontalStack setChildren:@[self.leftStack, self.rightStack]]; - - ## Sizes (`CGSize`, `ASLayoutSize`) @@ -77,6 +85,7 @@ self.rightStack.style.flexBasis = ASDimensionMake(@"60%"); ASLayoutSizeMake(ASDimension width, ASDimension height); @@ -99,6 +108,12 @@ ASDimension height = ASDimensionMake(@"50%"); layoutElement.style.preferredLayoutSize = ASLayoutSizeMake(width, height); @@ -116,6 +131,7 @@ If you do not need relative values, you can set the layout element's `.preferred layoutElement.style.preferredSize = CGSizeMake(30, 160); @@ -139,6 +155,13 @@ layoutElement.style.minHeight = ASDimensionMake(@"50%"); layoutElement.style.maxHeight = ASDimensionMake(@"50%"); @@ -159,6 +182,7 @@ layoutElement.style.maxHeight = ASDimensionMake(@"50%"); - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize; diff --git a/docs/_docs/layout2-layoutspec-types.md b/docs/_docs/layout2-layoutspec-types.md index 5c753bd491..0c9be6b2d3 100755 --- a/docs/_docs/layout2-layoutspec-types.md +++ b/docs/_docs/layout2-layoutspec-types.md @@ -275,7 +275,7 @@ If the center spec's width or height is unconstrained, it shrinks to the size of { ASStaticSizeDisplayNode *subnode = ASDisplayNodeWithBackgroundColor([UIColor greenColor], CGSizeMake(70, 100)); return [ASCenterLayoutSpec centerLayoutSpecWithCenteringOptions:ASCenterLayoutSpecCenteringXY - sizingOptions:ASRelativeLayoutSpecSizingOptionDefault + sizingOptions:ASCenterLayoutSpecSizingOptionDefault child:subnode] } diff --git a/docs/_docs/map-node.md b/docs/_docs/map-node.md index 6ea77387ae..6245306193 100755 --- a/docs/_docs/map-node.md +++ b/docs/_docs/map-node.md @@ -18,7 +18,7 @@ Let's say you'd like to show a snapshot of San Francisco. All you need are the
 ASMapNode *mapNode = [[ASMapNode alloc] init];
-mapNode.preferredFrameSize = CGSizeMake(300.0, 300.0);
+mapNode.style.preferredSize = CGSizeMake(300.0, 300.0);
 
 // San Francisco
 CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(37.7749, -122.4194);
@@ -29,7 +29,7 @@ mapNode.region = MKCoordinateRegionMakeWithDistance(coord, 20000, 20000);
 
 
 
 
     
@@ -96,11 +96,11 @@ For example, in the case that you want to react to the fact that a new image arr
 
diff --git a/docs/_docs/network-image-node.md b/docs/_docs/network-image-node.md index 46427d6440..2753afe3ed 100755 --- a/docs/_docs/network-image-node.md +++ b/docs/_docs/network-image-node.md @@ -19,7 +19,7 @@ imageNode.URL = [NSURL URLWithString:@"https://someurl.com/image_uri"];
@@ -39,15 +39,15 @@ If you have a standard size you want the image node's frame size to be you can u
 - (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint
 {
-	imageNode.preferredFrameSize = CGSizeMake(100, 200);
+	imageNode.style.preferredSize = CGSizeMake(100, 200);
 	...
 	return finalLayoutSpec;
 }