From e6accc7ea64d5f97d7bfa5a2fb06268f43252240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20Est=C3=A9banez=20Tasc=C3=B3n?= Date: Tue, 16 May 2017 20:05:55 +0200 Subject: [PATCH] [Examples] Fix LayoutSpecExamples and LayoutSpecExamples-Swift: image URLs were still pointing to asyncdisplaykit.org (#275) * Fix Image URLs in LayoutSpecExamples and LayoutSpecExamples-Swift (they were still pointing to asyncdisplaykit.org) * Update documentation of ASMapNode example to accurately reflect implemented layout * Fix headers * More headers fixing --- examples/ASMapNode/Sample/MapHandlerNode.h | 18 +++---- examples/ASMapNode/Sample/MapHandlerNode.m | 52 ++++++++++--------- .../Sample/LayoutExampleNode.swift | 6 +-- .../Sample/LayoutExampleNodes.h | 13 +++-- .../Sample/LayoutExampleNodes.m | 19 ++++--- 5 files changed, 62 insertions(+), 46 deletions(-) diff --git a/examples/ASMapNode/Sample/MapHandlerNode.h b/examples/ASMapNode/Sample/MapHandlerNode.h index f51924419f..29c77c7131 100644 --- a/examples/ASMapNode/Sample/MapHandlerNode.h +++ b/examples/ASMapNode/Sample/MapHandlerNode.h @@ -1,18 +1,18 @@ // // MapHandlerNode.h -// Sample +// Texture // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the -// LICENSE file in the root directory of this source tree. An additional grant -// of patent rights can be found in the PATENTS file in the same directory. +// LICENSE file in the /ASDK-Licenses directory of this source tree. An additional +// grant of patent rights can be found in the PATENTS file in the same directory. // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present, +// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASMapNode/Sample/MapHandlerNode.m b/examples/ASMapNode/Sample/MapHandlerNode.m index 3d7173783b..0f6f4a0e27 100644 --- a/examples/ASMapNode/Sample/MapHandlerNode.m +++ b/examples/ASMapNode/Sample/MapHandlerNode.m @@ -1,18 +1,18 @@ // // MapHandlerNode.m -// Sample +// Texture // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the -// LICENSE file in the root directory of this source tree. An additional grant -// of patent rights can be found in the PATENTS file in the same directory. +// LICENSE file in the /ASDK-Licenses directory of this source tree. An additional +// grant of patent rights can be found in the PATENTS file in the same directory. // -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present, +// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 // #import "MapHandlerNode.h" @@ -112,22 +112,24 @@ } /** - * ---------------------------------ASStackLayoutSpec-------------------------------- - * | ------------------------------ASInsetLayoutSpec----------------------------- | - * | | ---------------------------ASStackLayoutSpec-------------------------- | | - * | | | -----------------ASStackLayoutSpec---------------- | | | - * | | | | --------------ASStackLayoutSpec------------- | | | | - * | | | | | ASEditableTextNode ASEditableTextNode | | | | | - * | | | | -------------------------------------------- | | | | - * | | | | --------------ASStackLayoutSpec------------- | ASButtonNode | | | - * | | | | | ASEditableTextNode ASEditableTextNode | | | | | - * | | | | -------------------------------------------- | | | | - * | | | -------------------------------------------------- | | | - * | | ---------------------------------------------------------------------- | | - * | ---------------------------------------------------------------------------- | - * | ASButtonNode | - * | ASMapNode | - * ---------------------------------------------------------------------------------- + * ------------------------------------ASStackLayoutSpec----------------------------------- + * | ---------------------------------ASInsetLayoutSpec-------------------------------- | + * | | ------------------------------ASStackLayoutSpec----------------------------- | | + * | | | ---------------------------ASStackLayoutSpec-------------------------- | | | + * | | | | -----------------ASStackLayoutSpec---------------- | | | | + * | | | | | --------------ASStackLayoutSpec------------- | | | | | + * | | | | | | ASEditableTextNode ASEditableTextNode | | | | | | + * | | | | | -------------------------------------------- | | | | | + * | | | | | --------------ASStackLayoutSpec------------- | ASButtonNode | | | | + * | | | | | | ASEditableTextNode ASEditableTextNode | | | | | | + * | | | | | -------------------------------------------- | | | | | + * | | | | -------------------------------------------------- | | | | + * | | | ---------------------------------------------------------------------- | | | + * | | | ASButtonNode | | | + * | | ---------------------------------------------------------------------------- | | + * | ---------------------------------------------------------------------------------- | + * | ASMapNode | + * ---------------------------------------------------------------------------------------- * * This diagram was created by setting a breakpoint on the returned `layoutSpec` * and calling "po [layoutSpec asciiArtString]" in the debugger. diff --git a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift index a3c9dc02f5..75531d9026 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift @@ -73,7 +73,7 @@ class PhotoWithInsetTextOverlay : LayoutExampleNode { backgroundColor = .clear - photoNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png") + photoNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png") photoNode.willDisplayNodeContentWithRenderingContext = { context, drawParameters in let bounds = context.boundingBoxOfClipPath UIBezierPath(roundedRect: bounds, cornerRadius: 10).addClip() @@ -101,9 +101,9 @@ class PhotoWithOutsetIconOverlay : LayoutExampleNode { required init() { super.init() - photoNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png") + photoNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png") - iconNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png") + iconNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png") iconNode.imageModificationBlock = { image in let profileImageSize = CGSize(width: 60, height: 60) diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h index 65da5f5475..7355285d3c 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h @@ -1,11 +1,18 @@ // // LayoutExampleNodes.h -// Sample +// Texture // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the -// LICENSE file in the root directory of this source tree. An additional grant -// of patent rights can be found in the PATENTS file in the same directory. +// LICENSE file in the /ASDK-Licenses directory of this source tree. An additional +// grant of patent rights can be found in the PATENTS file in the same directory. +// +// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present, +// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m index 00d4b3421f..e7f9fbe6f0 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m @@ -1,11 +1,18 @@ // // LayoutExampleNodes.m -// Sample +// Texture // // Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the -// LICENSE file in the root directory of this source tree. An additional grant -// of patent rights can be found in the PATENTS file in the same directory. +// LICENSE file in the /ASDK-Licenses directory of this source tree. An additional +// grant of patent rights can be found in the PATENTS file in the same directory. +// +// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present, +// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 // #import "LayoutExampleNodes.h" @@ -124,7 +131,7 @@ self.backgroundColor = [UIColor clearColor]; _photoNode = [[ASNetworkImageNode alloc] init]; - _photoNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png"]; + _photoNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png"]; _photoNode.willDisplayNodeContentWithRenderingContext = ^(CGContextRef context, id drawParameters) { CGRect bounds = CGContextGetClipBoundingBox(context); [[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:10] addClip]; @@ -168,10 +175,10 @@ if (self) { _photoNode = [[ASNetworkImageNode alloc] init]; - _photoNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png"]; + _photoNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png"]; _iconNode = [[ASNetworkImageNode alloc] init]; - _iconNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png"]; + _iconNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png"]; [_iconNode setImageModificationBlock:^UIImage *(UIImage *image) { // FIXME: in framework autocomplete for setImageModificationBlock line seems broken CGSize profileImageSize = CGSizeMake(60, 60);