From f4f1454be1a13432fe0cecbf926aea78df5c10a0 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Mon, 18 Jun 2018 18:38:26 -0700 Subject: [PATCH 01/97] Pointer check #trivial (#970) --- Source/ASTextNode2.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 53eec80293..e6d0ad50a5 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -530,7 +530,9 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; // For now, assume that a tap inside this text, but outside the text range is a tap on the // truncation token. if (![layout textRangeAtPoint:point]) { - *inAdditionalTruncationMessageOut = YES; + if (inAdditionalTruncationMessageOut != NULL) { + *inAdditionalTruncationMessageOut = YES; + } return nil; } From 4669a24fdf96ecbfcff54f76d7c679f967433dda Mon Sep 17 00:00:00 2001 From: Andrei Titov Date: Tue, 19 Jun 2018 04:43:09 +0300 Subject: [PATCH 02/97] Fixed removing node from supernode after layout transition (#937) Fixed removing node from supernode after layout transition when automaticallyManagesSubnodes is disabled. In case if developer prefer to manage subnodes by himself then he wants to be sure that stack will not change automatically. --- Source/Private/ASLayoutTransition.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index 85cfcd2085..f1b15dd02a 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -137,7 +137,9 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { // In this case we should only remove the subnode if it's still a subnode of the _node that executes a layout transition. // It can happen that a node already did a layout transition and added this subnode, in this case the subnode // would be removed from the new node instead of _node - [subnode _removeFromSupernodeIfEqualTo:_node]; + if (_node.automaticallyManagesSubnodes) { + [subnode _removeFromSupernodeIfEqualTo:_node]; + } } } From a0e5f4c00289b2315bd190044ba8c630ba8251e4 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 19 Jun 2018 08:32:02 -0700 Subject: [PATCH 03/97] Create an experiment to remove extra collection teardown step (#975) * Create an experiment to remove extra collection teardown step, simplify delegate proxy * chagelog * Remove detritus --- CHANGELOG.md | 1 + Schemas/configuration.json | 3 ++- Source/ASCollectionView.mm | 6 ++++-- Source/ASExperimentalFeatures.h | 1 + Source/ASExperimentalFeatures.m | 3 ++- Source/ASTableView.mm | 7 +++++-- Source/Details/ASDelegateProxy.h | 2 +- Source/Details/ASDelegateProxy.m | 19 ++++++++----------- 8 files changed, 24 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce27c151c8..eb280cddc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Reduce usage of autorelease pools. [Adlai Holler](https://github.com/Adlai-Holler) [#968](https://github.com/TextureGroup/Texture/pull/968) - Clean up unused/unneeded header macros. [Adlai Holler](https://github.com/Adlai-Holler) - Clean up C-function `extern` decorators. [Adlai Holler](https://github.com/Adlai-Holler) +- Add an experiment to reduce work involved in collection teardown. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Schemas/configuration.json b/Schemas/configuration.json index ab1d592b4b..71b5917294 100644 --- a/Schemas/configuration.json +++ b/Schemas/configuration.json @@ -19,7 +19,8 @@ "exp_unfair_lock", "exp_infer_layer_defaults", "exp_network_image_queue", - "exp_dealloc_queue_v2" + "exp_dealloc_queue_v2", + "exp_collection_teardown", ] } } diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index ea19cbca5f..d19e59898d 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -324,8 +324,10 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; // Sometimes the UIKit classes can call back to their delegate even during deallocation, due to animation completion blocks etc. _isDeallocating = YES; - [self setAsyncDelegate:nil]; - [self setAsyncDataSource:nil]; + if (!ASActivateExperimentalFeature(ASExperimentalCollectionTeardown)) { + [self setAsyncDelegate:nil]; + [self setAsyncDataSource:nil]; + } // Data controller & range controller may own a ton of nodes, let's deallocate those off-main. ASPerformBackgroundDeallocation(&_dataController); diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 570ed95fd1..cc02d8a683 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -26,6 +26,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalLayerDefaults = 1 << 4, // exp_infer_layer_defaults ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue ASExperimentalDeallocQueue = 1 << 6, // exp_dealloc_queue_v2 + ASExperimentalCollectionTeardown = 1 << 7, // exp_collection_teardown ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index 90772f4311..e424219059 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -20,7 +20,8 @@ NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags @"exp_unfair_lock", @"exp_infer_layer_defaults", @"exp_network_image_queue", - @"exp_dealloc_queue_v2"])); + @"exp_dealloc_queue_v2", + @"exp_collection_teardown"])); if (flags == ASExperimentalFeatureAll) { return allNames; diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index cbb7dac90a..241816d0f5 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -24,6 +24,7 @@ #import #import #import +#import #import #import #import @@ -371,8 +372,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; // Sometimes the UIKit classes can call back to their delegate even during deallocation. _isDeallocating = YES; - [self setAsyncDelegate:nil]; - [self setAsyncDataSource:nil]; + if (!ASActivateExperimentalFeature(ASExperimentalCollectionTeardown)) { + [self setAsyncDelegate:nil]; + [self setAsyncDataSource:nil]; + } // Data controller & range controller may own a ton of nodes, let's deallocate those off-main ASPerformBackgroundDeallocation(&_dataController); diff --git a/Source/Details/ASDelegateProxy.h b/Source/Details/ASDelegateProxy.h index 862598a647..3161512865 100644 --- a/Source/Details/ASDelegateProxy.h +++ b/Source/Details/ASDelegateProxy.h @@ -34,7 +34,7 @@ @interface ASDelegateProxy : NSProxy -- (instancetype)initWithTarget:(id )target interceptor:(id )interceptor; +- (instancetype)initWithTarget:(id)target interceptor:(id )interceptor; // This method must be overridden by a subclass. - (BOOL)interceptsSelector:(SEL)selector; diff --git a/Source/Details/ASDelegateProxy.m b/Source/Details/ASDelegateProxy.m index b8314153a6..e7f180fc1f 100644 --- a/Source/Details/ASDelegateProxy.m +++ b/Source/Details/ASDelegateProxy.m @@ -141,16 +141,11 @@ @implementation ASDelegateProxy { id __weak _interceptor; - id __weak _target; + id __weak _target; } -- (instancetype)initWithTarget:(id )target interceptor:(id )interceptor +- (instancetype)initWithTarget:(id)target interceptor:(id )interceptor { - // -[NSProxy init] is undefined - if (!self) { - return nil; - } - ASDisplayNodeAssert(interceptor, @"interceptor must not be nil"); _target = target ? : [NSNull null]; @@ -161,8 +156,9 @@ - (BOOL)conformsToProtocol:(Protocol *)aProtocol { - if (_target) { - return [_target conformsToProtocol:aProtocol]; + id target = _target; + if (target) { + return [target conformsToProtocol:aProtocol]; } else { return [super conformsToProtocol:aProtocol]; } @@ -183,8 +179,9 @@ if ([self interceptsSelector:aSelector]) { return _interceptor; } else { - if (_target) { - return [_target respondsToSelector:aSelector] ? _target : nil; + id target = _target; + if (target) { + return [target respondsToSelector:aSelector] ? target : nil; } else { // The _interceptor needs to be nilled out in this scenario. For that a strong reference needs to be created // to be able to nil out the _interceptor but still let it know that the proxy target has deallocated From fa0ef6fdd23eb59c4f852f006de0ce085c53f4ae Mon Sep 17 00:00:00 2001 From: Max Wang Date: Tue, 19 Jun 2018 09:20:34 -0700 Subject: [PATCH 04/97] ASConfiguration version check only when have json dict (#971) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * avoid extra version log. * check dictionary earlier --- Source/ASConfiguration.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/ASConfiguration.m b/Source/ASConfiguration.m index 93c8c8fb04..1c1dbec012 100644 --- a/Source/ASConfiguration.m +++ b/Source/ASConfiguration.m @@ -23,12 +23,16 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionary { if (self = [super init]) { - autotype featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray); - autotype version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue; - if (version != ASConfigurationSchemaCurrentVersion) { - NSLog(@"Texture warning: configuration schema is old version (%zd vs %zd)", version, ASConfigurationSchemaCurrentVersion); + if (dictionary != nil) { + autotype featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray); + autotype version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue; + if (version != ASConfigurationSchemaCurrentVersion) { + NSLog(@"Texture warning: configuration schema is old version (%zd vs %zd)", version, ASConfigurationSchemaCurrentVersion); + } + self.experimentalFeatures = ASExperimentalFeaturesFromArray(featureStrings); + } else { + self.experimentalFeatures = kNilOptions; } - self.experimentalFeatures = ASExperimentalFeaturesFromArray(featureStrings); } return self; } From 0fe991f818b4552f26d360673aef8f7601c6327e Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 22 Jun 2018 14:20:33 -0700 Subject: [PATCH 05/97] Optimize layout flattening (#982) * Optimize layout flattening * Changelog * Remove whitespace * Update ASLayout.mm Add comment --- CHANGELOG.md | 1 + Source/Base/ASBaseDefines.h | 1 + Source/Layout/ASLayout.mm | 69 +++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb280cddc8..e74bac89d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Clean up unused/unneeded header macros. [Adlai Holler](https://github.com/Adlai-Holler) - Clean up C-function `extern` decorators. [Adlai Holler](https://github.com/Adlai-Holler) - Add an experiment to reduce work involved in collection teardown. [Adlai Holler](https://github.com/Adlai-Holler) +- Optimize layout flattening, particularly reducing retain/release operations. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index 4150b8aed2..3adcf3aad7 100755 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -18,6 +18,7 @@ #import #define AS_EXTERN FOUNDATION_EXTERN +#define unowned __unsafe_unretained #ifdef __GNUC__ # define ASDISPLAYNODE_GNUC(major, minor) \ diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 607a1c6483..de06f8567a 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -55,22 +55,6 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsDisplayNodeType(ASLayo return layout.type == ASLayoutElementTypeDisplayNode; } -ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsFlattened(ASLayout *layout) -{ - // A layout is flattened if its position is null, and all of its sublayouts are of type displaynode with no sublayouts. - if (! ASPointIsNull(layout.position)) { - return NO; - } - - for (ASLayout *sublayout in layout.sublayouts) { - if (ASLayoutIsDisplayNodeType(sublayout) == NO || sublayout.sublayouts.count > 0) { - return NO; - } - } - - return YES; -} - @interface ASLayout () { ASLayoutElementType _layoutElementType; @@ -216,9 +200,25 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( #pragma mark - Layout Flattening +- (BOOL)isFlattened +{ + // A layout is flattened if its position is null, and all of its sublayouts are of type displaynode with no sublayouts. + if (!ASPointIsNull(_position)) { + return NO; + } + + for (ASLayout *sublayout in _sublayouts) { + if (ASLayoutIsDisplayNodeType(sublayout) == NO || sublayout->_sublayouts.count > 0) { + return NO; + } + } + + return YES; +} + - (ASLayout *)filteredNodeLayoutTree NS_RETURNS_RETAINED { - if (ASLayoutIsFlattened(self)) { + if ([self isFlattened]) { // All flattened layouts must have this flag enabled // to ensure sublayout elements are retained until the layouts are applied. self.retainSublayoutLayoutElements = YES; @@ -226,42 +226,45 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( } struct Context { - ASLayout *layout; + unowned ASLayout *layout; CGPoint absolutePosition; }; // Queue used to keep track of sublayouts while traversing this layout in a DFS fashion. std::deque queue; - for (ASLayout *sublayout in self.sublayouts) { + for (ASLayout *sublayout in _sublayouts) { queue.push_back({sublayout, sublayout.position}); } - NSMutableArray *flattenedSublayouts = [[NSMutableArray alloc] init]; + auto flattenedSublayouts = [[NSMutableArray alloc] init]; while (!queue.empty()) { const Context context = std::move(queue.front()); queue.pop_front(); - ASLayout *layout = context.layout; - const NSArray *sublayouts = layout.sublayouts; - const NSUInteger sublayoutsCount = sublayouts.count; + unowned ASLayout *layout = context.layout; + // Direct ivar access to avoid retain/release, use existing +1. + const NSUInteger sublayoutsCount = layout->_sublayouts.count; const CGPoint absolutePosition = context.absolutePosition; if (ASLayoutIsDisplayNodeType(layout)) { if (sublayoutsCount > 0 || CGPointEqualToPoint(ASCeilPointValues(absolutePosition), layout.position) == NO) { // Only create a new layout if the existing one can't be reused, which means it has either some sublayouts or an invalid absolute position. - layout = [ASLayout layoutWithLayoutElement:layout.layoutElement - size:layout.size - position:absolutePosition - sublayouts:@[]]; + auto newLayout = [ASLayout layoutWithLayoutElement:layout->_layoutElement + size:layout.size + position:absolutePosition + sublayouts:@[]]; + [flattenedSublayouts addObject:newLayout]; + } else { + [flattenedSublayouts addObject:layout]; } - [flattenedSublayouts addObject:layout]; - } else if (sublayoutsCount > 0){ - std::vector sublayoutContexts; - for (ASLayout *sublayout in sublayouts) { - sublayoutContexts.push_back({sublayout, absolutePosition + sublayout.position}); + } else if (sublayoutsCount > 0) { + // Fast-reverse-enumerate the sublayouts array by copying it into a C-array and push_front'ing each into the queue. + unowned ASLayout *rawSublayouts[sublayoutsCount]; + [layout->_sublayouts getObjects:rawSublayouts range:NSMakeRange(0, sublayoutsCount)]; + for (NSInteger i = sublayoutsCount - 1; i >= 0; i--) { + queue.push_front({rawSublayouts[i], absolutePosition + rawSublayouts[i].position}); } - queue.insert(queue.cbegin(), sublayoutContexts.begin(), sublayoutContexts.end()); } } From 37e82132be365208f3f793f4eb8cd6cee724329c Mon Sep 17 00:00:00 2001 From: Michael Zuccarino Date: Sat, 23 Jun 2018 09:00:43 -0700 Subject: [PATCH 06/97] Use valid Upgrade to 2.0 beta 1 page (#980) upgrading.html => adoption-guide-2-0-beta1.html Testing this doesn't quite work in preview as the path differs a bit from when its accessible through the normal resolver. I assume this will substitute the last path slug and the server maps `_docs` to `docs` https://github.com/TextureGroup/Texture/tree/master/docs/_docs --- docs/_docs/team.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/team.md b/docs/_docs/team.md index 307b6a9047..5f67265894 100755 --- a/docs/_docs/team.md +++ b/docs/_docs/team.md @@ -13,7 +13,7 @@ permalink: /docs/team.html -

Michael Schneider (@maicki) is especially passionate about API design and recently led the re-architecture of the layout API for the 2.0 release. As our resident layout expert, Michael volunteers much of his own time to help developers on Texture's public slack channel. Previous, Michael worked on Pocket for iOS, Mac and Chrome and the Instapaper Mac app.

+

Michael Schneider (@maicki) is especially passionate about API design and recently led the re-architecture of the layout API for the 2.0 release. As our resident layout expert, Michael volunteers much of his own time to help developers on Texture's public slack channel. Previous, Michael worked on Pocket for iOS, Mac and Chrome and the Instapaper Mac app.

From b82128ee4ed4eb3da0914373859286255f08fb33 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Sun, 24 Jun 2018 08:56:10 -0700 Subject: [PATCH 07/97] Add missing instance variables in ASTextNode and warnings cleanup #trivial (#984) * Add missing instance variables in ASTextNode and warnings cleanup * Re-add drain --- Source/ASDisplayNodeExtras.h | 2 +- Source/ASRunLoopQueue.mm | 5 +++++ Source/ASTextNode.mm | 27 ++++++++++++++++++++++++++- Source/ASTextNode2.mm | 2 +- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Source/ASDisplayNodeExtras.h b/Source/ASDisplayNodeExtras.h index b47eb5c6ea..9a8c2cd0c0 100644 --- a/Source/ASDisplayNodeExtras.h +++ b/Source/ASDisplayNodeExtras.h @@ -216,6 +216,6 @@ AS_EXTERN void ASDisplayNodeDisableHierarchyNotifications(ASDisplayNode *node); AS_EXTERN void ASDisplayNodeEnableHierarchyNotifications(ASDisplayNode *node); // Not to be called directly. -AS_EXTERN void _ASSetDebugNames(Class owningClass, NSString *names, ASDisplayNode *object, ...); +AS_EXTERN void _ASSetDebugNames(Class owningClass, NSString *names, ASDisplayNode * _Nullable object, ...); NS_ASSUME_NONNULL_END diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index 1ac258b2b9..fd7b39fd41 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -65,6 +65,11 @@ static void runLoopSourceCallback(void *info) { ASDisplayNodeFailAssert(@"Abstract method."); } +- (void)drain +{ + ASDisplayNodeFailAssert(@"Abstract method."); +} + @end @implementation ASDeallocQueueV1 { diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 428a19b2ce..96842d26a0 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -191,7 +191,12 @@ static ASTextKitRenderer *rendererForAttributes(ASTextKitAttributes attributes, NSAttributedString *_attributedText; NSAttributedString *_truncationAttributedText; + NSAttributedString *_additionalTruncationMessage; NSAttributedString *_composedTruncationText; + NSArray *_pointSizeScaleFactors; + NSLineBreakMode _truncationMode; + + NSUInteger _maximumNumberOfLines; NSString *_highlightedLinkAttributeName; id _highlightedLinkAttributeValue; @@ -1175,6 +1180,11 @@ static NSAttributedString *DefaultTruncationAttributedString() } } +- (NSAttributedString *)additionalTruncationMessage +{ + return ASLockedSelf(_additionalTruncationMessage); +} + - (void)setTruncationMode:(NSLineBreakMode)truncationMode { if (ASLockedSelfCompareAssign(_truncationMode, truncationMode)) { @@ -1182,18 +1192,28 @@ static NSAttributedString *DefaultTruncationAttributedString() } } +- (NSLineBreakMode)truncationMode +{ + return ASLockedSelf(_truncationMode); +} + - (BOOL)isTruncated { return ASLockedSelf([[self _locked_renderer] isTruncated]); } -- (void)setPointSizeScaleFactors:(NSArray *)pointSizeScaleFactors +- (void)setPointSizeScaleFactors:(NSArray *)pointSizeScaleFactors { if (ASLockedSelfCompareAssignCopy(_pointSizeScaleFactors, pointSizeScaleFactors)) { [self setNeedsDisplay]; } } +- (NSArray *)pointSizeScaleFactors +{ + return ASLockedSelf(_pointSizeScaleFactors); +} + - (void)setMaximumNumberOfLines:(NSUInteger)maximumNumberOfLines { if (ASLockedSelfCompareAssign(_maximumNumberOfLines, maximumNumberOfLines)) { @@ -1201,6 +1221,11 @@ static NSAttributedString *DefaultTruncationAttributedString() } } +- (NSUInteger)maximumNumberOfLines +{ + return ASLockedSelf(_maximumNumberOfLines); +} + - (NSUInteger)lineCount { return ASLockedSelf([[self _locked_renderer] lineCount]); diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index e6d0ad50a5..6f97fa6c7e 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -950,7 +950,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; } } -- (NSArray *)pointSizeScaleFactors +- (NSArray *)pointSizeScaleFactors { return ASLockedSelf(_pointSizeScaleFactors); } From f0dac1450556dad8dafa9a3091f5aeb4da1d652f Mon Sep 17 00:00:00 2001 From: Muukii Date: Tue, 26 Jun 2018 00:29:02 +0900 Subject: [PATCH 08/97] Fix typo in containers-asviewcontroller.md (#989) --- docs/_docs/containers-asviewcontroller.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/containers-asviewcontroller.md b/docs/_docs/containers-asviewcontroller.md index f3a5d8e5d3..8b4fd3648d 100755 --- a/docs/_docs/containers-asviewcontroller.md +++ b/docs/_docs/containers-asviewcontroller.md @@ -62,6 +62,6 @@ init(models: [Model]) {
-Conversion Tip: If your app already has a complex view controller hierarchy, it is perfectly fine to have all of them subclass ASViewController. That is to say, even if you don't use ASViewController's designated initializer -initiWithNode:, and only use the ASViewController in the manner of a traditional UIViewController, this will give you the additional node support if you choose to adopt it in different areas your application. +Conversion Tip: If your app already has a complex view controller hierarchy, it is perfectly fine to have all of them subclass ASViewController. That is to say, even if you don't use ASViewController's designated initializer -initWithNode:, and only use the ASViewController in the manner of a traditional UIViewController, this will give you the additional node support if you choose to adopt it in different areas your application.
From a4f78ad3e00cb8875c9b8f8ca125f21b0bea1eba Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Wed, 27 Jun 2018 16:52:40 -0700 Subject: [PATCH 09/97] Adds support for having multiple interface state delegates. (#979) * Adds support for having multiple interface state delegates. Hopefully in a performant way. * Switch to respondsToSelector for int del instead of separate object * Add CHANGELOG * Make ASDisplayNode+InterfaceState.h public * Huy's comments * Don't even bother removing since it's a weak hash table. --- AsyncDisplayKit.xcodeproj/project.pbxproj | 4 + CHANGELOG.md | 1 + Source/ASDisplayNode+InterfaceState.h | 124 ++++++++++++++++++ Source/ASDisplayNode+Subclasses.h | 68 ---------- Source/ASDisplayNode.h | 50 +++---- Source/ASDisplayNode.mm | 82 ++++++++++-- Source/ASNodeController+Beta.m | 7 +- .../Private/ASDisplayNode+FrameworkPrivate.h | 3 - Source/Private/ASDisplayNodeInternal.h | 2 + 9 files changed, 226 insertions(+), 115 deletions(-) create mode 100644 Source/ASDisplayNode+InterfaceState.h diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 4e8a7a19af..fa52798d74 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -115,6 +115,7 @@ 68355B3E1CB57A60001D4E68 /* ASPINRemoteImageDownloader.m in Sources */ = {isa = PBXBuildFile; fileRef = 68355B361CB57A5A001D4E68 /* ASPINRemoteImageDownloader.m */; }; 68355B401CB57A69001D4E68 /* ASImageContainerProtocolCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = 68355B381CB57A5A001D4E68 /* ASImageContainerProtocolCategories.m */; }; 68355B411CB57A6C001D4E68 /* ASImageContainerProtocolCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = 68355B371CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 683F563720E409D700CEB7A3 /* ASDisplayNode+InterfaceState.h in Headers */ = {isa = PBXBuildFile; fileRef = 683F563620E409D600CEB7A3 /* ASDisplayNode+InterfaceState.h */; settings = {ATTRIBUTES = (Public, ); }; }; 68AF37DB1CBEF4D80077BF76 /* ASImageNode+AnimatedImagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B8A4DB1CBD911D007E4543 /* ASImageNode+AnimatedImagePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 68B0277B1C1A79D60041016B /* ASDisplayNode+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B027791C1A79CC0041016B /* ASDisplayNode+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; 68B8A4E21CBDB958007E4543 /* ASWeakProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 68B8A4DF1CBDB958007E4543 /* ASWeakProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -667,6 +668,7 @@ 68355B371CB57A5A001D4E68 /* ASImageContainerProtocolCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASImageContainerProtocolCategories.h; sourceTree = ""; }; 68355B381CB57A5A001D4E68 /* ASImageContainerProtocolCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASImageContainerProtocolCategories.m; sourceTree = ""; }; 68355B391CB57A5A001D4E68 /* ASPINRemoteImageDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPINRemoteImageDownloader.h; sourceTree = ""; }; + 683F563620E409D600CEB7A3 /* ASDisplayNode+InterfaceState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASDisplayNode+InterfaceState.h"; sourceTree = ""; }; 68B027791C1A79CC0041016B /* ASDisplayNode+Beta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASDisplayNode+Beta.h"; sourceTree = ""; }; 68B8A4DB1CBD911D007E4543 /* ASImageNode+AnimatedImagePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+AnimatedImagePrivate.h"; sourceTree = ""; }; 68B8A4DF1CBDB958007E4543 /* ASWeakProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASWeakProxy.h; sourceTree = ""; }; @@ -1156,6 +1158,7 @@ 68B027791C1A79CC0041016B /* ASDisplayNode+Beta.h */, CC034A071E60BEB400626263 /* ASDisplayNode+Convenience.h */, CC034A081E60BEB400626263 /* ASDisplayNode+Convenience.m */, + 683F563620E409D600CEB7A3 /* ASDisplayNode+InterfaceState.h */, 69BCE3D71EC6513B007DCCAD /* ASDisplayNode+Layout.mm */, 058D09DA195D050800B7D73C /* ASDisplayNode+Subclasses.h */, 90FC784E1E4BFE1B00383C5A /* ASDisplayNode+Yoga.mm */, @@ -1915,6 +1918,7 @@ CC034A091E60BEB400626263 /* ASDisplayNode+Convenience.h in Headers */, 254C6B7E1BF94DF4003EC431 /* ASTextKitTailTruncater.h in Headers */, B35062491B010EFD0018CF92 /* _ASCoreAnimationExtras.h in Headers */, + 683F563720E409D700CEB7A3 /* ASDisplayNode+InterfaceState.h in Headers */, 68EE0DBE1C1B4ED300BA1B99 /* ASMainSerialQueue.h in Headers */, CCCCCCE11EC3EF060087FE10 /* ASTextUtilities.h in Headers */, B350624B1B010EFD0018CF92 /* _ASPendingState.h in Headers */, diff --git a/CHANGELOG.md b/CHANGELOG.md index e74bac89d6..605ac24a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASDisplayNode] Adds support for multiple interface state delegates. [Garrett Moon](https://github.com/garrettmoon) [#979](https://github.com/TextureGroup/Texture/pull/979) - [ASDataController] Add capability to renew supplementary views (update map) when size change from zero to non-zero.[Max Wang](https://github.com/wsdwsd0829) [#842](https://github.com/TextureGroup/Texture/pull/842) - Make `ASPerformMainThreadDeallocation` visible in C. [Adlai Holler](https://github.com/Adlai-Holler) - Add snapshot test for astextnode2. [Max Wang](https://github.com/wsdwsd0829) [#935](https://github.com/TextureGroup/Texture/pull/935) diff --git a/Source/ASDisplayNode+InterfaceState.h b/Source/ASDisplayNode+InterfaceState.h new file mode 100644 index 0000000000..bff9fa9ef9 --- /dev/null +++ b/Source/ASDisplayNode+InterfaceState.h @@ -0,0 +1,124 @@ +// +// ASDisplayNode+InterfaceState.h +// Texture +// +// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. +// 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 + +/** + * Interface state is available on ASDisplayNode and ASViewController, and + * allows checking whether a node is in an interface situation where it is prudent to trigger certain + * actions: measurement, data loading, display, and visibility (the latter for animations or other onscreen-only effects). + * + * The defualt state, ASInterfaceStateNone, means that the element is not predicted to be onscreen soon and + * preloading should not be performed. Swift: use [] for the default behavior. + */ +typedef NS_OPTIONS(NSUInteger, ASInterfaceState) +{ + /** The element is not predicted to be onscreen soon and preloading should not be performed */ + ASInterfaceStateNone = 0, + /** The element may be added to a view soon that could become visible. Measure the layout, including size calculation. */ + ASInterfaceStateMeasureLayout = 1 << 0, + /** The element is likely enough to come onscreen that disk and/or network data required for display should be fetched. */ + ASInterfaceStatePreload = 1 << 1, + /** The element is very likely to become visible, and concurrent rendering should be executed for any -setNeedsDisplay. */ + ASInterfaceStateDisplay = 1 << 2, + /** The element is physically onscreen by at least 1 pixel. + In practice, all other bit fields should also be set when this flag is set. */ + ASInterfaceStateVisible = 1 << 3, + + /** + * The node is not contained in a cell but it is in a window. + * + * Currently we only set `interfaceState` to other values for + * nodes contained in table views or collection views. + */ + ASInterfaceStateInHierarchy = ASInterfaceStateMeasureLayout | ASInterfaceStatePreload | ASInterfaceStateDisplay | ASInterfaceStateVisible, +}; + +@protocol ASInterfaceStateDelegate +@optional + +/** + * @abstract Called whenever any bit in the ASInterfaceState bitfield is changed. + * @discussion Subclasses may use this to monitor when they become visible, should free cached data, and much more. + * @see ASInterfaceState + */ +- (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState; + +/** + * @abstract Called whenever the node becomes visible. + * @discussion Subclasses may use this to monitor when they become visible. + * @note This method is guaranteed to be called on main. + */ +- (void)didEnterVisibleState; + +/** + * @abstract Called whenever the node is no longer visible. + * @discussion Subclasses may use this to monitor when they are no longer visible. + * @note This method is guaranteed to be called on main. + */ +- (void)didExitVisibleState; + +/** + * @abstract Called whenever the the node has entered the display state. + * @discussion Subclasses may use this to monitor when a node should be rendering its content. + * @note This method is guaranteed to be called on main. + */ +- (void)didEnterDisplayState; + +/** + * @abstract Called whenever the the node has exited the display state. + * @discussion Subclasses may use this to monitor when a node should no longer be rendering its content. + * @note This method is guaranteed to be called on main. + */ +- (void)didExitDisplayState; + +/** + * @abstract Called whenever the the node has entered the preload state. + * @discussion Subclasses may use this to monitor data for a node should be preloaded, either from a local or remote source. + * @note This method is guaranteed to be called on main. + */ +- (void)didEnterPreloadState; + +/** + * @abstract Called whenever the the node has exited the preload state. + * @discussion Subclasses may use this to monitor whether preloading data for a node should be canceled. + * @note This method is guaranteed to be called on main. + */ +- (void)didExitPreloadState; + +/** + * @abstract Called when the node has completed applying the layout. + * @discussion Can be used for operations that are performed after layout has completed. + * @note This method is guaranteed to be called on main. + */ +- (void)nodeDidLayout; + +/** + * @abstract Called when the node loads. + * @discussion Can be used for operations that are performed after the node's view is available. + * @note This method is guaranteed to be called on main. + */ +- (void)nodeDidLoad; + +/** + * @abstract Indicates that the receiver and all subnodes have finished displaying. + * @discussion May be called more than once, for example if the receiver has a network image node. + * This is called after the first display pass even if network image nodes have not downloaded anything + * (text would be done, and other nodes that are ready to do their final display). Each render of + * every progressive jpeg network node would cause this to be called, so this hook could be called up to + * 1 + (pJPEGcount * pJPEGrenderCount) times. The render count depends on how many times the downloader calls + * the progressImage block. + * @note This method is guaranteed to be called on main. + */ +- (void)hierarchyDisplayDidFinish; + +@end diff --git a/Source/ASDisplayNode+Subclasses.h b/Source/ASDisplayNode+Subclasses.h index 43f1c235f0..d4cbc39f2d 100644 --- a/Source/ASDisplayNode+Subclasses.h +++ b/Source/ASDisplayNode+Subclasses.h @@ -42,74 +42,6 @@ NS_ASSUME_NONNULL_BEGIN * variables. */ -@protocol ASInterfaceStateDelegate -@required - -/** - * @abstract Called whenever any bit in the ASInterfaceState bitfield is changed. - * @discussion Subclasses may use this to monitor when they become visible, should free cached data, and much more. - * @see ASInterfaceState - */ -- (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState; - -/** - * @abstract Called whenever the node becomes visible. - * @discussion Subclasses may use this to monitor when they become visible. - * @note This method is guaranteed to be called on main. - */ -- (void)didEnterVisibleState; - -/** - * @abstract Called whenever the node is no longer visible. - * @discussion Subclasses may use this to monitor when they are no longer visible. - * @note This method is guaranteed to be called on main. - */ -- (void)didExitVisibleState; - -/** - * @abstract Called whenever the the node has entered the display state. - * @discussion Subclasses may use this to monitor when a node should be rendering its content. - * @note This method is guaranteed to be called on main. - */ -- (void)didEnterDisplayState; - -/** - * @abstract Called whenever the the node has exited the display state. - * @discussion Subclasses may use this to monitor when a node should no longer be rendering its content. - * @note This method is guaranteed to be called on main. - */ -- (void)didExitDisplayState; - -/** - * @abstract Called whenever the the node has entered the preload state. - * @discussion Subclasses may use this to monitor data for a node should be preloaded, either from a local or remote source. - * @note This method is guaranteed to be called on main. - */ -- (void)didEnterPreloadState; - -/** - * @abstract Called whenever the the node has exited the preload state. - * @discussion Subclasses may use this to monitor whether preloading data for a node should be canceled. - * @note This method is guaranteed to be called on main. - */ -- (void)didExitPreloadState; - -/** - * @abstract Called when the node has completed applying the layout. - * @discussion Can be used for operations that are performed after layout has completed. - * @note This method is guaranteed to be called on main. - */ -- (void)nodeDidLayout; - -/** - * @abstract Called when the node loads. - * @discussion Can be used for operations that are performed after the node's view is available. - * @note This method is guaranteed to be called on main. - */ -- (void)nodeDidLoad; - -@end - @interface ASDisplayNode (Subclassing) #pragma mark - Properties diff --git a/Source/ASDisplayNode.h b/Source/ASDisplayNode.h index e8dcb03c91..dbe641e9b5 100644 --- a/Source/ASDisplayNode.h +++ b/Source/ASDisplayNode.h @@ -22,6 +22,7 @@ #import #import #import +#import #import #import #import @@ -70,37 +71,6 @@ typedef ASLayoutSpec * _Nonnull(^ASLayoutSpecBlock)(__kindof ASDisplayNode *node */ typedef void (^ASDisplayNodeNonFatalErrorBlock)(NSError *error); -/** - * Interface state is available on ASDisplayNode and ASViewController, and - * allows checking whether a node is in an interface situation where it is prudent to trigger certain - * actions: measurement, data loading, display, and visibility (the latter for animations or other onscreen-only effects). - * - * The defualt state, ASInterfaceStateNone, means that the element is not predicted to be onscreen soon and - * preloading should not be performed. Swift: use [] for the default behavior. - */ -typedef NS_OPTIONS(NSUInteger, ASInterfaceState) -{ - /** The element is not predicted to be onscreen soon and preloading should not be performed */ - ASInterfaceStateNone = 0, - /** The element may be added to a view soon that could become visible. Measure the layout, including size calculation. */ - ASInterfaceStateMeasureLayout = 1 << 0, - /** The element is likely enough to come onscreen that disk and/or network data required for display should be fetched. */ - ASInterfaceStatePreload = 1 << 1, - /** The element is very likely to become visible, and concurrent rendering should be executed for any -setNeedsDisplay. */ - ASInterfaceStateDisplay = 1 << 2, - /** The element is physically onscreen by at least 1 pixel. - In practice, all other bit fields should also be set when this flag is set. */ - ASInterfaceStateVisible = 1 << 3, - - /** - * The node is not contained in a cell but it is in a window. - * - * Currently we only set `interfaceState` to other values for - * nodes contained in table views or collection views. - */ - ASInterfaceStateInHierarchy = ASInterfaceStateMeasureLayout | ASInterfaceStatePreload | ASInterfaceStateDisplay | ASInterfaceStateVisible, -}; - typedef NS_ENUM(NSInteger, ASCornerRoundingType) { ASCornerRoundingTypeDefaultSlowCALayer, ASCornerRoundingTypePrecomposited, @@ -292,6 +262,24 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; */ @property (readonly) ASInterfaceState interfaceState; +/** + * @abstract Adds a delegate to receive notifications on interfaceState changes. + * + * @warning This must be called from the main thread. + * + * @see ASInterfaceState + */ +- (void)addInterfaceStateDelegate:(id )interfaceStateDelegate; + +/** + * @abstract Removes a delegate from receiving notifications on interfaceState changes. + * + * @warning This must be called from the main thread. + * + * @see ASInterfaceState + */ +- (void)removeInterfaceStateDelegate:(id )interfaceStateDelegate; + /** * @abstract Class property that allows to set a block that can be called on non-fatal errors. This * property can be useful for cases when Async Display Kit can recover from an abnormal behavior, but diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index e705522841..81ab1cd618 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -36,6 +36,7 @@ #import #import #import +#import #import #import #import @@ -71,7 +72,6 @@ NSInteger const ASDefaultDrawingPriority = ASDefaultTransactionPriority; @protocol CALayerDelegate; @interface ASDisplayNode () - /** * See ASDisplayNodeInternal.h for ivars */ @@ -544,7 +544,11 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); block(self); } - [_interfaceStateDelegate nodeDidLoad]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(nodeDidLoad)]) { + [delegate nodeDidLoad]; + } + } } - (void)didLoad @@ -1225,7 +1229,11 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); - [_interfaceStateDelegate nodeDidLayout]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(nodeDidLayout)]) { + [delegate nodeDidLayout]; + } + } } #pragma mark Layout Transition @@ -1447,6 +1455,13 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS if (_pendingDisplayNodes.isEmpty) { [self hierarchyDisplayDidFinish]; + + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(hierarchyDisplayDidFinish)]) { + [delegate hierarchyDisplayDidFinish]; + } + } + BOOL placeholderShouldPersist = [self placeholderShouldPersist]; __instanceLock__.lock(); @@ -3142,7 +3157,12 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { // Subclass hook ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate interfaceStateDidChange:newState fromState:oldState]; + ASDisplayNodeAssertMainThread(); + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(interfaceStateDidChange:fromState:)]) { + [delegate interfaceStateDidChange:newState fromState:oldState]; + } + } } - (BOOL)shouldScheduleDisplayWithNewInterfaceState:(ASInterfaceState)newInterfaceState @@ -3152,6 +3172,24 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { return willDisplay && (willDisplay != nowDisplay); } +- (void)addInterfaceStateDelegate:(id )interfaceStateDelegate +{ + ASDisplayNodeAssertMainThread(); + + // Not a fan of lazy loading, but this method won't get called very often and avoiding + // the overhead of creating this is probably worth it. + if (_interfaceStateDelegates == nil) { + _interfaceStateDelegates = [NSHashTable weakObjectsHashTable]; + } + [_interfaceStateDelegates addObject:interfaceStateDelegate]; +} + +- (void)removeInterfaceStateDelegate:(id )interfaceStateDelegate +{ + ASDisplayNodeAssertMainThread(); + [_interfaceStateDelegates removeObject:interfaceStateDelegate]; +} + - (BOOL)isVisible { ASDN::MutexLocker l(__instanceLock__); @@ -3163,7 +3201,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate didEnterVisibleState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didEnterVisibleState)]) { + [delegate didEnterVisibleState]; + } + } #if AS_ENABLE_TIPS [ASTipsController.shared nodeDidAppear:self]; #endif @@ -3174,7 +3216,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate didExitVisibleState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didExitVisibleState)]) { + [delegate didExitVisibleState]; + } + } } - (BOOL)isInDisplayState @@ -3188,7 +3234,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate didEnterDisplayState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didEnterDisplayState)]) { + [delegate didEnterDisplayState]; + } + } } - (void)didExitDisplayState @@ -3196,7 +3246,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate didExitDisplayState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didExitDisplayState)]) { + [delegate didExitDisplayState]; + } + } } - (BOOL)isInPreloadState @@ -3247,14 +3301,22 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [self layoutIfNeeded]; } - [_interfaceStateDelegate didEnterPreloadState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didEnterPreloadState)]) { + [delegate didEnterPreloadState]; + } + } } - (void)didExitPreloadState { ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); - [_interfaceStateDelegate didExitPreloadState]; + for (id delegate in _interfaceStateDelegates) { + if ([delegate respondsToSelector:@selector(didExitPreloadState)]) { + [delegate didExitPreloadState]; + } + } } - (void)clearContents diff --git a/Source/ASNodeController+Beta.m b/Source/ASNodeController+Beta.m index 1bd873e763..5f5fcddf66 100644 --- a/Source/ASNodeController+Beta.m +++ b/Source/ASNodeController+Beta.m @@ -15,9 +15,10 @@ // http://www.apache.org/licenses/LICENSE-2.0 // -#import -#import +#import #import +#import +#import #define _node (_shouldInvertStrongReference ? _weakNode : _strongNode) @@ -74,7 +75,7 @@ _weakNode = nil; } - node.interfaceStateDelegate = self; + [node addInterfaceStateDelegate:self]; } - (void)setNode:(ASDisplayNode *)node diff --git a/Source/Private/ASDisplayNode+FrameworkPrivate.h b/Source/Private/ASDisplayNode+FrameworkPrivate.h index 589d60c22c..245d9f382c 100644 --- a/Source/Private/ASDisplayNode+FrameworkPrivate.h +++ b/Source/Private/ASDisplayNode+FrameworkPrivate.h @@ -138,9 +138,6 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc // Returns the bounds of the node without reaching the view or layer - (CGRect)_locked_threadSafeBounds; -// delegate to inform of ASInterfaceState changes (used by ASNodeController) -@property (nonatomic, weak) id interfaceStateDelegate; - // The -pendingInterfaceState holds the value that will be applied to -interfaceState by the // ASCATransactionQueue. If already applied, it matches -interfaceState. Thread-safe access. @property (nonatomic, readonly) ASInterfaceState pendingInterfaceState; diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 18c93f103d..9146a4f1e1 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -241,6 +241,8 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest NSTimeInterval _debugTimeToAddSubnodeViews; NSTimeInterval _debugTimeForDidLoad; #endif + + NSHashTable > *_interfaceStateDelegates; } + (void)scheduleNodeForRecursiveDisplay:(ASDisplayNode *)node; From 77e2d28919b843f4b95cf9702d65c59182df67e2 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 29 Jun 2018 18:21:55 -0700 Subject: [PATCH 10/97] Create transfer-array method and use it (#987) * Create transfer-array method and use it * License headers * Update ASArrayByFlatMapping --- AsyncDisplayKit.xcodeproj/project.pbxproj | 12 ++++ CHANGELOG.md | 1 + Source/ASCollectionView.mm | 23 +------ Source/ASCollections.h | 42 ++++++++++++ Source/ASCollections.m | 65 +++++++++++++++++++ Source/ASExperimentalFeatures.m | 2 + Source/ASTableView.mm | 1 + Source/AsyncDisplayKit.h | 1 + Source/Base/ASBaseDefines.h | 19 ++++-- .../Details/ASCollectionFlowLayoutDelegate.m | 1 + .../ASCollectionGalleryLayoutDelegate.mm | 7 +- Source/Layout/ASLayout.mm | 12 ++-- Source/Layout/ASLayoutSpec.mm | 1 + Source/Private/_ASHierarchyChangeSet.mm | 1 + Tests/ASCollectionsTests.m | 59 +++++++++++++++++ 15 files changed, 213 insertions(+), 34 deletions(-) create mode 100644 Source/ASCollections.h create mode 100644 Source/ASCollections.m create mode 100644 Tests/ASCollectionsTests.m diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index fa52798d74..dc551d2e83 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -333,6 +333,9 @@ CC224E962066CA6D00BBA57F /* configuration.json in Resources */ = {isa = PBXBuildFile; fileRef = CC224E952066CA6D00BBA57F /* configuration.json */; }; CC2F65EE1E5FFB1600DA57C9 /* ASMutableElementMap.h in Headers */ = {isa = PBXBuildFile; fileRef = CC2F65EC1E5FFB1600DA57C9 /* ASMutableElementMap.h */; }; CC2F65EF1E5FFB1600DA57C9 /* ASMutableElementMap.m in Sources */ = {isa = PBXBuildFile; fileRef = CC2F65ED1E5FFB1600DA57C9 /* ASMutableElementMap.m */; }; + CC35CEC320DD7F600006448D /* ASCollections.h in Headers */ = {isa = PBXBuildFile; fileRef = CC35CEC120DD7F600006448D /* ASCollections.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CC35CEC420DD7F600006448D /* ASCollections.m in Sources */ = {isa = PBXBuildFile; fileRef = CC35CEC220DD7F600006448D /* ASCollections.m */; }; + CC35CEC620DD87280006448D /* ASCollectionsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC35CEC520DD87280006448D /* ASCollectionsTests.m */; }; CC3B20841C3F76D600798563 /* ASPendingStateController.h in Headers */ = {isa = PBXBuildFile; fileRef = CC3B20811C3F76D600798563 /* ASPendingStateController.h */; settings = {ATTRIBUTES = (Private, ); }; }; CC3B20861C3F76D600798563 /* ASPendingStateController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CC3B20821C3F76D600798563 /* ASPendingStateController.mm */; }; CC3B208A1C3F7A5400798563 /* ASWeakSet.h in Headers */ = {isa = PBXBuildFile; fileRef = CC3B20871C3F7A5400798563 /* ASWeakSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -841,6 +844,9 @@ CC2E317F1DAC353700EEE891 /* ASCollectionView+Undeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASCollectionView+Undeprecated.h"; sourceTree = ""; }; CC2F65EC1E5FFB1600DA57C9 /* ASMutableElementMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASMutableElementMap.h; sourceTree = ""; }; CC2F65ED1E5FFB1600DA57C9 /* ASMutableElementMap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASMutableElementMap.m; sourceTree = ""; }; + CC35CEC120DD7F600006448D /* ASCollections.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASCollections.h; sourceTree = ""; }; + CC35CEC220DD7F600006448D /* ASCollections.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCollections.m; sourceTree = ""; }; + CC35CEC520DD87280006448D /* ASCollectionsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASCollectionsTests.m; sourceTree = ""; }; CC3B20811C3F76D600798563 /* ASPendingStateController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPendingStateController.h; sourceTree = ""; }; CC3B20821C3F76D600798563 /* ASPendingStateController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASPendingStateController.mm; sourceTree = ""; }; CC3B20871C3F7A5400798563 /* ASWeakSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASWeakSet.h; sourceTree = ""; }; @@ -1117,6 +1123,8 @@ 058D09B1195D04C000B7D73C /* Source */ = { isa = PBXGroup; children = ( + CC35CEC120DD7F600006448D /* ASCollections.h */, + CC35CEC220DD7F600006448D /* ASCollections.m */, 058D0A42195D058D00B7D73C /* Base */, CCE04B1D1E313E99006AEBBB /* Collection Data Adapter */, DE89C1691DCEB9CC00D49D74 /* Debug */, @@ -1241,6 +1249,7 @@ 058D09C5195D04C000B7D73C /* Tests */ = { isa = PBXGroup; children = ( + CC35CEC520DD87280006448D /* ASCollectionsTests.m */, DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.m */, AC026B571BD3F61800BBC17E /* ASAbsoluteLayoutSpecSnapshotTests.m */, 696FCB301D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm */, @@ -2023,6 +2032,7 @@ CCCCCCDB1EC3EF060087FE10 /* ASTextLine.h in Headers */, 9C70F20E1CDBE9E5007D6C76 /* NSArray+Diffing.h in Headers */, CCCCCCE71EC3F0FC0087FE10 /* NSAttributedString+ASText.h in Headers */, + CC35CEC320DD7F600006448D /* ASCollections.h in Headers */, CC7AF196200D9BD500A21BDE /* ASExperimentalFeatures.h in Headers */, CCCCCCDF1EC3EF060087FE10 /* ASTextRunDelegate.h in Headers */, 9C49C3701B853961000B0DD5 /* ASStackLayoutElement.h in Headers */, @@ -2304,6 +2314,7 @@ 1A6C00111FAB4EDD00D05926 /* ASCornerLayoutSpecSnapshotTests.mm in Sources */, 254C6B541BF8FF2A003EC431 /* ASTextKitTests.mm in Sources */, 05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.m in Sources */, + CC35CEC620DD87280006448D /* ASCollectionsTests.m in Sources */, ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */, E52AC9C01FEA916C00AA4040 /* ASRectMapTests.m in Sources */, CCE4F9BA1F0DBB5000062E4E /* ASLayoutTestNode.mm in Sources */, @@ -2448,6 +2459,7 @@ CCA282B51E9EA7310037E8B7 /* ASTipsController.m in Sources */, B35062271B010EFD0018CF92 /* ASRangeController.mm in Sources */, 0442850A1BAA63FE00D16268 /* ASBatchFetching.m in Sources */, + CC35CEC420DD7F600006448D /* ASCollections.m in Sources */, 68FC85E61CE29B9400EDD713 /* ASNavigationController.m in Sources */, CC4C2A791D88E3BF0039ACAB /* ASTraceEvent.m in Sources */, 34EFC76F1B701CF700AD841F /* ASRatioLayoutSpec.mm in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 605ac24a01..573aa36faa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Clean up C-function `extern` decorators. [Adlai Holler](https://github.com/Adlai-Holler) - Add an experiment to reduce work involved in collection teardown. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize layout flattening, particularly reducing retain/release operations. [Adlai Holler](https://github.com/Adlai-Holler) +- Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index d19e59898d..555707f3d5 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -23,6 +23,7 @@ #import #import #import +#import #import #import #import @@ -751,19 +752,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; - (NSArray *)convertIndexPathsToCollectionNode:(NSArray *)indexPaths { - if (indexPaths == nil) { - return nil; - } - - NSMutableArray *indexPathsArray = [NSMutableArray arrayWithCapacity:indexPaths.count]; - - for (NSIndexPath *indexPathInView in indexPaths) { - NSIndexPath *indexPath = [self convertIndexPathToCollectionNode:indexPathInView]; - if (indexPath != nil) { - [indexPathsArray addObject:indexPath]; - } - } - return indexPathsArray; + return ASArrayByFlatMapping(indexPaths, NSIndexPath *viewIndexPath, [self convertIndexPathToCollectionNode:viewIndexPath]); } - (ASCellNode *)supplementaryNodeForElementKind:(NSString *)elementKind atIndexPath:(NSIndexPath *)indexPath @@ -2225,13 +2214,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; return; } - NSMutableArray *uikitIndexPaths = [NSMutableArray arrayWithCapacity:nodes.count]; - for (ASCellNode *node in nodes) { - NSIndexPath *uikitIndexPath = [self indexPathForNode:node]; - if (uikitIndexPath != nil) { - [uikitIndexPaths addObject:uikitIndexPath]; - } - } + auto uikitIndexPaths = ASArrayByFlatMapping(nodes, ASCellNode *node, [self indexPathForNode:node]); [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:uikitIndexPaths batched:NO]; diff --git a/Source/ASCollections.h b/Source/ASCollections.h new file mode 100644 index 0000000000..bc36864f4e --- /dev/null +++ b/Source/ASCollections.h @@ -0,0 +1,42 @@ +// +// ASCollections.h +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 + +NS_ASSUME_NONNULL_BEGIN + +@interface NSArray<__covariant ObjectType> (ASCollections) + +/** + * Create an immutable NSArray from a C-array of strong pointers. + * + * Note: The memory for the array you pass in will be zero'd (to prevent ARC from releasing + * the references when the array goes out of scope.) + * + * Can be combined with vector like: + * vector vec; + * vec.push_back(@"foo"); + * vec.push_back(@"bar"); + * NSArray *arr = [NSArray arrayTransferring:vec.data() count:vec.size()] + * ** vec is now { nil, nil } ** + * + * Unfortunately making a convenience method to do this is currently impossible because + * vector can't be converted to vector by the compiler (silly). + * + * See the private __CFArrayCreateTransfer function. + */ ++ (NSArray *)arrayByTransferring:(ObjectType _Nonnull __strong * _Nonnull)pointers + count:(NSUInteger)count NS_RETURNS_RETAINED; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Source/ASCollections.m b/Source/ASCollections.m new file mode 100644 index 0000000000..3d9793d049 --- /dev/null +++ b/Source/ASCollections.m @@ -0,0 +1,65 @@ +// +// ASCollections.m +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 "ASCollections.h" + +/** + * A private allocator that signals to our retain callback to skip the retain. + * It behaves the same as the default allocator, but acts as a signal that we + * are creating a transfer array so we should skip the retain. + */ +static CFAllocatorRef gTransferAllocator; + +static const void *ASTransferRetain(CFAllocatorRef allocator, const void *val) { + if (allocator == gTransferAllocator) { + // Transfer allocator. Ignore retain and pass through. + return val; + } else { + // Other allocator. Retain like normal. + // This happens when they make a mutable copy. + return (&kCFTypeArrayCallBacks)->retain(allocator, val); + } +} + +@implementation NSArray (ASCollections) + ++ (NSArray *)arrayByTransferring:(__strong id *)pointers count:(NSUInteger)count NS_RETURNS_RETAINED +{ + // Custom callbacks that point to our ASTransferRetain callback. + static CFArrayCallBacks callbacks; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + callbacks = kCFTypeArrayCallBacks; + callbacks.retain = ASTransferRetain; + CFAllocatorContext ctx; + CFAllocatorGetContext(NULL, &ctx); + gTransferAllocator = CFAllocatorCreate(NULL, &ctx); + }); + + // NSZeroArray fast path. + if (count == 0) { + return @[]; // Does not actually call +array when optimized. + } + + // NSSingleObjectArray fast path. Retain/release here is worth it. + if (count == 1) { + NSArray *result = [[NSArray alloc] initWithObjects:pointers count:1]; + pointers[0] = nil; + return result; + } + + NSArray *result = (__bridge_transfer NSArray *)CFArrayCreate(gTransferAllocator, (void *)pointers, count, &callbacks); + memset(pointers, 0, count * sizeof(id)); + return result; +} + +@end diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index e424219059..dea872b365 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -12,6 +12,8 @@ #import +#import + NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags) { NSArray *allNames = ASCreateOnce((@[@"exp_graphics_contexts", diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 241816d0f5..003b819365 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -24,6 +24,7 @@ #import #import #import +#import #import #import #import diff --git a/Source/AsyncDisplayKit.h b/Source/AsyncDisplayKit.h index 8a1c73bf49..227b13f21c 100644 --- a/Source/AsyncDisplayKit.h +++ b/Source/AsyncDisplayKit.h @@ -96,6 +96,7 @@ #import #import #import +#import #import #import #import diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index 3adcf3aad7..54a7b85946 100755 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -214,13 +214,18 @@ /** * Create a new array by mapping `collection` over `work`, ignoring nil. */ -#define ASArrayByFlatMapping(collection, decl, work) ({ \ - NSMutableArray *a = [[NSMutableArray alloc] init]; \ - for (decl in collection) {\ - id result = work; \ - if (result != nil) { \ - [a addObject:result]; \ +#define ASArrayByFlatMapping(collectionArg, decl, work) ({ \ + id __collection = collectionArg; \ + NSArray *__result; \ + if (__collection) { \ + id __buf[[__collection count]]; \ + NSUInteger __i = 0; \ + for (decl in __collection) {\ + if ((__buf[__i] = work)) { \ + __i++; \ + } \ } \ + __result = [NSArray arrayByTransferring:__buf count:__i]; \ } \ - a; \ + __result; \ }) diff --git a/Source/Details/ASCollectionFlowLayoutDelegate.m b/Source/Details/ASCollectionFlowLayoutDelegate.m index 548fa01816..706ee9c872 100644 --- a/Source/Details/ASCollectionFlowLayoutDelegate.m +++ b/Source/Details/ASCollectionFlowLayoutDelegate.m @@ -22,6 +22,7 @@ #import #import #import +#import #import #import #import diff --git a/Source/Details/ASCollectionGalleryLayoutDelegate.mm b/Source/Details/ASCollectionGalleryLayoutDelegate.mm index 2734e9649a..c6e818ab09 100644 --- a/Source/Details/ASCollectionGalleryLayoutDelegate.mm +++ b/Source/Details/ASCollectionGalleryLayoutDelegate.mm @@ -17,6 +17,7 @@ #import #import #import +#import #import #import #import @@ -102,9 +103,9 @@ return [[ASCollectionLayoutState alloc] initWithContext:context]; } - NSMutableArray<_ASGalleryLayoutItem *> *children = ASArrayByFlatMapping(elements.itemElements, - ASCollectionElement *element, - [[_ASGalleryLayoutItem alloc] initWithItemSize:itemSize collectionElement:element]); + NSArray<_ASGalleryLayoutItem *> *children = ASArrayByFlatMapping(elements.itemElements, + ASCollectionElement *element, + [[_ASGalleryLayoutItem alloc] initWithItemSize:itemSize collectionElement:element]); if (children.count == 0) { return [[ASCollectionLayoutState alloc] initWithContext:context]; } diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index de06f8567a..2007c28da8 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -19,6 +19,7 @@ #import +#import #import #import #import @@ -236,7 +237,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( queue.push_back({sublayout, sublayout.position}); } - auto flattenedSublayouts = [[NSMutableArray alloc] init]; + std::vector flattenedSublayouts; while (!queue.empty()) { const Context context = std::move(queue.front()); @@ -254,9 +255,9 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( size:layout.size position:absolutePosition sublayouts:@[]]; - [flattenedSublayouts addObject:newLayout]; + flattenedSublayouts.push_back(newLayout); } else { - [flattenedSublayouts addObject:layout]; + flattenedSublayouts.push_back(layout); } } else if (sublayoutsCount > 0) { // Fast-reverse-enumerate the sublayouts array by copying it into a C-array and push_front'ing each into the queue. @@ -268,7 +269,10 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( } } - ASLayout *layout = [ASLayout layoutWithLayoutElement:_layoutElement size:_size sublayouts:flattenedSublayouts]; + NSArray *array = [NSArray arrayByTransferring:flattenedSublayouts.data() count:flattenedSublayouts.size()]; + // flattenedSublayouts is now all nils. + + ASLayout *layout = [ASLayout layoutWithLayoutElement:_layoutElement size:_size sublayouts:array]; // All flattened layouts must have this flag enabled // to ensure sublayout elements are retained until the layouts are applied. layout.retainSublayoutLayoutElements = YES; diff --git a/Source/Layout/ASLayoutSpec.mm b/Source/Layout/ASLayoutSpec.mm index 7b70df4e3d..d52702fbaa 100644 --- a/Source/Layout/ASLayoutSpec.mm +++ b/Source/Layout/ASLayoutSpec.mm @@ -20,6 +20,7 @@ #import +#import #import #import #import diff --git a/Source/Private/_ASHierarchyChangeSet.mm b/Source/Private/_ASHierarchyChangeSet.mm index 35d925fb08..f35b656e3b 100644 --- a/Source/Private/_ASHierarchyChangeSet.mm +++ b/Source/Private/_ASHierarchyChangeSet.mm @@ -17,6 +17,7 @@ #import #import +#import #import #import #import diff --git a/Tests/ASCollectionsTests.m b/Tests/ASCollectionsTests.m new file mode 100644 index 0000000000..17857a6e47 --- /dev/null +++ b/Tests/ASCollectionsTests.m @@ -0,0 +1,59 @@ +// +// ASCollectionsTests.m +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 +#import + +@interface ASCollectionsTests : XCTestCase + +@end + +@implementation ASCollectionsTests + +- (void)testTransferArray { + id objs[2]; + objs[0] = [NSObject new]; + id o0 = objs[0]; + objs[1] = [NSObject new]; + __weak id w0 = objs[0]; + __weak id w1 = objs[1]; + CFTypeRef cf0 = (__bridge CFTypeRef)objs[0]; + CFTypeRef cf1 = (__bridge CFTypeRef)objs[1]; + XCTAssertEqual(CFGetRetainCount(cf0), 2); + XCTAssertEqual(CFGetRetainCount(cf1), 1); + NSArray *arr = [NSArray arrayByTransferring:objs count:2]; + XCTAssertNil(objs[0]); + XCTAssertNil(objs[1]); + XCTAssertEqual(CFGetRetainCount(cf0), 2); + XCTAssertEqual(CFGetRetainCount(cf1), 1); + NSArray *immutableCopy = [arr copy]; + XCTAssertEqual(immutableCopy, arr); + XCTAssertEqual(CFGetRetainCount(cf0), 2); + XCTAssertEqual(CFGetRetainCount(cf1), 1); + NSMutableArray *mc = [arr mutableCopy]; + XCTAssertEqual(CFGetRetainCount(cf0), 3); + XCTAssertEqual(CFGetRetainCount(cf1), 2); + arr = nil; + immutableCopy = nil; + XCTAssertEqual(CFGetRetainCount(cf0), 2); + XCTAssertEqual(CFGetRetainCount(cf1), 1); + [mc removeObjectAtIndex:0]; + XCTAssertEqual(CFGetRetainCount(cf0), 1); + XCTAssertEqual(CFGetRetainCount(cf1), 1); + [mc removeObjectAtIndex:0]; + XCTAssertEqual(CFGetRetainCount(cf0), 1); + XCTAssertNil(w1); + o0 = nil; + XCTAssertNil(w0); +} + +@end From 75594affe2b74095c8183415b5ff58719d5c2328 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sat, 30 Jun 2018 09:42:27 -0700 Subject: [PATCH 11/97] Remove yoga layout spec, which has been superseded (#999) * Remove yoga layout spec, which has been superseded by tighter yoga-display node integration * Changelog --- AsyncDisplayKit.xcodeproj/project.pbxproj | 8 - CHANGELOG.md | 1 + Source/ASDisplayNode+Yoga.mm | 1 - Source/Layout/ASYogaLayoutSpec.h | 24 --- Source/Layout/ASYogaLayoutSpec.mm | 177 ---------------------- 5 files changed, 1 insertion(+), 210 deletions(-) delete mode 100644 Source/Layout/ASYogaLayoutSpec.h delete mode 100644 Source/Layout/ASYogaLayoutSpec.mm diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index dc551d2e83..bb8227f276 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -181,8 +181,6 @@ 8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */; }; 8BDA5FC71CDBDF91007D13B2 /* ASVideoPlayerNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8BDA5FC81CDBDF95007D13B2 /* ASVideoPlayerNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */; }; - 9019FBBD1ED8061D00C45F72 /* ASYogaLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 9019FBB91ED8061D00C45F72 /* ASYogaLayoutSpec.h */; }; - 9019FBBE1ED8061D00C45F72 /* ASYogaLayoutSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9019FBBA1ED8061D00C45F72 /* ASYogaLayoutSpec.mm */; }; 9019FBBF1ED8061D00C45F72 /* ASYogaUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 9019FBBB1ED8061D00C45F72 /* ASYogaUtilities.h */; }; 9019FBC01ED8061D00C45F72 /* ASYogaUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9019FBBC1ED8061D00C45F72 /* ASYogaUtilities.mm */; }; 909C4C751F09C98B00D6B76F /* ASTextNode2.h in Headers */ = {isa = PBXBuildFile; fileRef = 909C4C731F09C98B00D6B76F /* ASTextNode2.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -739,8 +737,6 @@ 8B0768B21CE752EC002E1453 /* ASDefaultPlaybackButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDefaultPlaybackButton.m; sourceTree = ""; }; 8BDA5FC31CDBDDE1007D13B2 /* ASVideoPlayerNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASVideoPlayerNode.h; sourceTree = ""; }; 8BDA5FC41CDBDDE1007D13B2 /* ASVideoPlayerNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASVideoPlayerNode.mm; sourceTree = ""; }; - 9019FBB91ED8061D00C45F72 /* ASYogaLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASYogaLayoutSpec.h; sourceTree = ""; }; - 9019FBBA1ED8061D00C45F72 /* ASYogaLayoutSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASYogaLayoutSpec.mm; sourceTree = ""; }; 9019FBBB1ED8061D00C45F72 /* ASYogaUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASYogaUtilities.h; sourceTree = ""; }; 9019FBBC1ED8061D00C45F72 /* ASYogaUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASYogaUtilities.mm; sourceTree = ""; }; 909C4C731F09C98B00D6B76F /* ASTextNode2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTextNode2.h; sourceTree = ""; }; @@ -1657,8 +1653,6 @@ 9C49C36E1B853957000B0DD5 /* ASStackLayoutElement.h */, ACF6ED161B17843500DA7C62 /* ASStackLayoutSpec.h */, ACF6ED171B17843500DA7C62 /* ASStackLayoutSpec.mm */, - 9019FBB91ED8061D00C45F72 /* ASYogaLayoutSpec.h */, - 9019FBBA1ED8061D00C45F72 /* ASYogaLayoutSpec.mm */, 9019FBBB1ED8061D00C45F72 /* ASYogaUtilities.h */, 9019FBBC1ED8061D00C45F72 /* ASYogaUtilities.mm */, ); @@ -1992,7 +1986,6 @@ CCF18FF41D2575E300DF5895 /* NSIndexSet+ASHelpers.h in Headers */, 83A7D95C1D44548100BF333E /* ASWeakMap.h in Headers */, E5711A2C1C840C81009619D4 /* ASCollectionElement.h in Headers */, - 9019FBBD1ED8061D00C45F72 /* ASYogaLayoutSpec.h in Headers */, 6947B0BE1E36B4E30007C478 /* ASStackUnpositionedLayout.h in Headers */, CC4C2A771D88E3BF0039ACAB /* ASTraceEvent.h in Headers */, 254C6B7B1BF94DF4003EC431 /* ASTextKitRenderer+Positioning.h in Headers */, @@ -2451,7 +2444,6 @@ 6907C25A1DC4ECFE00374C66 /* ASObjectDescriptionHelpers.m in Sources */, B35062051B010EFD0018CF92 /* ASMultiplexImageNode.mm in Sources */, B35062251B010EFD0018CF92 /* ASMutableAttributedStringBuilder.m in Sources */, - 9019FBBE1ED8061D00C45F72 /* ASYogaLayoutSpec.mm in Sources */, B35062071B010EFD0018CF92 /* ASNetworkImageNode.mm in Sources */, 34EFC76D1B701CF100AD841F /* ASOverlayLayoutSpec.mm in Sources */, 044285101BAA64EC00D16268 /* ASTwoDimensionalArrayUtils.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 573aa36faa..e47a52ecc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - Add an experiment to reduce work involved in collection teardown. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize layout flattening, particularly reducing retain/release operations. [Adlai Holler](https://github.com/Adlai-Holler) - Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) +- Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index ea5af2bb67..ea9739de86 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -20,7 +20,6 @@ #if YOGA /* YOGA */ #import -#import #import #import #import diff --git a/Source/Layout/ASYogaLayoutSpec.h b/Source/Layout/ASYogaLayoutSpec.h deleted file mode 100644 index 75c9d09bec..0000000000 --- a/Source/Layout/ASYogaLayoutSpec.h +++ /dev/null @@ -1,24 +0,0 @@ -// -// ASYogaLayoutSpec.h -// Texture -// -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 - -#if YOGA /* YOGA */ - -#import -#import - -@interface ASYogaLayoutSpec : ASLayoutSpec -@property (nonatomic, nonnull) ASDisplayNode *rootNode; -@end - -#endif /* YOGA */ diff --git a/Source/Layout/ASYogaLayoutSpec.mm b/Source/Layout/ASYogaLayoutSpec.mm deleted file mode 100644 index e0cc80e512..0000000000 --- a/Source/Layout/ASYogaLayoutSpec.mm +++ /dev/null @@ -1,177 +0,0 @@ -// -// ASYogaLayoutSpec.mm -// Texture -// -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 - -#if YOGA /* YOGA */ - -#import -#import -#import -#import -#import - -#define YOGA_LAYOUT_LOGGING 0 - -@implementation ASYogaLayoutSpec - -- (ASLayout *)layoutForYogaNode:(YGNodeRef)yogaNode -{ - BOOL isRootNode = (YGNodeGetParent(yogaNode) == NULL); - uint32_t childCount = YGNodeGetChildCount(yogaNode); - - NSMutableArray *sublayouts = [NSMutableArray arrayWithCapacity:childCount]; - for (uint32_t i = 0; i < childCount; i++) { - [sublayouts addObject:[self layoutForYogaNode:YGNodeGetChild(yogaNode, i)]]; - } - - id layoutElement = (__bridge id )YGNodeGetContext(yogaNode); - CGSize size = CGSizeMake(YGNodeLayoutGetWidth(yogaNode), YGNodeLayoutGetHeight(yogaNode)); - - if (isRootNode) { - // The layout for root should have position CGPointNull, but include the calculated size. - return [ASLayout layoutWithLayoutElement:layoutElement size:size sublayouts:sublayouts]; - } else { - CGPoint position = CGPointMake(YGNodeLayoutGetLeft(yogaNode), YGNodeLayoutGetTop(yogaNode)); - return [ASLayout layoutWithLayoutElement:layoutElement size:size position:position sublayouts:nil]; - } -} - -- (void)destroyYogaNode:(YGNodeRef)yogaNode -{ - // Release the __bridge_retained Context object. - __unused id element = (__bridge_transfer id)YGNodeGetContext(yogaNode); - YGNodeFree(yogaNode); -} - -- (void)setupYogaNode:(YGNodeRef)yogaNode forElement:(id )element withParentYogaNode:(YGNodeRef)parentYogaNode -{ - ASLayoutElementStyle *style = element.style; - - // Retain the Context object. This must be explicitly released with a __bridge_transfer; YGNodeFree() is not sufficient. - YGNodeSetContext(yogaNode, (__bridge_retained void *)element); - - YGNodeStyleSetDirection (yogaNode, style.direction); - - YGNodeStyleSetFlexWrap (yogaNode, style.flexWrap); - YGNodeStyleSetFlexGrow (yogaNode, style.flexGrow); - YGNodeStyleSetFlexShrink (yogaNode, style.flexShrink); - YGNODE_STYLE_SET_DIMENSION (yogaNode, FlexBasis, style.flexBasis); - - YGNodeStyleSetFlexDirection (yogaNode, yogaFlexDirection(style.flexDirection)); - YGNodeStyleSetJustifyContent(yogaNode, yogaJustifyContent(style.justifyContent)); - YGNodeStyleSetAlignSelf (yogaNode, yogaAlignSelf(style.alignSelf)); - ASStackLayoutAlignItems alignItems = style.alignItems; - if (alignItems != ASStackLayoutAlignItemsNotSet) { - YGNodeStyleSetAlignItems(yogaNode, yogaAlignItems(alignItems)); - } - - YGNodeStyleSetPositionType (yogaNode, style.positionType); - ASEdgeInsets position = style.position; - ASEdgeInsets margin = style.margin; - ASEdgeInsets padding = style.padding; - ASEdgeInsets border = style.border; - - YGEdge edge = YGEdgeLeft; - for (int i = 0; i < YGEdgeAll + 1; ++i) { - YGNODE_STYLE_SET_DIMENSION_WITH_EDGE(yogaNode, Position, dimensionForEdgeWithEdgeInsets(edge, position), edge); - YGNODE_STYLE_SET_DIMENSION_WITH_EDGE(yogaNode, Margin, dimensionForEdgeWithEdgeInsets(edge, margin), edge); - YGNODE_STYLE_SET_DIMENSION_WITH_EDGE(yogaNode, Padding, dimensionForEdgeWithEdgeInsets(edge, padding), edge); - YGNODE_STYLE_SET_FLOAT_WITH_EDGE(yogaNode, Border, dimensionForEdgeWithEdgeInsets(edge, border), edge); - edge = (YGEdge)(edge + 1); - } - - CGFloat aspectRatio = style.aspectRatio; - if (aspectRatio > FLT_EPSILON && aspectRatio < CGFLOAT_MAX / 2.0) { - YGNodeStyleSetAspectRatio(yogaNode, aspectRatio); - } - - // For the root node, we use rootConstrainedSize above. For children, consult the style for their size. - if (parentYogaNode != NULL) { - YGNodeInsertChild(parentYogaNode, yogaNode, YGNodeGetChildCount(parentYogaNode)); - - YGNODE_STYLE_SET_DIMENSION(yogaNode, Width, style.width); - YGNODE_STYLE_SET_DIMENSION(yogaNode, Height, style.height); - - YGNODE_STYLE_SET_DIMENSION(yogaNode, MinWidth, style.minWidth); - YGNODE_STYLE_SET_DIMENSION(yogaNode, MinHeight, style.minHeight); - - YGNODE_STYLE_SET_DIMENSION(yogaNode, MaxWidth, style.maxWidth); - YGNODE_STYLE_SET_DIMENSION(yogaNode, MaxHeight, style.maxHeight); - - YGNodeSetMeasureFunc(yogaNode, &ASLayoutElementYogaMeasureFunc); - } - - // TODO(appleguy): STYLE SETTER METHODS LEFT TO IMPLEMENT: YGNodeStyleSetOverflow, YGNodeStyleSetFlex -} - -- (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize - restrictedToSize:(ASLayoutElementSize)layoutElementSize - relativeToParentSize:(CGSize)parentSize -{ - ASSizeRange styleAndParentSize = ASLayoutElementSizeResolve(layoutElementSize, parentSize); - const ASSizeRange rootConstrainedSize = ASSizeRangeIntersect(constrainedSize, styleAndParentSize); - - YGNodeRef rootYogaNode = YGNodeNew(); - - // YGNodeCalculateLayout currently doesn't offer the ability to pass a minimum size (max is passed there). - // Apply the constrainedSize.min directly to the root node so that layout accounts for it. - YGNodeStyleSetMinWidth (rootYogaNode, yogaFloatForCGFloat(rootConstrainedSize.min.width)); - YGNodeStyleSetMinHeight(rootYogaNode, yogaFloatForCGFloat(rootConstrainedSize.min.height)); - - // It's crucial to set these values. YGNodeCalculateLayout has unusual behavior for its width and height parameters: - // 1. If no maximum size set, infer this means YGMeasureModeExactly. Even if a small minWidth & minHeight are set, - // these will never be used because the output size of the root will always exactly match this value. - // 2. If a maximum size is set, infer that this means YGMeasureModeAtMost, and allow down to the min* values in output. - YGNodeStyleSetMaxWidthPercent(rootYogaNode, 100.0); - YGNodeStyleSetMaxHeightPercent(rootYogaNode, 100.0); - - [self setupYogaNode:rootYogaNode forElement:self.rootNode withParentYogaNode:NULL]; - for (id child in self.children) { - YGNodeRef yogaNode = YGNodeNew(); - [self setupYogaNode:yogaNode forElement:child withParentYogaNode:rootYogaNode]; - } - - // It is crucial to use yogaFloat... to convert CGFLOAT_MAX into YGUndefined here. - YGNodeCalculateLayout(rootYogaNode, - yogaFloatForCGFloat(rootConstrainedSize.max.width), - yogaFloatForCGFloat(rootConstrainedSize.max.height), - YGDirectionInherit); - - ASLayout *layout = [self layoutForYogaNode:rootYogaNode]; - -#if YOGA_LAYOUT_LOGGING - // Concurrent layouts will interleave the NSLog messages unless we serialize. - // Use @synchornize rather than trampolining to the main thread so the tree state isn't changed. - @synchronized ([ASDisplayNode class]) { - NSLog(@"****************************************************************************"); - NSLog(@"******************** STARTING YOGA -> ASLAYOUT CREATION ********************"); - NSLog(@"****************************************************************************"); - NSLog(@"node = %@", self.rootNode); - NSLog(@"style = %@", self.rootNode.style); - YGNodePrint(rootYogaNode, (YGPrintOptions)(YGPrintOptionsStyle | YGPrintOptionsLayout)); - } - NSLog(@"rootConstraint = (%@, %@), layout = %@, sublayouts = %@", NSStringFromCGSize(rootConstrainedSize.min), NSStringFromCGSize(rootConstrainedSize.max), layout, layout.sublayouts); -#endif - - while(YGNodeGetChildCount(rootYogaNode) > 0) { - YGNodeRef yogaNode = YGNodeGetChild(rootYogaNode, 0); - [self destroyYogaNode:yogaNode]; - } - [self destroyYogaNode:rootYogaNode]; - - return layout; -} - -@end - -#endif /* YOGA */ From d28b17c87f6d7b165521f8274c3a3bb9b2420514 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Tue, 3 Jul 2018 08:39:49 -0700 Subject: [PATCH 12/97] Fix warnings and memory issues (#1003) --- Source/ASCGImageBuffer.h | 2 +- Source/ASRunLoopQueue.mm | 5 +++-- Source/ASTextNode2.mm | 4 +++- Source/Details/ASCollectionFlowLayoutDelegate.m | 2 +- Source/Private/TextExperiment/Component/ASTextLayout.m | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/ASCGImageBuffer.h b/Source/ASCGImageBuffer.h index 88f1fd9c3e..dfff516812 100644 --- a/Source/ASCGImageBuffer.h +++ b/Source/ASCGImageBuffer.h @@ -25,7 +25,7 @@ AS_SUBCLASSING_RESTRICTED @property (readonly) void *mutableBytes NS_RETURNS_INNER_POINTER; /// Don't do any drawing or call any methods after calling this. -- (CGDataProviderRef)createDataProviderAndInvalidate; +- (CGDataProviderRef)createDataProviderAndInvalidate CF_RETURNS_RETAINED; @end diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index fd7b39fd41..c14eccac51 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -101,7 +101,7 @@ static void runLoopSourceCallback(void *info) { return; } // The scope below is entered while already locked. @autorelease is crucial here; see PR 2890. - NSInteger count; + __unused NSInteger count; // Prevent static analyzer warning if release build @autoreleasepool { #if ASRunLoopQueueLoggingEnabled NSLog(@"ASDeallocQueue Processing: %lu objects destroyed", weakSelf->_queue.size()); @@ -281,7 +281,8 @@ typedef enum { - (instancetype)init { - if (self != [super init]) { + self = [super init]; + if (self == nil) { return nil; } ASDisplayNodeAssert(self.class != [ASAbstractRunLoopQueue class], @"Should never create instances of abstract class ASAbstractRunLoopQueue."); diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 6f97fa6c7e..d0513d6168 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -346,7 +346,9 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; if (_shadowOpacity > 0 && (_shadowRadius != 0 || !CGSizeEqualToSize(_shadowOffset, CGSizeZero)) && CGColorGetAlpha(_shadowColor) > 0) { NSShadow *shadow = [[NSShadow alloc] init]; if (_shadowOpacity != 1) { - shadow.shadowColor = [UIColor colorWithCGColor:CGColorCreateCopyWithAlpha(_shadowColor, _shadowOpacity * CGColorGetAlpha(_shadowColor))]; + CGColorRef shadowColorRef = CGColorCreateCopyWithAlpha(_shadowColor, _shadowOpacity * CGColorGetAlpha(_shadowColor)); + shadow.shadowColor = [UIColor colorWithCGColor:shadowColorRef]; + CGColorRelease(shadowColorRef); } else { shadow.shadowColor = [UIColor colorWithCGColor:_shadowColor]; } diff --git a/Source/Details/ASCollectionFlowLayoutDelegate.m b/Source/Details/ASCollectionFlowLayoutDelegate.m index 706ee9c872..cbcdbe048d 100644 --- a/Source/Details/ASCollectionFlowLayoutDelegate.m +++ b/Source/Details/ASCollectionFlowLayoutDelegate.m @@ -60,7 +60,7 @@ + (ASCollectionLayoutState *)calculateLayoutWithContext:(ASCollectionLayoutContext *)context { ASElementMap *elements = context.elements; - NSMutableArray *children = ASArrayByFlatMapping(elements.itemElements, ASCollectionElement *element, element.node); + NSArray *children = ASArrayByFlatMapping(elements.itemElements, ASCollectionElement *element, element.node); if (children.count == 0) { return [[ASCollectionLayoutState alloc] initWithContext:context]; } diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.m b/Source/Private/TextExperiment/Component/ASTextLayout.m index 2f475908b8..d0aceee9ac 100755 --- a/Source/Private/TextExperiment/Component/ASTextLayout.m +++ b/Source/Private/TextExperiment/Component/ASTextLayout.m @@ -1959,7 +1959,7 @@ dispatch_semaphore_signal(_lock); range = [self _correctedRangeWithEdge:range]; BOOL isVertical = _container.verticalForm; - NSMutableArray *rects = [[NSMutableArray alloc] init]; + NSMutableArray *rects = [[NSMutableArray alloc] init]; if (!range) return rects; NSUInteger startLineIndex = [self lineIndexForPosition:range.start]; From 6c487dd26c2fa9e3e5fe5f95f534b631f5db8dc4 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Fri, 6 Jul 2018 08:32:03 -0700 Subject: [PATCH 13/97] Properly consider node for responder methods (#1008) * Properly consider node for responder methods * Add changelog --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 25 +++++++++- Source/Details/_ASDisplayView.mm | 63 ++++++++++++++++++-------- Source/Private/ASDisplayNodeInternal.h | 21 +++++---- Tests/ASDisplayNodeTests.mm | 23 ++++++++++ 5 files changed, 103 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e47a52ecc5..3e027a04e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Optimize layout flattening, particularly reducing retain/release operations. [Adlai Holler](https://github.com/Adlai-Holler) - Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) - Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) +- Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 81ab1cd618..d29fa61c4d 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -154,6 +154,8 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) ASDisplayNodeCAssertNotNil(c, @"class is required"); ASDisplayNodeMethodOverrides overrides = ASDisplayNodeMethodOverrideNone; + + // Handling touches if (ASDisplayNodeSubclassOverridesSelector(c, @selector(touchesBegan:withEvent:))) { overrides |= ASDisplayNodeMethodOverrideTouchesBegan; } @@ -166,13 +168,32 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) if (ASDisplayNodeSubclassOverridesSelector(c, @selector(touchesEnded:withEvent:))) { overrides |= ASDisplayNodeMethodOverrideTouchesEnded; } + + // Responder chain + if (ASDisplayNodeSubclassOverridesSelector(c, @selector(canBecomeFirstResponder))) { + overrides |= ASDisplayNodeMethodOverrideCanBecomeFirstResponder; + } + if (ASDisplayNodeSubclassOverridesSelector(c, @selector(becomeFirstResponder))) { + overrides |= ASDisplayNodeMethodOverrideBecomeFirstResponder; + } + if (ASDisplayNodeSubclassOverridesSelector(c, @selector(canResignFirstResponder))) { + overrides |= ASDisplayNodeMethodOverrideCanResignFirstResponder; + } + if (ASDisplayNodeSubclassOverridesSelector(c, @selector(resignFirstResponder))) { + overrides |= ASDisplayNodeMethodOverrideResignFirstResponder; + } + if (ASDisplayNodeSubclassOverridesSelector(c, @selector(isFirstResponder))) { + overrides |= ASDisplayNodeMethodOverrideIsFirstResponder; + } + + // Layout related methods if (ASDisplayNodeSubclassOverridesSelector(c, @selector(layoutSpecThatFits:))) { overrides |= ASDisplayNodeMethodOverrideLayoutSpecThatFits; } if (ASDisplayNodeSubclassOverridesSelector(c, @selector(calculateLayoutThatFits:)) || ASDisplayNodeSubclassOverridesSelector(c, @selector(calculateLayoutThatFits: - restrictedToSize: - relativeToParentSize:))) { + restrictedToSize: + relativeToParentSize:))) { overrides |= ASDisplayNodeMethodOverrideCalcLayoutThatFits; } if (ASDisplayNodeSubclassOverridesSelector(c, @selector(calculateSizeThatFits:))) { diff --git a/Source/Details/_ASDisplayView.mm b/Source/Details/_ASDisplayView.mm index 2eac06bb32..21fdd17f12 100644 --- a/Source/Details/_ASDisplayView.mm +++ b/Source/Details/_ASDisplayView.mm @@ -29,6 +29,20 @@ #import #import +#pragma mark - ASDisplayNode + +/** + * Open access to the method overrides struct for ASDisplayView + */ +@implementation ASDisplayNode (ASDisplayNodeMethodOverrides_ASDisplayView) + +- (ASDisplayNodeMethodOverrides)methodOverrides +{ + return _methodOverrides; +} + +@end + #pragma mark - _ASDisplayViewMethodOverrides typedef NS_OPTIONS(NSUInteger, _ASDisplayViewMethodOverrides) @@ -452,25 +466,24 @@ static _ASDisplayViewMethodOverrides GetASDisplayViewMethodOverrides(Class c) #pragma mark UIResponder Handling -#define IMPLEMENT_RESPONDER_METHOD(__sel, __methodOverride) \ +#define IMPLEMENT_RESPONDER_METHOD(__sel, __nodeMethodOverride, __viewMethodOverride) \ - (BOOL)__sel\ {\ ASDisplayNode *node = _asyncdisplaykit_node; /* Create strong reference to weak ivar. */ \ - SEL sel = @selector(__sel); \ - /* Prevent an infinite loop in here if [super canBecomeFirstResponder] was called on a - / _ASDisplayView subclass */ \ - if (self->_methodOverrides & __methodOverride) { \ - /* Check if we can call through to ASDisplayNode subclass directly */ \ - if (ASDisplayNodeSubclassOverridesSelector([node class], sel)) { \ - return [node __sel]; \ - } else { \ - /* Call through to views superclass as we expect super was called from the - _ASDisplayView subclass and a node subclass does not overwrite canBecomeFirstResponder */ \ - return [self __##__sel]; \ - } \ + /* Check if we can call through to ASDisplayNode subclass directly */ \ + if (node.methodOverrides & __nodeMethodOverride) { \ + return [node __sel]; \ } else { \ - /* Call through to internal node __canBecomeFirstResponder that will consider the view in responding */ \ - return [node __##__sel]; \ + /* Prevent an infinite loop in here if [super __sel] was called on a \ + / _ASDisplayView subclass */ \ + if (self->_methodOverrides & __viewMethodOverride) { \ + /* Call through to views superclass as we expect super was called from the + _ASDisplayView subclass and a node subclass does not overwrite __sel */ \ + return [self __##__sel]; \ + } else { \ + /* Call through to internal node __sel method that will consider the view in responding */ \ + return [node __##__sel]; \ + } \ } \ }\ /* All __ prefixed methods are called from ASDisplayNode to let the view decide in what UIResponder state they \ @@ -480,11 +493,21 @@ are not overridden by a ASDisplayNode subclass */ \ return [super __sel]; \ } \ -IMPLEMENT_RESPONDER_METHOD(canBecomeFirstResponder, _ASDisplayViewMethodOverrideCanBecomeFirstResponder); -IMPLEMENT_RESPONDER_METHOD(becomeFirstResponder, _ASDisplayViewMethodOverrideBecomeFirstResponder); -IMPLEMENT_RESPONDER_METHOD(canResignFirstResponder, _ASDisplayViewMethodOverrideCanResignFirstResponder); -IMPLEMENT_RESPONDER_METHOD(resignFirstResponder, _ASDisplayViewMethodOverrideResignFirstResponder); -IMPLEMENT_RESPONDER_METHOD(isFirstResponder, _ASDisplayViewMethodOverrideIsFirstResponder); +IMPLEMENT_RESPONDER_METHOD(canBecomeFirstResponder, + ASDisplayNodeMethodOverrideCanBecomeFirstResponder, + _ASDisplayViewMethodOverrideCanBecomeFirstResponder); +IMPLEMENT_RESPONDER_METHOD(becomeFirstResponder, + ASDisplayNodeMethodOverrideBecomeFirstResponder, + _ASDisplayViewMethodOverrideBecomeFirstResponder); +IMPLEMENT_RESPONDER_METHOD(canResignFirstResponder, + ASDisplayNodeMethodOverrideCanResignFirstResponder, + _ASDisplayViewMethodOverrideCanResignFirstResponder); +IMPLEMENT_RESPONDER_METHOD(resignFirstResponder, + ASDisplayNodeMethodOverrideResignFirstResponder, + _ASDisplayViewMethodOverrideResignFirstResponder); +IMPLEMENT_RESPONDER_METHOD(isFirstResponder, + ASDisplayNodeMethodOverrideIsFirstResponder, + _ASDisplayViewMethodOverrideIsFirstResponder); - (BOOL)canPerformAction:(SEL)action withSender:(id)sender { diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 9146a4f1e1..252202d512 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -44,14 +44,19 @@ _ASPendingState * ASDisplayNodeGetPendingState(ASDisplayNode * node); typedef NS_OPTIONS(NSUInteger, ASDisplayNodeMethodOverrides) { - ASDisplayNodeMethodOverrideNone = 0, - ASDisplayNodeMethodOverrideTouchesBegan = 1 << 0, - ASDisplayNodeMethodOverrideTouchesCancelled = 1 << 1, - ASDisplayNodeMethodOverrideTouchesEnded = 1 << 2, - ASDisplayNodeMethodOverrideTouchesMoved = 1 << 3, - ASDisplayNodeMethodOverrideLayoutSpecThatFits = 1 << 4, - ASDisplayNodeMethodOverrideCalcLayoutThatFits = 1 << 5, - ASDisplayNodeMethodOverrideCalcSizeThatFits = 1 << 6, + ASDisplayNodeMethodOverrideNone = 0, + ASDisplayNodeMethodOverrideTouchesBegan = 1 << 0, + ASDisplayNodeMethodOverrideTouchesCancelled = 1 << 1, + ASDisplayNodeMethodOverrideTouchesEnded = 1 << 2, + ASDisplayNodeMethodOverrideTouchesMoved = 1 << 3, + ASDisplayNodeMethodOverrideLayoutSpecThatFits = 1 << 4, + ASDisplayNodeMethodOverrideCalcLayoutThatFits = 1 << 5, + ASDisplayNodeMethodOverrideCalcSizeThatFits = 1 << 6, + ASDisplayNodeMethodOverrideCanBecomeFirstResponder= 1 << 7, + ASDisplayNodeMethodOverrideBecomeFirstResponder = 1 << 8, + ASDisplayNodeMethodOverrideCanResignFirstResponder= 1 << 9, + ASDisplayNodeMethodOverrideResignFirstResponder = 1 << 10, + ASDisplayNodeMethodOverrideIsFirstResponder = 1 << 11, }; typedef NS_OPTIONS(uint_least32_t, ASDisplayNodeAtomicFlags) diff --git a/Tests/ASDisplayNodeTests.mm b/Tests/ASDisplayNodeTests.mm index 9899970071..a75f16f21d 100644 --- a/Tests/ASDisplayNodeTests.mm +++ b/Tests/ASDisplayNodeTests.mm @@ -263,6 +263,14 @@ for (ASDisplayNode *n in @[ nodes ]) {\ @end +@interface ASTestResponderNodeWithOverride : ASDisplayNode +@end +@implementation ASTestResponderNodeWithOverride +- (BOOL)canBecomeFirstResponder { + return YES; +} +@end + @interface ASTestViewController: ASViewController @end @implementation ASTestViewController @@ -353,6 +361,21 @@ for (ASDisplayNode *n in @[ nodes ]) {\ XCTAssertFalse([textNode.view isFirstResponder]); } +- (void)testResponderOverrrideCanBecomeFirstResponder +{ + UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; + ASTestResponderNodeWithOverride *node = [[ASTestResponderNodeWithOverride alloc] init]; + + // We have to add the text node to a window otherwise the responder methods responses are undefined + // This will also create the backing view of the node + [window addSubnode:node]; + [window makeKeyAndVisible]; + + XCTAssertTrue([node canBecomeFirstResponder]); + XCTAssertTrue([node becomeFirstResponder]); + XCTAssertTrue([window firstResponder] == node.view); +} + - (void)testUnsupportedResponderSetupWillThrow { ASTestResponderNode *node = [[ASTestResponderNode alloc] init]; From c8b5a1b3238d0c046abe5e8be18593a99d82f521 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Sun, 8 Jul 2018 08:55:28 -0700 Subject: [PATCH 14/97] Rewrite Swift Example (#1002) * Rewrite Swift Example * Add license header to OrderedDictionary --- .../ASDKgram/Sample.xcodeproj/project.pbxproj | 34 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../ASDKgram-Swift.xcodeproj/project.pbxproj | 54 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../ASDKgram-Swift/AppDelegate.swift | 22 +- .../ASDKgram-Swift/Constants.swift | 38 +- .../ASDKgram-Swift/ASDKgram-Swift/Date.swift | 37 +- .../ASDKgram-Swift/NetworkImageView.swift | 18 +- .../ASDKgram-Swift/NumberFormatter.swift | 26 + .../OrderedDictionary+Codable.swift | 144 ++++ .../OrderedDictionary+Description.swift | 60 ++ .../OrderedDictionary/OrderedDictionary.swift | 620 ++++++++++++++++++ .../ASDKgram-Swift/ParseResponse.swift | 31 + .../ASDKgram-Swift/PhotoFeedModel.swift | 150 +++-- .../PhotoFeedTableNodeController.swift | 93 ++- .../PhotoFeedTableViewController.swift | 61 +- .../ASDKgram-Swift/PhotoModel.swift | 180 ++--- .../ASDKgram-Swift/PhotoTableNodeCell.swift | 73 ++- .../ASDKgram-Swift/PhotoTableViewCell.swift | 32 +- .../ASDKgram-Swift/PopularPageModel.swift | 45 +- .../ASDKgram-Swift/UIColor.swift | 20 +- .../ASDKgram-Swift/UIImage.swift | 60 -- .../ASDKgram-Swift/ASDKgram-Swift/URL.swift | 60 +- .../ASDKgram-Swift/Webservice.swift | 89 ++- examples_extra/ASDKgram-Swift/Podfile | 7 +- 25 files changed, 1397 insertions(+), 573 deletions(-) create mode 100644 examples/ASDKgram/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift create mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift delete mode 100644 examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIImage.swift diff --git a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj index abafabf31f..08713d5b1b 100644 --- a/examples/ASDKgram/Sample.xcodeproj/project.pbxproj +++ b/examples/ASDKgram/Sample.xcodeproj/project.pbxproj @@ -278,8 +278,6 @@ 05E2127D19D4DB510098F589 /* Sources */, 05E2127E19D4DB510098F589 /* Frameworks */, 05E2127F19D4DB510098F589 /* Resources */, - F012A6F39E0149F18F564F50 /* [CP] Copy Pods Resources */, - 06770D39D4186D6446B1BDD5 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -338,21 +336,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 06770D39D4186D6446B1BDD5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; E080B80F89C34A25B3488E26 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -368,22 +351,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - F012A6F39E0149F18F564F50 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Sample/Pods-Sample-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/examples/ASDKgram/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/ASDKgram/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/examples/ASDKgram/Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcodeproj/project.pbxproj b/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcodeproj/project.pbxproj index 23ef18b40e..e073f01f5d 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcodeproj/project.pbxproj +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 3A2362FB1E2D33A0007E08F1 /* Date.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A2362FA1E2D33A0007E08F1 /* Date.swift */; }; - 3A7A28D91E2F7410003E2B8D /* UIImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A7A28D81E2F7410003E2B8D /* UIImage.swift */; }; 3AB33F5E1E1F94530039F711 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F5D1E1F94530039F711 /* AppDelegate.swift */; }; 3AB33F651E1F94530039F711 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3AB33F641E1F94530039F711 /* Assets.xcassets */; }; 3AB33F681E1F94530039F711 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3AB33F661E1F94530039F711 /* LaunchScreen.storyboard */; }; @@ -21,17 +20,20 @@ 3AB33F881E20ED460039F711 /* PhotoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F871E20ED460039F711 /* PhotoModel.swift */; }; 3AB33F8C1E2106F30039F711 /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F8B1E2106F30039F711 /* URL.swift */; }; 3AB33F961E2269D40039F711 /* PopularPageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F951E2269D40039F711 /* PopularPageModel.swift */; }; - 3AB33F981E22A0080039F711 /* PX500Convenience.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F971E22A0080039F711 /* PX500Convenience.swift */; }; + 3AB33F981E22A0080039F711 /* ParseResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F971E22A0080039F711 /* ParseResponse.swift */; }; 3AB33F9E1E22D9DB0039F711 /* PhotoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33F9D1E22D9DB0039F711 /* PhotoTableViewCell.swift */; }; 3AB33FA21E230A160039F711 /* NetworkImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33FA11E230A160039F711 /* NetworkImageView.swift */; }; 3AB33FA41E2337850039F711 /* PhotoTableNodeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AB33FA31E2337850039F711 /* PhotoTableNodeCell.swift */; }; + 692CD06E20E1A40D00D9B963 /* NumberFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 692CD06D20E1A40D00D9B963 /* NumberFormatter.swift */; }; 7E438240D2C4026931D60594 /* Pods_ASDKgram_Swift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7D664E4FF432C4AE232A56 /* Pods_ASDKgram_Swift.framework */; }; + 9D4DFC5E20E1DF660067C960 /* OrderedDictionary+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D4DFC5B20E1DF660067C960 /* OrderedDictionary+Codable.swift */; }; + 9D4DFC5F20E1DF660067C960 /* OrderedDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D4DFC5C20E1DF660067C960 /* OrderedDictionary.swift */; }; + 9D4DFC6020E1DF660067C960 /* OrderedDictionary+Description.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D4DFC5D20E1DF660067C960 /* OrderedDictionary+Description.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 019E984FADA258377FC6B2D8 /* Pods-ASDKgram-Swift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ASDKgram-Swift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ASDKgram-Swift/Pods-ASDKgram-Swift.debug.xcconfig"; sourceTree = ""; }; 3A2362FA1E2D33A0007E08F1 /* Date.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Date.swift; sourceTree = ""; }; - 3A7A28D81E2F7410003E2B8D /* UIImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = ""; }; 3AB33F5A1E1F94520039F711 /* ASDKgram-Swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ASDKgram-Swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 3AB33F5D1E1F94530039F711 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 3AB33F641E1F94530039F711 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -46,11 +48,15 @@ 3AB33F871E20ED460039F711 /* PhotoModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoModel.swift; sourceTree = ""; }; 3AB33F8B1E2106F30039F711 /* URL.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URL.swift; sourceTree = ""; }; 3AB33F951E2269D40039F711 /* PopularPageModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopularPageModel.swift; sourceTree = ""; }; - 3AB33F971E22A0080039F711 /* PX500Convenience.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PX500Convenience.swift; sourceTree = ""; }; + 3AB33F971E22A0080039F711 /* ParseResponse.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParseResponse.swift; sourceTree = ""; }; 3AB33F9D1E22D9DB0039F711 /* PhotoTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoTableViewCell.swift; sourceTree = ""; }; 3AB33FA11E230A160039F711 /* NetworkImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkImageView.swift; sourceTree = ""; }; 3AB33FA31E2337850039F711 /* PhotoTableNodeCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoTableNodeCell.swift; sourceTree = ""; }; 4D7D664E4FF432C4AE232A56 /* Pods_ASDKgram_Swift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ASDKgram_Swift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 692CD06D20E1A40D00D9B963 /* NumberFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberFormatter.swift; sourceTree = ""; }; + 9D4DFC5B20E1DF660067C960 /* OrderedDictionary+Codable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OrderedDictionary+Codable.swift"; sourceTree = ""; }; + 9D4DFC5C20E1DF660067C960 /* OrderedDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderedDictionary.swift; sourceTree = ""; }; + 9D4DFC5D20E1DF660067C960 /* OrderedDictionary+Description.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "OrderedDictionary+Description.swift"; sourceTree = ""; }; A3A86E74A8C3F06D7688AACB /* Pods-ASDKgram-Swift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ASDKgram-Swift.release.xcconfig"; path = "Pods/Target Support Files/Pods-ASDKgram-Swift/Pods-ASDKgram-Swift.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -87,6 +93,7 @@ 3AB33F5C1E1F94530039F711 /* ASDKgram-Swift */ = { isa = PBXGroup; children = ( + 9D4DFC5A20E1DF660067C960 /* OrderedDictionary */, 3AB33F991E22CF160039F711 /* Views */, 3AB33F841E20E98C0039F711 /* Model */, 3AB33F7D1E1FDA890039F711 /* Client */, @@ -129,10 +136,10 @@ 3AB33F791E1F9E4E0039F711 /* Extensions */ = { isa = PBXGroup; children = ( + 3A2362FA1E2D33A0007E08F1 /* Date.swift */, + 692CD06D20E1A40D00D9B963 /* NumberFormatter.swift */, 3AB33F7A1E1F9E630039F711 /* UIColor.swift */, 3AB33F8B1E2106F30039F711 /* URL.swift */, - 3A2362FA1E2D33A0007E08F1 /* Date.swift */, - 3A7A28D81E2F7410003E2B8D /* UIImage.swift */, ); name = Extensions; sourceTree = ""; @@ -141,7 +148,7 @@ isa = PBXGroup; children = ( 3AB33F801E1FDE100039F711 /* Webservice.swift */, - 3AB33F971E22A0080039F711 /* PX500Convenience.swift */, + 3AB33F971E22A0080039F711 /* ParseResponse.swift */, ); name = Client; sourceTree = ""; @@ -191,6 +198,16 @@ name = Pods; sourceTree = ""; }; + 9D4DFC5A20E1DF660067C960 /* OrderedDictionary */ = { + isa = PBXGroup; + children = ( + 9D4DFC5B20E1DF660067C960 /* OrderedDictionary+Codable.swift */, + 9D4DFC5C20E1DF660067C960 /* OrderedDictionary.swift */, + 9D4DFC5D20E1DF660067C960 /* OrderedDictionary+Description.swift */, + ); + path = OrderedDictionary; + sourceTree = ""; + }; A7DD645D70CF34C7CA3B1A8B /* Frameworks */ = { isa = PBXGroup; children = ( @@ -211,7 +228,6 @@ 3AB33F571E1F94520039F711 /* Frameworks */, 3AB33F581E1F94520039F711 /* Resources */, 154783123A953C3AFB9805CF /* [CP] Embed Pods Frameworks */, - 07D25AC7E9C9518F14F0C929 /* [CP] Copy Pods Resources */, 3A7BEDD71E254278005769D4 /* ShellScript */, ); buildRules = ( @@ -272,21 +288,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 07D25AC7E9C9518F14F0C929 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ASDKgram-Swift/Pods-ASDKgram-Swift-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 154783123A953C3AFB9805CF /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -352,14 +353,17 @@ 3AB33F781E1F9C400039F711 /* PhotoFeedTableNodeController.swift in Sources */, 3A2362FB1E2D33A0007E08F1 /* Date.swift in Sources */, 3AB33F7B1E1F9E630039F711 /* UIColor.swift in Sources */, - 3AB33F981E22A0080039F711 /* PX500Convenience.swift in Sources */, + 3AB33F981E22A0080039F711 /* ParseResponse.swift in Sources */, + 692CD06E20E1A40D00D9B963 /* NumberFormatter.swift in Sources */, 3AB33FA41E2337850039F711 /* PhotoTableNodeCell.swift in Sources */, 3AB33FA21E230A160039F711 /* NetworkImageView.swift in Sources */, + 9D4DFC6020E1DF660067C960 /* OrderedDictionary+Description.swift in Sources */, 3AB33F8C1E2106F30039F711 /* URL.swift in Sources */, 3AB33F831E20E81E0039F711 /* Constants.swift in Sources */, + 9D4DFC5F20E1DF660067C960 /* OrderedDictionary.swift in Sources */, 3AB33F961E2269D40039F711 /* PopularPageModel.swift in Sources */, - 3A7A28D91E2F7410003E2B8D /* UIImage.swift in Sources */, 3AB33F5E1E1F94530039F711 /* AppDelegate.swift in Sources */, + 9D4DFC5E20E1DF660067C960 /* OrderedDictionary+Codable.swift in Sources */, 3AB33F811E1FDE100039F711 /* Webservice.swift in Sources */, 3AB33F9E1E22D9DB0039F711 /* PhotoTableViewCell.swift in Sources */, 3AB33F861E20E9B10039F711 /* PhotoFeedModel.swift in Sources */, diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift index 886d28ca70..85b7de1078 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift @@ -2,19 +2,17 @@ // AppDelegate.swift // ASDKgram-Swift // -// Created by Calum Harris on 06/01/2017. -// // 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 UIKit @@ -42,11 +40,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let tabBarController = UITabBarController() tabBarController.viewControllers = [UIKitNavController, ASDKNavController] tabBarController.selectedIndex = 1 - tabBarController.tabBar.tintColor = UIColor.mainBarTintColor() + tabBarController.tabBar.tintColor = UIColor.mainBarTintColor // Nav Bar appearance - UINavigationBar.appearance().barTintColor = UIColor.mainBarTintColor() + UINavigationBar.appearance().barTintColor = UIColor.mainBarTintColor // UIWindow diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift index f85bb817fe..c56cc8f68c 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift @@ -2,35 +2,33 @@ // Constants // ASDKgram-Swift // -// Created by Calum Harris on 07/01/2017. -// // 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 // // swiftlint:disable nesting import UIKit struct Constants { - - struct PX500 { - struct URLS { - static let Host = "https://api.500px.com/v1/" - static let PopularEndpoint = "photos?feature=popular&exclude=Nude,People,Fashion&sort=rating&image_size=3&include_store=store_download&include_states=voted" - static let SearchEndpoint = "photos/search?geo=" //latitude,longitude,radius - static let UserEndpoint = "photos?user_id=" - static let ConsumerKey = "&consumer_key=Fi13GVb8g53sGvHICzlram7QkKOlSDmAmp9s9aqC" - } - } + struct Unsplash { + struct URLS { + static let Host = "https://api.unsplash.com/" + static let PopularEndpoint = "photos?order_by=popular" + static let SearchEndpoint = "photos/search?geo=" //latitude,longitude,radius + static let UserEndpoint = "photos?user_id=" + static let ConsumerKey = "&client_id=3b99a69cee09770a4a0bbb870b437dbda53efb22f6f6de63714b71c4df7c9642" + static let ImagesPerPage = 30 + } + } struct CellLayout { static let FontSize: CGFloat = 14 diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift index 0d7cde2d3d..df4d189a2b 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift @@ -2,25 +2,22 @@ // Date.swift // ASDKgram-Swift // -// Created by Calum Harris on 16/01/2017. -// // 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 Foundation extension Date { - static let iso8601Formatter: DateFormatter = { let formatter = DateFormatter() formatter.calendar = Calendar(identifier: .iso8601) @@ -29,4 +26,22 @@ extension Date { formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" return formatter }() + + static func timeStringSince(fromConverted date: Date) -> String { + let diffDates = NSCalendar.current.dateComponents([.day, .hour, .second], from: date, to: Date()) + + if let week = diffDates.day, week > 7 { + return "\(week / 7)w" + } else if let day = diffDates.day, day > 0 { + return "\(day)d" + } else if let hour = diffDates.hour, hour > 0 { + return "\(hour)h" + } else if let second = diffDates.second, second > 0 { + return "\(second)s" + } else if let zero = diffDates.second, zero == 0 { + return "1s" + } else { + return "ERROR" + } + } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift index aeb860d8aa..47d02a2e13 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift @@ -2,19 +2,17 @@ // NetworkImageView.swift // ASDKgram-Swift // -// Created by Calum Harris on 09/01/2017. -// // 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 UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift new file mode 100644 index 0000000000..699db03555 --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift @@ -0,0 +1,26 @@ +// +// NumberFormatter.swift +// ASDKgram-Swift +// +// 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 /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 Foundation + +extension NumberFormatter { + static let decimalNumberFormatter: NumberFormatter = { + let formatter = NumberFormatter() + formatter.numberStyle = .decimal + return formatter + }() +} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift new file mode 100644 index 0000000000..856abfefb0 --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift @@ -0,0 +1,144 @@ +/** + Copyright (c) 2015-2017 Lukas Kubanek + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +#if swift(>=4.1) + +extension OrderedDictionary: Encodable where Key: Encodable, Value: Encodable { + + /// __inheritdoc__ + public func encode(to encoder: Encoder) throws { + // Encode the ordered dictionary as an array of alternating key-value pairs. + var container = encoder.unkeyedContainer() + + for (key, value) in self { + try container.encode(key) + try container.encode(value) + } + } + +} + +extension OrderedDictionary: Decodable where Key: Decodable, Value: Decodable { + + /// __inheritdoc__ + public init(from decoder: Decoder) throws { + // Decode the ordered dictionary from an array of alternating key-value pairs. + self.init() + + var container = try decoder.unkeyedContainer() + + while !container.isAtEnd { + let key = try container.decode(Key.self) + guard !container.isAtEnd else { throw DecodingError.unkeyedContainerReachedEndBeforeValue(decoder.codingPath) } + let value = try container.decode(Value.self) + + self[key] = value + } + } + +} + +#else + +extension OrderedDictionary: Encodable { + + /// __inheritdoc__ + public func encode(to encoder: Encoder) throws { + // Since Swift 4.0 lacks the protocol conditional conformance support, we have to make the + // whole OrderedDictionary type conform to Encodable and assert that the key and value + // types conform to Encodable. Furthermore, we leverage a trick of super encoders to be + // able to encode objects without knowing their exact types. This trick was used in the + // standard library for encoding/decoding Dictionary before Swift 4.1. + + _assertTypeIsEncodable(Key.self, in: type(of: self)) + _assertTypeIsEncodable(Value.self, in: type(of: self)) + + var container = encoder.unkeyedContainer() + + for (key, value) in self { + let keyEncoder = container.superEncoder() + try (key as! Encodable).encode(to: keyEncoder) + + let valueEncoder = container.superEncoder() + try (value as! Encodable).encode(to: valueEncoder) + } + } + + private func _assertTypeIsEncodable(_ type: T.Type, in wrappingType: Any.Type) { + guard T.self is Encodable.Type else { + if T.self == Encodable.self || T.self == Codable.self { + preconditionFailure("\(wrappingType) does not conform to Encodable because Encodable does not conform to itself. You must use a concrete type to encode or decode.") + } else { + preconditionFailure("\(wrappingType) does not conform to Encodable because \(T.self) does not conform to Encodable.") + } + } + } + +} + +extension OrderedDictionary: Decodable { + + /// __inheritdoc__ + public init(from decoder: Decoder) throws { + // Since Swift 4.0 lacks the protocol conditional conformance support, we have to make the + // whole OrderedDictionary type conform to Decodable and assert that the key and value + // types conform to Decodable. Furthermore, we leverage a trick of super decoders to be + // able to decode objects without knowing their exact types. This trick was used in the + // standard library for encoding/decoding Dictionary before Swift 4.1. + + self.init() + + _assertTypeIsDecodable(Key.self, in: type(of: self)) + _assertTypeIsDecodable(Value.self, in: type(of: self)) + + var container = try decoder.unkeyedContainer() + + let keyMetaType = (Key.self as! Decodable.Type) + let valueMetaType = (Value.self as! Decodable.Type) + + while !container.isAtEnd { + let keyDecoder = try container.superDecoder() + let key = try keyMetaType.init(from: keyDecoder) as! Key + + guard !container.isAtEnd else { throw DecodingError.unkeyedContainerReachedEndBeforeValue(decoder.codingPath) } + + let valueDecoder = try container.superDecoder() + let value = try valueMetaType.init(from: valueDecoder) as! Value + + self[key] = value + } + } + + private func _assertTypeIsDecodable(_ type: T.Type, in wrappingType: Any.Type) { + guard T.self is Decodable.Type else { + if T.self == Decodable.self || T.self == Codable.self { + preconditionFailure("\(wrappingType) does not conform to Decodable because Decodable does not conform to itself. You must use a concrete type to encode or decode.") + } else { + preconditionFailure("\(wrappingType) does not conform to Decodable because \(T.self) does not conform to Decodable.") + } + } + } + +} + +#endif + +fileprivate extension DecodingError { + + fileprivate static func unkeyedContainerReachedEndBeforeValue(_ codingPath: [CodingKey]) -> DecodingError { + return DecodingError.dataCorrupted( + DecodingError.Context( + codingPath: codingPath, + debugDescription: "Unkeyed container reached end before value in key-value pair." + ) + ) + } + +} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift new file mode 100644 index 0000000000..eca85b633d --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift @@ -0,0 +1,60 @@ +/** + Copyright (c) 2015-2017 Lukas Kubanek + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +extension OrderedDictionary: CustomStringConvertible { + + /// A textual representation of the ordered dictionary. + public var description: String { + return makeDescription(debug: false) + } + +} + +extension OrderedDictionary: CustomDebugStringConvertible { + + /// A textual representation of the ordered dictionary, suitable for debugging. + public var debugDescription: String { + return makeDescription(debug: true) + } + +} + +extension OrderedDictionary { + + fileprivate func makeDescription(debug: Bool) -> String { + // The implementation of the description is inspired by zwaldowski's implementation of the + // ordered dictionary. See http://bit.ly/2iqGhrb + + if isEmpty { return "[:]" } + + let printFunction: (Any, inout String) -> () = { + if debug { + return { debugPrint($0, separator: "", terminator: "", to: &$1) } + } else { + return { print($0, separator: "", terminator: "", to: &$1) } + } + }() + + let descriptionForItem: (Any) -> String = { item in + var description = "" + printFunction(item, &description) + return description + } + + let bodyComponents = map { element in + return descriptionForItem(element.key) + ": " + descriptionForItem(element.value) + } + + let body = bodyComponents.joined(separator: ", ") + + return "[\(body)]" + } + +} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift new file mode 100644 index 0000000000..961173e01c --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift @@ -0,0 +1,620 @@ +/** + Copyright (c) 2015-2017 Lukas Kubanek + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. + */ + +/// A generic collection for storing key-value pairs in an ordered manner. +/// +/// Same as in a dictionary all keys in the collection are unique and have an associated value. +/// Same as in an array, all key-value pairs (elements) are kept sorted and accessible by +/// a zero-based integer index. +public struct OrderedDictionary: BidirectionalCollection { + + // ======================================================= // + // MARK: - Type Aliases + // ======================================================= // + + /// The type of the key-value pair stored in the ordered dictionary. + public typealias Element = (key: Key, value: Value) + + /// The type of the index. + public typealias Index = Int + + /// The type of the indices collection. + public typealias Indices = CountableRange + + /// The type of the contiguous subrange of the ordered dictionary's elements. + /// + /// - SeeAlso: OrderedDictionarySlice + public typealias SubSequence = OrderedDictionarySlice + + // ======================================================= // + // MARK: - Initialization + // ======================================================= // + + /// Creates an empty ordered dictionary. + public init() {} + + /// Creates an ordered dictionary from a sequence of values keyed by a key which gets extracted + /// from the value in the provided closure. + /// + /// - Parameter values: The sequence of values. + /// - Parameter getKey: The closure which provides a key for the given value from the values + /// sequence. + public init(values: Values, keyedBy getKey: (Value) -> Key) where Values.Element == Value { + self.init(values.map { (getKey($0), $0) }) + } + + /// Creates an ordered dictionary from a sequence of values keyed by a key loaded from the value + /// at the given key path. + /// + /// - Parameter values: The sequence of values. + /// - Parameter keyPath: The key path for the value to locate its key at. + public init(values: [Value], keyedBy keyPath: KeyPath) { + self.init(values.map { ($0[keyPath: keyPath], $0) }) + } + + /// Creates an ordered dictionary from a regular unsorted dictionary by sorting it using the + /// the given sort function. + /// + /// - Parameter unsorted: The unsorted dictionary. + /// - Parameter areInIncreasingOrder: The sort function which compares the key-value pairs. + public init(unsorted: Dictionary, areInIncreasingOrder: (Element, Element) -> Bool) { + let elements = unsorted + .map { (key: $0.key, value: $0.value) } + .sorted(by: areInIncreasingOrder) + + self.init(elements) + } + + /// Creates an ordered dictionary from a sequence of key-value pairs. + /// + /// - Parameter elements: The key-value pairs that will make up the new ordered dictionary. + /// Each key in `elements` must be unique. + public init(_ elements: S) where S.Element == Element { + for (key, value) in elements { + precondition(!containsKey(key), "Elements sequence contains duplicate keys") + self[key] = value + } + } + + // ======================================================= // + // MARK: - Ordered Keys & Values + // ======================================================= // + + /// A collection containing just the keys of the ordered dictionary in the correct order. + public var orderedKeys: OrderedDictionaryKeys { + return self.lazy.map { $0.key } + } + + /// A collection containing just the values of the ordered dictionary in the correct order. + public var orderedValues: OrderedDictionaryValues { + return self.lazy.map { $0.value } + } + + // ======================================================= // + // MARK: - Dictionary + // ======================================================= // + + /// Converts itself to a common unsorted dictionary. + public var unorderedDictionary: Dictionary { + return _keysToValues + } + + // ======================================================= // + // MARK: - Key-based Access + // ======================================================= // + + /// Accesses the value associated with the given key for reading and writing. + /// + /// This key-based subscript returns the value for the given key if the key is found in the + /// ordered dictionary, or `nil` if the key is not found. + /// + /// When you assign a value for a key and that key already exists, the ordered dictionary + /// overwrites the existing value and preservers the index of the key-value pair. If the ordered + /// dictionary does not contain the key, a new key-value pair is appended to the end of the + /// ordered dictionary. + /// + /// If you assign `nil` as the value for the given key, the ordered dictionary removes that key + /// and its associated value if it exists. + /// + /// - Parameter key: The key to find in the ordered dictionary. + /// - Returns: The value associated with `key` if `key` is in the ordered dictionary; otherwise, + /// `nil`. + public subscript(key: Key) -> Value? { + get { + return value(forKey: key) + } + set(newValue) { + if let newValue = newValue { + updateValue(newValue, forKey: key) + } else { + removeValue(forKey: key) + } + } + } + + /// Returns a Boolean value indicating whether the ordered dictionary contains the given key. + /// + /// - Parameter key: The key to be looked up. + /// - Returns: `true` if the ordered dictionary contains the given key; otherwise, `false`. + public func containsKey(_ key: Key) -> Bool { + return _keysToValues[key] != nil + } + + /// Returns the value associated with the given key if the key is found in the ordered + /// dictionary, or `nil` if the key is not found. + /// + /// - Parameter key: The key to find in the ordered dictionary. + /// - Returns: The value associated with `key` if `key` is in the ordered dictionary; otherwise, + /// `nil`. + public func value(forKey key: Key) -> Value? { + return _keysToValues[key] + } + + /// Updates the value stored in the ordered dictionary for the given key, or appends a new + /// key-value pair if the key does not exist. + /// + /// - Parameter value: The new value to add to the ordered dictionary. + /// - Parameter key: The key to associate with `value`. If `key` already exists in the ordered + /// dictionary, `value` replaces the existing associated value. If `key` is not already a key + /// of the ordered dictionary, the `(key, value)` pair is appended at the end of the ordered + /// dictionary. + @discardableResult + public mutating func updateValue(_ value: Value, forKey key: Key) -> Value? { + if containsKey(key) { + let currentValue = _unsafeValue(forKey: key) + + _keysToValues[key] = value + + return currentValue + } else { + _orderedKeys.append(key) + _keysToValues[key] = value + + return nil + } + } + + /// Removes the given key and its associated value from the ordered dictionary. + /// + /// If the key is found in the ordered dictionary, this method returns the key's associated + /// value. On removal, the indices of the ordered dictionary are invalidated. If the key is + /// not found in the ordered dictionary, this method returns `nil`. + /// + /// - Parameter key: The key to remove along with its associated value. + /// - Returns: The value that was removed, or `nil` if the key was not present in the + /// ordered dictionary. + /// + /// - SeeAlso: remove(at:) + @discardableResult + public mutating func removeValue(forKey key: Key) -> Value? { + guard let index = index(forKey: key) else { return nil } + + let currentValue = self[index].value + + _orderedKeys.remove(at: index) + _keysToValues[key] = nil + + return currentValue + } + + /// Removes all key-value pairs from the ordered dictionary and invalidates all indices. + /// + /// - Parameter keepCapacity: Whether the ordered dictionary should keep its underlying storage. + /// If you pass `true`, the operation preserves the storage capacity that the collection has, + /// otherwise the underlying storage is released. The default is `false`. + public mutating func removeAll(keepingCapacity keepCapacity: Bool = false) { + _orderedKeys.removeAll(keepingCapacity: keepCapacity) + _keysToValues.removeAll(keepingCapacity: keepCapacity) + } + + private func _unsafeValue(forKey key: Key) -> Value { + let value = _keysToValues[key] + precondition(value != nil, "Inconsistency error occurred in OrderedDictionary") + return value! + } + + // ======================================================= // + // MARK: - Index-based Access + // ======================================================= // + + /// Accesses the key-value pair at the specified position. + /// + /// The specified position has to be a valid index of the ordered dictionary. The index-base + /// subscript returns the key-value pair corresponding to the index. + /// + /// - Parameter position: The position of the key-value pair to access. `position` must be + /// a valid index of the ordered dictionary and not equal to `endIndex`. + /// - Returns: A tuple containing the key-value pair corresponding to `position`. + /// + /// - SeeAlso: update(:at:) + public subscript(position: Index) -> Element { + precondition(indices.contains(position), "OrderedDictionary index is out of range") + + let key = _orderedKeys[position] + let value = _unsafeValue(forKey: key) + + return (key, value) + } + + /// Returns the index for the given key. + /// + /// - Parameter key: The key to find in the ordered dictionary. + /// - Returns: The index for `key` and its associated value if `key` is in the ordered + /// dictionary; otherwise, `nil`. + public func index(forKey key: Key) -> Index? { + return _orderedKeys.index(of: key) + } + + /// Returns the key-value pair at the specified index, or `nil` if there is no key-value pair + /// at that index. + /// + /// - Parameter index: The index of the key-value pair to be looked up. `index` does not have to + /// be a valid index. + /// - Returns: A tuple containing the key-value pair corresponding to `index` if the index is + /// valid; otherwise, `nil`. + public func elementAt(_ index: Index) -> Element? { + return indices.contains(index) ? self[index] : nil + } + + /// Checks whether the given key-value pair can be inserted into to ordered dictionary by + /// validating the presence of the key. + /// + /// - Parameter newElement: The key-value pair to be inserted into the ordered dictionary. + /// - Returns: `true` if the key-value pair can be safely inserted; otherwise, `false`. + /// + /// - SeeAlso: canInsert(key:) + /// - SeeAlso: canInsert(at:) + @available(*, deprecated, message: "Use canInsert(key:) with the element's key instead") + public func canInsert(_ newElement: Element) -> Bool { + return canInsert(key: newElement.key) + } + + /// Checks whether a key-value pair with the given key can be inserted into the ordered + /// dictionary by validating its presence. + /// + /// - Parameter key: The key to be inserted into the ordered dictionary. + /// - Returns: `true` if the key can safely be inserted; ortherwise, `false`. + /// + /// - SeeAlso: canInsert(at:) + public func canInsert(key: Key) -> Bool { + return !containsKey(key) + } + + /// Checks whether a new key-value pair can be inserted into the ordered dictionary at the + /// given index. + /// + /// - Parameter index: The index the new key-value pair should be inserted at. + /// - Returns: `true` if a new key-value pair can be inserted at the specified index; otherwise, + /// `false`. + /// + /// - SeeAlso: canInsert(key:) + public func canInsert(at index: Index) -> Bool { + return index >= startIndex && index <= endIndex + } + + /// Inserts a new key-value pair at the specified position. + /// + /// If the key of the inserted pair already exists in the ordered dictionary, a runtime error + /// is triggered. Use `canInsert(_:)` for performing a check first, so that this method can + /// be executed safely. + /// + /// - Parameter newElement: The new key-value pair to insert into the ordered dictionary. The + /// key contained in the pair must not be already present in the ordered dictionary. + /// - Parameter index: The position at which to insert the new key-value pair. `index` must be + /// a valid index of the ordered dictionary or equal to `endIndex` property. + /// + /// - SeeAlso: canInsert(key:) + /// - SeeAlso: canInsert(at:) + /// - SeeAlso: update(:at:) + public mutating func insert(_ newElement: Element, at index: Index) { + precondition(canInsert(key: newElement.key), "Cannot insert duplicate key in OrderedDictionary") + precondition(canInsert(at: index), "Cannot insert at invalid index in OrderedDictionary") + + let (key, value) = newElement + + _orderedKeys.insert(key, at: index) + _keysToValues[key] = value + } + + /// Checks whether the key-value pair at the given index can be updated with the given key-value + /// pair. This is not the case if the key of the updated element is already present in the + /// ordered dictionary and located at another index than the updated one. + /// + /// Although this is a checking method, a valid index has to be provided. + /// + /// - Parameter newElement: The key-value pair to be set at the specified position. + /// - Parameter index: The position at which to set the key-value pair. `index` must be a valid + /// index of the ordered dictionary. + public func canUpdate(_ newElement: Element, at index: Index) -> Bool { + var keyPresentAtIndex = false + return _canUpdate(newElement, at: index, keyPresentAtIndex: &keyPresentAtIndex) + } + + /// Updates the key-value pair located at the specified position. + /// + /// If the key of the updated pair already exists in the ordered dictionary *and* is located at + /// a different position than the specified one, a runtime error is triggered. Use + /// `canUpdate(_:at:)` for performing a check first, so that this method can be executed safely. + /// + /// - Parameter newElement: The key-value pair to be set at the specified position. + /// - Parameter index: The position at which to set the key-value pair. `index` must be a valid + /// index of the ordered dictionary. + /// + /// - SeeAlso: canUpdate(_:at:) + /// - SeeAlso: insert(:at:) + @discardableResult + public mutating func update(_ newElement: Element, at index: Index) -> Element? { + // Store the flag indicating whether the key of the inserted element + // is present at the updated index + var keyPresentAtIndex = false + + precondition( + _canUpdate(newElement, at: index, keyPresentAtIndex: &keyPresentAtIndex), + "OrderedDictionary update duplicates key" + ) + + // Decompose the element + let (key, value) = newElement + + // Load the current element at the index + let replacedElement = self[index] + + // If its key differs, remove its associated value + if (!keyPresentAtIndex) { + _keysToValues.removeValue(forKey: replacedElement.key) + } + + // Store the new position of the key and the new value associated with the key + _orderedKeys[index] = key + _keysToValues[key] = value + + return replacedElement + } + + /// Removes and returns the key-value pair at the specified position if there is any key-value + /// pair, or `nil` if there is none. + /// + /// - Parameter index: The position of the key-value pair to remove. + /// - Returns: The element at the specified index, or `nil` if the position is not taken. + /// + /// - SeeAlso: removeValue(forKey:) + @discardableResult + public mutating func remove(at index: Index) -> Element? { + guard let element = elementAt(index) else { return nil } + + _orderedKeys.remove(at: index) + _keysToValues.removeValue(forKey: element.key) + + return element + } + + private func _canUpdate(_ newElement: Element, at index: Index, keyPresentAtIndex: inout Bool) -> Bool { + precondition(indices.contains(index), "OrderedDictionary index is out of range") + + let currentIndexOfKey = self.index(forKey: newElement.key) + + let keyNotPresent = currentIndexOfKey == nil + keyPresentAtIndex = currentIndexOfKey == index + + return keyNotPresent || keyPresentAtIndex + } + + // ======================================================= // + // MARK: - Moving Elements + // ======================================================= // + + /// Moves an existing key-value pair specified by the given key to the new index by removing it + /// from its original index first and inserting it at the new index. If the movement is + /// actually performed, the previous index of the key-value pair is returned. Otherwise, `nil` + /// is returned. + /// + /// - Parameter key: The key specifying the key-value pair to move. + /// - Parameter newIndex: The new index the key-value pair should be moved to. + /// - Returns: The previous index of the key-value pair if it was sucessfully moved. + @discardableResult + public mutating func moveElement(forKey key: Key, to newIndex: Index) -> Index? { + // Load the previous index and return nil if the index is not found. + guard let previousIndex = index(forKey: key) else { return nil } + + // If the previous and new indices match, threat it as if the movement was already + // performed. + guard previousIndex != newIndex else { return previousIndex } + + // Remove the value for the key at its original index. + let value = removeValue(forKey: key)! + + // Validate the new index. + precondition(canInsert(at: newIndex), "Cannot move to invalid index in OrderedDictionary") + + // Insert the element at the new index. + insert((key: key, value: value), at: newIndex) + + return previousIndex + } + + // ======================================================= // + // MARK: - Sorting Elements + // ======================================================= // + + /// Sorts the ordered dictionary in place, using the given predicate as the comparison between + /// elements. + /// + /// The predicate must be a *strict weak ordering* over the elements. + /// + /// - Parameter areInIncreasingOrder: A predicate that returns `true` if its first argument + /// should be ordered before its second argument; otherwise, `false`. + /// + /// - SeeAlso: MutableCollection.sort(by:), sorted(by:) + public mutating func sort(by areInIncreasingOrder: (Element, Element) -> Bool) { + _orderedKeys = _sortedElements(by: areInIncreasingOrder).map { $0.key } + } + + /// Returns a new ordered dictionary, sorted using the given predicate as the comparison between + /// elements. + /// + /// The predicate must be a *strict weak ordering* over the elements. + /// + /// - Parameter areInIncreasingOrder: A predicate that returns `true` if its first argument + /// should be ordered before its second argument; otherwise, `false`. + /// - Returns: A new ordered dictionary sorted according to the predicate. + /// + /// - SeeAlso: MutableCollection.sorted(by:), sort(by:) + /// - MutatingVariant: sort + public func sorted(by areInIncreasingOrder: (Element, Element) -> Bool) -> OrderedDictionary { + return OrderedDictionary(_sortedElements(by: areInIncreasingOrder)) + } + + private func _sortedElements(by areInIncreasingOrder: (Element, Element) -> Bool) -> [Element] { + return sorted(by: areInIncreasingOrder) + } + + // ======================================================= // + // MARK: - Slices + // ======================================================= // + + /// Accesses a contiguous subrange of the ordered dictionary. + /// + /// - Parameter bounds: A range of the ordered dictionary's indices. The bounds of the range + /// must be valid indices of the ordered dictionary. + /// - Returns: The slice view at the ordered dictionary in the specified subrange. + public subscript(bounds: Range) -> SubSequence { + return OrderedDictionarySlice(base: self, bounds: bounds) + } + + // ======================================================= // + // MARK: - Indices + // ======================================================= // + + /// The indices that are valid for subscripting the ordered dictionary. + public var indices: Indices { + return _orderedKeys.indices + } + + /// The position of the first key-value pair in a non-empty ordered dictionary. + public var startIndex: Index { + return _orderedKeys.startIndex + } + + /// The position which is one greater than the position of the last valid key-value pair in the + /// ordered dictionary. + public var endIndex: Index { + return _orderedKeys.endIndex + } + + /// Returns the position immediately after the given index. + public func index(after i: Index) -> Index { + return _orderedKeys.index(after: i) + } + + /// Returns the position immediately before the given index. + public func index(before i: Index) -> Index { + return _orderedKeys.index(before: i) + } + + // ======================================================= // + // MARK: - Internal Storage + // ======================================================= // + + /// The backing storage for the ordered keys. + fileprivate var _orderedKeys = [Key]() + + /// The backing storage for the mapping of keys to values. + fileprivate var _keysToValues = [Key: Value]() + +} + +// ======================================================= // +// MARK: - Subtypes +// ======================================================= // + +#if swift(>=4.1) + +/// A view into an ordered dictionary whose indices are a subrange of the indices of the ordered +/// dictionary. +public typealias OrderedDictionarySlice = Slice> + +/// A collection containing the keys of the ordered dictionary. +/// +/// Under the hood this is a lazily evaluated bidirectional collection deriving the keys from +/// the base ordered dictionary on-the-fly. +public typealias OrderedDictionaryKeys = LazyMapCollection, Key> + +/// A collection containing the values of the ordered dictionary. +/// +/// Under the hood this is a lazily evaluated bidirectional collection deriving the values from +/// the base ordered dictionary on-the-fly. +public typealias OrderedDictionaryValues = LazyMapCollection, Value> + +#else + +/// A view into an ordered dictionary whose indices are a subrange of the indices of the ordered +/// dictionary. +public typealias OrderedDictionarySlice = Slice> + +/// A collection containing the keys of the ordered dictionary. +/// +/// Under the hood this is a lazily evaluated bidirectional collection deriving the keys from +/// the base ordered dictionary on-the-fly. +public typealias OrderedDictionaryKeys = LazyMapCollection, Key> + +/// A collection containing the values of the ordered dictionary. +/// +/// Under the hood this is a lazily evaluated bidirectional collection deriving the values from +/// the base ordered dictionary on-the-fly. +public typealias OrderedDictionaryValues = LazyMapCollection, Value> + +#endif + +// ======================================================= // +// MARK: - Literals +// ======================================================= // + +extension OrderedDictionary: ExpressibleByArrayLiteral { + + /// Creates an ordered dictionary initialized from an array literal containing a list of + /// key-value pairs. + public init(arrayLiteral elements: Element...) { + self.init(elements) + } + +} + +extension OrderedDictionary: ExpressibleByDictionaryLiteral { + + /// Creates an ordered dictionary initialized from a dictionary literal. + public init(dictionaryLiteral elements: (Key, Value)...) { + self.init(elements.map { element in + let (key, value) = element + return (key: key, value: value) + }) + } + +} + +// ======================================================= // +// MARK: - Equatable Conformance +// ======================================================= // + +#if swift(>=4.1) + +extension OrderedDictionary: Equatable where Value: Equatable {} + +#endif + +extension OrderedDictionary where Value: Equatable { + + /// Returns a Boolean value that indicates whether the two given ordered dictionaries with + /// equatable values are equal. + public static func == (lhs: OrderedDictionary, rhs: OrderedDictionary) -> Bool { + return lhs._orderedKeys == rhs._orderedKeys + && lhs._keysToValues == rhs._keysToValues + } + +} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift new file mode 100644 index 0000000000..5a82c1014c --- /dev/null +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift @@ -0,0 +1,31 @@ +// +// ParseResponse.swift +// ASDKgram-Swift +// +// 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 /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 Foundation + +func parsePopularPage(withURL: URL, page: Int) -> Resource { + let parse = Resource(url: withURL, page: page) { metaData, jsonData in + do { + let photos = try JSONDecoder().decode([PhotoModel].self, from: jsonData) + return .success(PopularPageModel(metaData: metaData, photos: photos)) + } catch { + return .failure(.errorParsingJSON) + } + } + + return parse +} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift index f344df34a7..9e7cca4cae 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift @@ -2,116 +2,114 @@ // PhotoFeedModel.swift // ASDKgram-Swift // -// Created by Calum Harris on 07/01/2017. -// // 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 UIKit final class PhotoFeedModel { + + // MARK: Properties public private(set) var photoFeedModelType: PhotoFeedModelType - public private(set) var photos: [PhotoModel] = [] - public private(set) var imageSize: CGSize - private var url: URL - private var ids: [Int] = [] + + private var orderedPhotos: OrderedDictionary = [:] private var currentPage: Int = 0 private var totalPages: Int = 0 - public private(set) var totalItems: Int = 0 + private var totalItems: Int = 0 private var fetchPageInProgress: Bool = false - private var refreshFeedInProgress: Bool = false - init(initWithPhotoFeedModelType: PhotoFeedModelType, requiredImageSize: CGSize) { - self.photoFeedModelType = initWithPhotoFeedModelType - self.imageSize = requiredImageSize - self.url = URL.URLForFeedModelType(feedModelType: initWithPhotoFeedModelType) - } + // MARK: Lifecycle - var numberOfItemsInFeed: Int { - return photos.count + init(photoFeedModelType: PhotoFeedModelType) { + self.photoFeedModelType = photoFeedModelType } + + // MARK: API + + lazy var url: URL = { + return URL.URLForFeedModelType(feedModelType: self.photoFeedModelType) + }() + + var numberOfItems: Int { + return orderedPhotos.count + } + + func itemAtIndexPath(_ indexPath: IndexPath) -> PhotoModel { + return orderedPhotos[indexPath.row].value + } // return in completion handler the number of additions and the status of internet connection func updateNewBatchOfPopularPhotos(additionsAndConnectionStatusCompletion: @escaping (Int, InternetStatus) -> ()) { + + // For this example let's use the main thread as locking queue + DispatchQueue.main.async { + guard !self.fetchPageInProgress else { + return + } - guard !fetchPageInProgress else { return } + self.fetchPageInProgress = true + self.fetchNextPageOfPopularPhotos(replaceData: false) { [unowned self] additions, error in + self.fetchPageInProgress = false - fetchPageInProgress = true - fetchNextPageOfPopularPhotos(replaceData: false) { [unowned self] additions, errors in - self.fetchPageInProgress = false - - if let error = errors { - switch error { - case .noInternetConnection: - additionsAndConnectionStatusCompletion(0, .noConnection) - default: additionsAndConnectionStatusCompletion(0, .connected) - } - } else { - additionsAndConnectionStatusCompletion(additions, .connected) - } - } + if let error = error { + switch error { + case .noInternetConnection: + additionsAndConnectionStatusCompletion(0, .noConnection) + default: + additionsAndConnectionStatusCompletion(0, .connected) + } + } else { + additionsAndConnectionStatusCompletion(additions, .connected) + } + } + } } - private func fetchNextPageOfPopularPhotos(replaceData: Bool, numberOfAdditionsCompletion: @escaping (Int, NetworkingErrors?) -> ()) { - + private func fetchNextPageOfPopularPhotos(replaceData: Bool, numberOfAdditionsCompletion: @escaping (Int, NetworkingError?) -> ()) { if currentPage == totalPages, currentPage != 0 { - DispatchQueue.main.async { - numberOfAdditionsCompletion(0, .customError("No pages left to parse")) - } + numberOfAdditionsCompletion(0, .customError("No pages left to parse")) return } - var newPhotos: [PhotoModel] = [] - var newIDs: [Int] = [] - let pageToFetch = currentPage + 1 - - let url = self.url.addImageParameterForClosestImageSizeAndpage(size: imageSize, page: pageToFetch) - - WebService().load(resource: parsePopularPage(withURL: url)) { [unowned self] result in - + WebService().load(resource: parsePopularPage(withURL: url, page: pageToFetch)) { [unowned self] result in + // Callback will happen on main for now switch result { - case .success(let popularPage): - self.totalItems = popularPage.totalNumberOfItems - self.totalPages = popularPage.totalPages - self.currentPage = popularPage.page + case .success(let itemsPage): + // Update current state + self.totalItems = itemsPage.totalNumberOfItems + self.totalPages = itemsPage.totalPages + self.currentPage = itemsPage.page - for photo in popularPage.photos { - if !replaceData || !self.ids.contains(photo.photoID) { - newPhotos.append(photo) - newIDs.append(photo.photoID) - } - } - - DispatchQueue.main.async { - if replaceData { - self.photos = newPhotos - self.ids = newIDs - } else { - self.photos += newPhotos - self.ids += newIDs - } - - numberOfAdditionsCompletion(newPhotos.count, nil) - } + // Update photos + if replaceData { + self.orderedPhotos = [] + } + var insertedItems = 0 + for photo in itemsPage.photos { + if !self.orderedPhotos.containsKey(photo.photoID) { + // Append a new key-value pair by setting a value for an non-existent key + self.orderedPhotos[photo.photoID] = photo + insertedItems += 1 + } + } + numberOfAdditionsCompletion(insertedItems, nil) case .failure(let fail): - print(fail) - DispatchQueue.main.async { + print(fail) numberOfAdditionsCompletion(0, fail) - } } } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift index 08c1bc3273..51d509ed84 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift @@ -2,103 +2,102 @@ // PhotoFeedTableNodeController.swift // ASDKgram-Swift // -// Created by Calum Harris on 06/01/2017. -// // 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 AsyncDisplayKit class PhotoFeedTableNodeController: ASViewController { + + // MARK: Lifecycle - var activityIndicator: UIActivityIndicatorView! - var photoFeed: PhotoFeedModel + private lazy var activityIndicatorView: UIActivityIndicatorView = { + return UIActivityIndicatorView(activityIndicatorStyle: .gray) + }() + + var photoFeedModel = PhotoFeedModel(photoFeedModelType: .photoFeedModelTypePopular) init() { - photoFeed = PhotoFeedModel(initWithPhotoFeedModelType: .photoFeedModelTypePopular, requiredImageSize: screenSizeForWidth) - super.init(node: ASTableNode()) - self.navigationItem.title = "ASDK" + super.init(node: ASTableNode()) + navigationItem.title = "ASDK" } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + // MAKR: UIViewController override func viewDidLoad() { super.viewDidLoad() - setupActivityIndicator() + node.allowsSelection = false - node.view.separatorStyle = .none node.dataSource = self node.delegate = self node.leadingScreensForBatching = 2.5 - navigationController?.hidesBarsOnSwipe = true + node.view.separatorStyle = .none + + navigationController?.hidesBarsOnSwipe = true + + node.view.addSubview(activityIndicatorView) } - - // helper functions - func setupActivityIndicator() { - let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) - self.activityIndicator = activityIndicator - let bounds = self.node.frame - var refreshRect = activityIndicator.frame - refreshRect.origin = CGPoint(x: (bounds.size.width - activityIndicator.frame.size.width) / 2.0, y: (bounds.size.height - activityIndicator.frame.size.height) / 2.0) - activityIndicator.frame = refreshRect - self.node.view.addSubview(activityIndicator) - } - - var screenSizeForWidth: CGSize = { - let screenRect = UIScreen.main.bounds - let screenScale = UIScreen.main.scale - return CGSize(width: screenRect.size.width * screenScale, height: screenRect.size.width * screenScale) - }() + + override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + // Center the activity indicator view + let bounds = node.bounds + activityIndicatorView.frame.origin = CGPoint( + x: (bounds.width - activityIndicatorView.frame.width) / 2.0, + y: (bounds.height - activityIndicatorView.frame.height) / 2.0 + ) + } func fetchNewBatchWithContext(_ context: ASBatchContext?) { DispatchQueue.main.async { - self.activityIndicator.startAnimating() + self.activityIndicatorView.startAnimating() } - photoFeed.updateNewBatchOfPopularPhotos() { additions, connectionStatus in + photoFeedModel.updateNewBatchOfPopularPhotos() { additions, connectionStatus in switch connectionStatus { case .connected: - self.activityIndicator.stopAnimating() + self.activityIndicatorView.stopAnimating() self.addRowsIntoTableNode(newPhotoCount: additions) context?.completeBatchFetching(true) case .noConnection: - self.activityIndicator.stopAnimating() - if context != nil { - context!.completeBatchFetching(true) - } - break + self.activityIndicatorView.stopAnimating() + context?.completeBatchFetching(true) } } } func addRowsIntoTableNode(newPhotoCount newPhotos: Int) { - let indexRange = (photoFeed.photos.count - newPhotos.. Int { - return photoFeed.numberOfItemsInFeed + return photoFeedModel.numberOfItems } func tableNode(_ tableNode: ASTableNode, nodeBlockForRowAt indexPath: IndexPath) -> ASCellNodeBlock { - let photo = photoFeed.photos[indexPath.row] + let photo = photoFeedModel.itemAtIndexPath(indexPath) let nodeBlock: ASCellNodeBlock = { _ in return PhotoTableNodeCell(photoModel: photo) } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift index 0e7cbef975..e09b896073 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift @@ -2,19 +2,17 @@ // PhotoFeedTableViewController.swift // ASDKgram-Swift // -// Created by Calum Harris on 06/01/2017. -// // 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 UIKit @@ -22,13 +20,12 @@ import UIKit class PhotoFeedTableViewController: UITableViewController { var activityIndicator: UIActivityIndicatorView! - var photoFeed: PhotoFeedModel + var photoFeed = PhotoFeedModel(photoFeedModelType: .photoFeedModelTypePopular) init() { - photoFeed = PhotoFeedModel(initWithPhotoFeedModelType: .photoFeedModelTypePopular, requiredImageSize: screenSizeForWidth) - super.init(nibName: nil, bundle: nil) - self.navigationItem.title = "UIKit" - + super.init(nibName: nil, bundle: nil) + + navigationItem.title = "UIKit" } required init?(coder aDecoder: NSCoder) { @@ -37,12 +34,13 @@ class PhotoFeedTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() + + navigationController?.hidesBarsOnSwipe = true setupActivityIndicator() configureTableView() fetchNewBatch() - navigationController?.hidesBarsOnSwipe = true } - + func fetchNewBatch() { activityIndicator.startAnimating() photoFeed.updateNewBatchOfPopularPhotos() { additions, connectionStatus in @@ -57,22 +55,17 @@ class PhotoFeedTableViewController: UITableViewController { } } - var screenSizeForWidth: CGSize = { - let screenRect = UIScreen.main.bounds - let screenScale = UIScreen.main.scale - return CGSize(width: screenRect.size.width * screenScale, height: screenRect.size.width * screenScale) - }() - - // helper functions + // Helper functions func setupActivityIndicator() { let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray) + activityIndicator.translatesAutoresizingMaskIntoConstraints = false self.activityIndicator = activityIndicator - self.tableView.addSubview(activityIndicator) - activityIndicator.translatesAutoresizingMaskIntoConstraints = false + self.tableView.addSubview(activityIndicator) + NSLayoutConstraint.activate([ activityIndicator.centerXAnchor.constraint(equalTo: self.tableView.centerXAnchor), activityIndicator.centerYAnchor.constraint(equalTo: self.tableView.centerYAnchor) - ]) + ]) } func configureTableView() { @@ -87,7 +80,7 @@ extension PhotoFeedTableViewController { func addRowsIntoTableView(newPhotoCount newPhotos: Int) { - let indexRange = (photoFeed.photos.count - newPhotos.. Int { - return photoFeed.photos.count + return photoFeed.numberOfItems } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { guard let cell = tableView.dequeueReusableCell(withIdentifier: "photoCell", for: indexPath) as? PhotoTableViewCell else { fatalError("Wrong cell type") } - cell.photoModel = photoFeed.photos[indexPath.row] + cell.photoModel = photoFeed.itemAtIndexPath(indexPath) return cell } override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { - return PhotoTableViewCell.height(for: photoFeed.photos[indexPath.row], withWidth: self.view.frame.size.width) + return PhotoTableViewCell.height( + for: photoFeed.itemAtIndexPath(indexPath), + withWidth: self.view.frame.size.width + ) } override func scrollViewDidScroll(_ scrollView: UIScrollView) { - let currentOffSetY = scrollView.contentOffset.y let contentHeight = scrollView.contentSize.height - let screenHeight = UIScreen.main.bounds.size.height + let screenHeight = UIScreen.main.bounds.height let screenfullsBeforeBottom = (contentHeight - currentOffSetY) / screenHeight if screenfullsBeforeBottom < 2.5 { self.fetchNewBatch() diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift index 13508631b1..e9a049f437 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift @@ -2,91 +2,123 @@ // PhotoModel.swift // ASDKgram-Swift // -// Created by Calum Harris on 07/01/2017. -// // 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 UIKit -typealias JSONDictionary = [String : Any] +// MARK: ProfileImage -struct PhotoModel { - - let url: String - let photoID: Int - let dateString: String - let descriptionText: String +struct ProfileImage: Codable { + let large: String + let medium: String + let small: String +} + +// MARK: UserModel + +struct UserModel: Codable { + let userName: String + let profileImages: ProfileImage + + enum CodingKeys: String, CodingKey { + case userName = "username" + case profileImages = "profile_image" + } +} + +extension UserModel { + var profileImage: String { + return profileImages.medium + } +} + +// MARK: PhotoURL + +struct PhotoURL: Codable { + let full: String + let raw: String + let regular: String + let small: String + let thumb: String +} + +// MARK: PhotoModel + +struct PhotoModel: Codable { + let urls: PhotoURL + let photoID: String + let uploadedDateString: String + let descriptionText: String? let likesCount: Int - let ownerUserName: String - let ownerPicURL: String - - init?(dictionary: JSONDictionary) { - - guard let images = dictionary["images"] as? [[String: Any]], - let url = images[0]["url"] as? String, - let date = dictionary["created_at"] as? String, - let photoID = dictionary["id"] as? Int, - let descriptionText = dictionary["name"] as? String, - let likesCount = dictionary["positive_votes_count"] as? Int else - { print("error parsing JSON within PhotoModel Init"); return nil } - - guard let user = dictionary["user"] as? JSONDictionary, - let username = user["username"] as? String, - let ownerPicURL = user["userpic_url"] as? String else - { print("error parsing JSON within PhotoModel Init"); return nil } - - self.url = url - self.photoID = photoID - self.descriptionText = descriptionText - self.likesCount = likesCount - self.dateString = date - self.ownerUserName = username - self.ownerPicURL = ownerPicURL - } + let width: Int + let height: Int + let user: UserModel + + enum CodingKeys: String, CodingKey { + case photoID = "id" + case urls = "urls" + case uploadedDateString = "created_at" + case descriptionText = "description" + case likesCount = "likes" + case width = "width" + case height = "height" + case user = "user" + } +} + +extension PhotoModel { + var url: String { + return urls.regular + } } extension PhotoModel { // MARK: - Attributed Strings - func attrStringForUserName(withSize size: CGFloat) -> NSAttributedString { - let attr = [ + func attributedStringForUserName(withSize size: CGFloat) -> NSAttributedString { + let attributes = [ NSForegroundColorAttributeName : UIColor.darkGray, NSFontAttributeName: UIFont.boldSystemFont(ofSize: size) ] - return NSAttributedString(string: self.ownerUserName, attributes: attr) + return NSAttributedString(string: user.userName, attributes: attributes) } - func attrStringForDescription(withSize size: CGFloat) -> NSAttributedString { - let attr = [ + func attributedStringForDescription(withSize size: CGFloat) -> NSAttributedString { + let attributes = [ NSForegroundColorAttributeName : UIColor.darkGray, NSFontAttributeName: UIFont.systemFont(ofSize: size) ] - return NSAttributedString(string: self.descriptionText, attributes: attr) + return NSAttributedString(string: descriptionText ?? "", attributes: attributes) } - func attrStringLikes(withSize size: CGFloat) -> NSAttributedString { + func attributedStringLikes(withSize size: CGFloat) -> NSAttributedString { + guard let formattedLikesNumber = NumberFormatter.decimalNumberFormatter.string(from: NSNumber(value: likesCount)) else { + return NSAttributedString() + } - let formatter = NumberFormatter() - formatter.numberStyle = .decimal - let formattedLikesNumber: String? = formatter.string(from: NSNumber(value: self.likesCount)) - let likesString: String = "\(formattedLikesNumber!) Likes" - let textAttr = [NSForegroundColorAttributeName : UIColor.mainBarTintColor(), NSFontAttributeName: UIFont.systemFont(ofSize: size)] - let likesAttrString = NSAttributedString(string: likesString, attributes: textAttr) + let likesAttributes = [ + NSForegroundColorAttributeName : UIColor.mainBarTintColor, + NSFontAttributeName: UIFont.systemFont(ofSize: size) + ] + let likesAttrString = NSAttributedString(string: "\(formattedLikesNumber) Likes", attributes: likesAttributes) - let heartAttr = [NSForegroundColorAttributeName : UIColor.red, NSFontAttributeName: UIFont.systemFont(ofSize: size)] - let heartAttrString = NSAttributedString(string: "♥︎ ", attributes: heartAttr) + let heartAttributes = [ + NSForegroundColorAttributeName : UIColor.red, + NSFontAttributeName: UIFont.systemFont(ofSize: size) + ] + let heartAttrString = NSAttributedString(string: "♥︎ ", attributes: heartAttributes) let combine = NSMutableAttributedString() combine.append(heartAttrString) @@ -94,32 +126,16 @@ extension PhotoModel { return combine } - func attrStringForTimeSinceString(withSize size: CGFloat) -> NSAttributedString { - - let attr = [ - NSForegroundColorAttributeName : UIColor.mainBarTintColor(), + func attributedStringForTimeSinceString(withSize size: CGFloat) -> NSAttributedString { + guard let date = Date.iso8601Formatter.date(from: self.uploadedDateString) else { + return NSAttributedString(); + } + + let attributes = [ + NSForegroundColorAttributeName : UIColor.mainBarTintColor, NSFontAttributeName: UIFont.systemFont(ofSize: size) ] - let date = Date.iso8601Formatter.date(from: self.dateString)! - return NSAttributedString(string: timeStringSince(fromConverted: date), attributes: attr) - } - - private func timeStringSince(fromConverted date: Date) -> String { - let diffDates = NSCalendar.current.dateComponents([.day, .hour, .second], from: date, to: Date()) - - if let week = diffDates.day, week > 7 { - return "\(week / 7)w" - } else if let day = diffDates.day, day > 0 { - return "\(day)d" - } else if let hour = diffDates.hour, hour > 0 { - return "\(hour)h" - } else if let second = diffDates.second, second > 0 { - return "\(second)s" - } else if let zero = diffDates.second, zero == 0 { - return "1s" - } else { - return "ERROR" - } + return NSAttributedString(string: Date.timeStringSince(fromConverted: date), attributes: attributes) } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift index 56e02588b5..4ad4ea8ab8 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift @@ -2,53 +2,60 @@ // PhotoTableNodeCell.swift // ASDKgram-Swift // -// Created by Calum Harris on 09/01/2017. -// // 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 // -// 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.// import Foundation import AsyncDisplayKit class PhotoTableNodeCell: ASCellNode { - + + // MARK: Properties + let usernameLabel = ASTextNode() let timeIntervalLabel = ASTextNode() let photoLikesLabel = ASTextNode() let photoDescriptionLabel = ASTextNode() let avatarImageNode: ASNetworkImageNode = { - let imageNode = ASNetworkImageNode() - imageNode.contentMode = .scaleAspectFill - imageNode.imageModificationBlock = ASImageNodeRoundBorderModificationBlock(0, nil) - return imageNode + let node = ASNetworkImageNode() + node.contentMode = .scaleAspectFill + // Set the imageModificationBlock for a rounded avatar + node.imageModificationBlock = ASImageNodeRoundBorderModificationBlock(0, nil) + return node }() let photoImageNode: ASNetworkImageNode = { - let imageNode = ASNetworkImageNode() - imageNode.contentMode = .scaleAspectFill - return imageNode + let node = ASNetworkImageNode() + node.contentMode = .scaleAspectFill + return node }() + + // MARK: Lifecycle init(photoModel: PhotoModel) { super.init() - self.photoImageNode.url = URL(string: photoModel.url) - self.avatarImageNode.url = URL(string: photoModel.ownerPicURL) - self.usernameLabel.attributedText = photoModel.attrStringForUserName(withSize: Constants.CellLayout.FontSize) - self.timeIntervalLabel.attributedText = photoModel.attrStringForTimeSinceString(withSize: Constants.CellLayout.FontSize) - self.photoLikesLabel.attributedText = photoModel.attrStringLikes(withSize: Constants.CellLayout.FontSize) - self.photoDescriptionLabel.attributedText = photoModel.attrStringForDescription(withSize: Constants.CellLayout.FontSize) - self.automaticallyManagesSubnodes = true + + automaticallyManagesSubnodes = true + photoImageNode.url = URL(string: photoModel.url) + avatarImageNode.url = URL(string: photoModel.user.profileImage) + usernameLabel.attributedText = photoModel.attributedStringForUserName(withSize: Constants.CellLayout.FontSize) + timeIntervalLabel.attributedText = photoModel.attributedStringForTimeSinceString(withSize: Constants.CellLayout.FontSize) + photoLikesLabel.attributedText = photoModel.attributedStringLikes(withSize: Constants.CellLayout.FontSize) + photoDescriptionLabel.attributedText = photoModel.attributedStringForDescription(withSize: Constants.CellLayout.FontSize) } + + // MARK: ASDisplayNode override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec { @@ -58,9 +65,13 @@ class PhotoTableNodeCell: ASCellNode { let headerStack = ASStackLayoutSpec.horizontal() headerStack.alignItems = .center - avatarImageNode.style.preferredSize = CGSize(width: Constants.CellLayout.UserImageHeight, height: Constants.CellLayout.UserImageHeight) + avatarImageNode.style.preferredSize = CGSize( + width: Constants.CellLayout.UserImageHeight, + height: Constants.CellLayout.UserImageHeight + ) headerChildren.append(ASInsetLayoutSpec(insets: Constants.CellLayout.InsetForAvatar, child: avatarImageNode)) - usernameLabel.style.flexShrink = 1.0 + + usernameLabel.style.flexShrink = 1.0 headerChildren.append(usernameLabel) let spacer = ASLayoutSpec() @@ -76,9 +87,11 @@ class PhotoTableNodeCell: ASCellNode { headerStack.children = headerChildren let verticalStack = ASStackLayoutSpec.vertical() - - verticalStack.children = [ASInsetLayoutSpec(insets: Constants.CellLayout.InsetForHeader, child: headerStack), ASRatioLayoutSpec(ratio: 1.0, child: photoImageNode), ASInsetLayoutSpec(insets: Constants.CellLayout.InsetForFooter, child: footerStack)] - + verticalStack.children = [ + ASInsetLayoutSpec(insets: Constants.CellLayout.InsetForHeader, child: headerStack), + ASRatioLayoutSpec(ratio: 1.0, child: photoImageNode), + ASInsetLayoutSpec(insets: Constants.CellLayout.InsetForFooter, child: footerStack) + ] return verticalStack } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift index b57beab9a0..982f673d06 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift @@ -2,19 +2,17 @@ // PhotoTableViewCell.swift // ASDKgram-Swift // -// Created by Calum Harris on 08/01/2017. -// // 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 UIKit @@ -25,15 +23,15 @@ class PhotoTableViewCell: UITableViewCell { didSet { if let model = photoModel { photoImageView.loadImageUsingUrlString(urlString: model.url) - avatarImageView.loadImageUsingUrlString(urlString: model.ownerPicURL) - photoLikesLabel.attributedText = model.attrStringLikes(withSize: Constants.CellLayout.FontSize) - usernameLabel.attributedText = model.attrStringForUserName(withSize: Constants.CellLayout.FontSize) - timeIntervalLabel.attributedText = model.attrStringForTimeSinceString(withSize: Constants.CellLayout.FontSize) - photoDescriptionLabel.attributedText = model.attrStringForDescription(withSize: Constants.CellLayout.FontSize) + avatarImageView.loadImageUsingUrlString(urlString: model.user.profileImage) + photoLikesLabel.attributedText = model.attributedStringLikes(withSize: Constants.CellLayout.FontSize) + usernameLabel.attributedText = model.attributedStringForUserName(withSize: Constants.CellLayout.FontSize) + timeIntervalLabel.attributedText = model.attributedStringForTimeSinceString(withSize: Constants.CellLayout.FontSize) + photoDescriptionLabel.attributedText = model.attributedStringForDescription(withSize: Constants.CellLayout.FontSize) photoDescriptionLabel.sizeToFit() var rect = photoDescriptionLabel.frame let availableWidth = self.bounds.size.width - Constants.CellLayout.HorizontalBuffer * 2 - rect.size = model.attrStringForDescription(withSize: Constants.CellLayout.FontSize).boundingRect(with: CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude), options: .usesLineFragmentOrigin, context: nil).size + rect.size = model.attributedStringForDescription(withSize: Constants.CellLayout.FontSize).boundingRect(with: CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude), options: .usesLineFragmentOrigin, context: nil).size photoDescriptionLabel.frame = rect } } @@ -133,7 +131,7 @@ class PhotoTableViewCell: UITableViewCell { let photoHeight = width let font = UIFont.systemFont(ofSize: Constants.CellLayout.FontSize) let likesHeight = round(font.lineHeight) - let descriptionAttrString = photo.attrStringForDescription(withSize: Constants.CellLayout.FontSize) + let descriptionAttrString = photo.attributedStringForDescription(withSize: Constants.CellLayout.FontSize) let availableWidth = width - Constants.CellLayout.HorizontalBuffer * 2 let descriptionHeight = descriptionAttrString.boundingRect(with: CGSize(width: availableWidth, height: CGFloat.greatestFiniteMagnitude), options: .usesLineFragmentOrigin, context: nil).size.height diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift index 8aca2445f1..0c32a2bb0d 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift @@ -2,36 +2,31 @@ // PopularPageModel.swift // ASDKgram-Swift // -// Created by Calum Harris on 08/01/2017. -// // 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 Foundation -class PopularPageModel: NSObject { - - let page: Int - let totalPages: Int - let totalNumberOfItems: Int - let photos: [PhotoModel] - - init?(dictionary: JSONDictionary, photosArray: [PhotoModel]) { - guard let page = dictionary["current_page"] as? Int, let totalPages = dictionary["total_pages"] as? Int, let totalItems = dictionary["total_items"] as? Int else { print("error parsing JSON within PhotoModel Init"); return nil } - - self.page = page - self.totalPages = totalPages - self.totalNumberOfItems = totalItems - self.photos = photosArray - } +struct PopularPageModel { + let page: Int + let totalPages: Int + let totalNumberOfItems: Int + let photos: [PhotoModel] + + init(metaData: ResponseMetadata, photos:[PhotoModel]) { + self.page = metaData.currentPage + self.totalPages = metaData.pagesTotal + self.totalNumberOfItems = metaData.itemsTotal + self.photos = photos + } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift index 5ab9d7e010..40cea6f910 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift @@ -2,25 +2,23 @@ // UIColor.swift // ASDKgram-Swift // -// Created by Calum Harris on 06/01/2017. // 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 UIKit extension UIColor { - - class func mainBarTintColor() -> UIColor { + static var mainBarTintColor: UIColor { return UIColor(red: 69/255, green: 142/255, blue: 255/255, alpha: 1) } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIImage.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIImage.swift deleted file mode 100644 index 4eb233f37b..0000000000 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIImage.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// UIImage.swift -// ASDKgram-Swift -// -// Created by Calum Harris on 18/01/2017. -// -// 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. -// -// 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. -// - -import UIKit - -// This extension was copied directly from LayoutSpecExamples-Swift. It is an example of how to create Precomoposed Alpha Corners. I have used the helper ASImageNodeRoundBorderModificationBlock:boarderWidth:boarderColor function in practice which does the same. - -extension UIImage { - - func makeCircularImage(size: CGSize, borderWidth width: CGFloat) -> UIImage { - // make a CGRect with the image's size - let circleRect = CGRect(origin: .zero, size: size) - - // begin the image context since we're not in a drawRect: - UIGraphicsBeginImageContextWithOptions(circleRect.size, false, 0) - - // create a UIBezierPath circle - let circle = UIBezierPath(roundedRect: circleRect, cornerRadius: circleRect.size.width * 0.5) - - // clip to the circle - circle.addClip() - - UIColor.white.set() - circle.fill() - - // draw the image in the circleRect *AFTER* the context is clipped - self.draw(in: circleRect) - - // create a border (for white background pictures) - if width > 0 { - circle.lineWidth = width - UIColor.white.set() - circle.stroke() - } - - // get an image from the image context - let roundedImage = UIGraphicsGetImageFromCurrentImageContext() - - // end the image context since we're not in a drawRect: - UIGraphicsEndImageContext() - - return roundedImage ?? self - } -} diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift index 5960498155..cbdd5a942f 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift @@ -2,66 +2,36 @@ // URL.swift // ASDKgram-Swift // -// Created by Calum Harris on 07/01/2017. -// // 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 UIKit extension URL { - static func URLForFeedModelType(feedModelType: PhotoFeedModelType) -> URL { switch feedModelType { case .photoFeedModelTypePopular: - return URL(string: assemble500PXURLString(endpoint: Constants.PX500.URLS.PopularEndpoint))! + return URL(string: assembleUnsplashURLString(endpoint: Constants.Unsplash.URLS.PopularEndpoint))! case .photoFeedModelTypeLocation: - return URL(string: assemble500PXURLString(endpoint: Constants.PX500.URLS.SearchEndpoint))! + return URL(string: assembleUnsplashURLString(endpoint: Constants.Unsplash.URLS.SearchEndpoint))! case .photoFeedModelTypeUserPhotos: - return URL(string: assemble500PXURLString(endpoint: Constants.PX500.URLS.UserEndpoint))! + return URL(string: assembleUnsplashURLString(endpoint: Constants.Unsplash.URLS.UserEndpoint))! } } - - private static func assemble500PXURLString(endpoint: String) -> String { - return Constants.PX500.URLS.Host + endpoint + Constants.PX500.URLS.ConsumerKey - } - - mutating func addImageParameterForClosestImageSizeAndpage(size: CGSize, page: Int) -> URL { - - let imageParameterID: Int - - if size.height <= 70 { - imageParameterID = 1 - } else if size.height <= 100 { - imageParameterID = 100 - } else if size.height <= 140 { - imageParameterID = 2 - } else if size.height <= 200 { - imageParameterID = 200 - } else if size.height <= 280 { - imageParameterID = 3 - } else if size.height <= 400 { - imageParameterID = 400 - } else { - imageParameterID = 600 - } - - var urlString = self.absoluteString - urlString.append("&image_size=\(imageParameterID)&page=\(page)") - - return URL(string: urlString)! - } - + + private static func assembleUnsplashURLString(endpoint: String) -> String { + return Constants.Unsplash.URLS.Host + endpoint + Constants.Unsplash.URLS.ConsumerKey + } } diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift index 830d78eb0e..0718905d52 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift @@ -2,33 +2,33 @@ // Webservice.swift // ASDKgram-Swift // -// Created by Calum Harris on 06/01/2017. -// // 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 // // swiftlint:disable force_cast import UIKit final class WebService { + /// Load a new resource. Callback is called on main func load(resource: Resource, completion: @escaping (Result) -> ()) { URLSession.shared.dataTask(with: resource.url) { data, response, error in // Check for errors in responses. let result = self.checkForNetworkErrors(data, response, error) DispatchQueue.main.async { + // Parsing should happen off main switch result { case .success(let data): - completion(resource.parse(data)) + completion(resource.parse(data, response)) case .failure(let error): completion(.failure(error)) } @@ -38,54 +38,77 @@ final class WebService { } extension WebService { - + /// // Check for errors in responses. fileprivate func checkForNetworkErrors(_ data: Data?, _ response: URLResponse?, _ error: Error?) -> Result { - // Check for errors in responses. if let error = error { - let nsError = error as NSError - if nsError.domain == NSURLErrorDomain && (nsError.code == NSURLErrorNotConnectedToInternet || nsError.code == NSURLErrorTimedOut) { - return .failure(.noInternetConnection) - } else { - return .failure(.returnedError(error)) - } + switch error { + case URLError.notConnectedToInternet, URLError.timedOut: + return .failure(.noInternetConnection) + default: + return .failure(.returnedError(error)) + } } if let response = response as? HTTPURLResponse, response.statusCode <= 200 && response.statusCode >= 299 { return .failure((.invalidStatusCode("Request returned status code other than 2xx \(response)"))) } - guard let data = data else { return .failure(.dataReturnedNil) } + guard let data = data else { + return .failure(.dataReturnedNil) + } return .success(data) } } +struct ResponseMetadata { + let currentPage: Int + let itemsTotal: Int + let itemsPerPage: Int +} + +extension ResponseMetadata { + var pagesTotal: Int { + return itemsTotal / itemsPerPage + } +} + struct Resource { let url: URL - let parse: (Data) -> Result + let parse: (Data, URLResponse?) -> Result } extension Resource { - - init(url: URL, parseJSON: @escaping (Any) -> Result) { - self.url = url - self.parse = { data in - do { - let jsonData = try JSONSerialization.jsonObject(with: data, options: []) - return parseJSON(jsonData) - } catch { - fatalError("Error parsing data") - } + init(url: URL, page: Int, parseResponse: @escaping (ResponseMetadata, Data) -> Result) { + // Append extra data to url for paging + guard let url = URL(string: url.absoluteString.appending("&page=\(page)")) else { + fatalError("Malformed URL given"); + } + self.url = url + self.parse = { data, response in + // Parse out metadata from header + guard let httpUrlResponse = response as? HTTPURLResponse, + let xTotalString = httpUrlResponse.allHeaderFields["x-total"] as? String, + let xTotal = Int(xTotalString), + let xPerPageString = httpUrlResponse.allHeaderFields["x-per-page"] as? String, + let xPerPage = Int(xPerPageString) + else { + return .failure(.errorParsingResponse) + } + + let metadata = ResponseMetadata(currentPage: page, itemsTotal: xTotal, itemsPerPage: xPerPage) + return parseResponse(metadata, data) } } } enum Result { case success(T) - case failure(NetworkingErrors) + case failure(NetworkingError) } -enum NetworkingErrors: Error { +enum NetworkingError: Error { + case errorParsingResponse case errorParsingJSON case noInternetConnection case dataReturnedNil diff --git a/examples_extra/ASDKgram-Swift/Podfile b/examples_extra/ASDKgram-Swift/Podfile index 6ab85b36c6..5510b59d9e 100644 --- a/examples_extra/ASDKgram-Swift/Podfile +++ b/examples_extra/ASDKgram-Swift/Podfile @@ -1,8 +1,9 @@ - +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '9.0' target 'ASDKgram-Swift' do - use_frameworks! + inhibit_all_warnings! - pod 'Texture', '>= 2.0' + pod 'Texture/PINRemoteImage', :path => '../..' end From 55abeed7432f5dcfd0613149365281856b1b56c1 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Tue, 10 Jul 2018 09:37:53 -0700 Subject: [PATCH 15/97] Introduce let / var macros and some further cleanup (#1012) * Introduce let / var and some further cleanup * Address first comments * Update changelog * Move the const before auto --- CHANGELOG.md | 1 + Source/ASCollectionView.mm | 8 ++-- Source/ASDisplayNode+Layout.mm | 14 +++--- Source/ASDisplayNode.mm | 4 +- Source/ASImageNode.mm | 2 +- Source/ASMainThreadDeallocation.mm | 2 +- Source/ASNetworkImageNode.mm | 14 +++--- Source/ASRunLoopQueue.mm | 20 ++++---- Source/ASTableView.mm | 4 +- Source/ASTextNode.mm | 4 +- Source/ASTextNode2.mm | 4 +- Source/Base/ASBaseDefines.h | 8 ++++ Source/Details/ASBasicImageDownloader.mm | 4 +- Source/Details/ASCollectionLayoutState.mm | 2 +- Source/Details/ASDataController.mm | 10 ++-- Source/Details/ASIntegerMap.mm | 17 +++---- Source/Details/ASRangeController.mm | 2 +- Source/Details/ASThread.h | 2 +- Source/Layout/ASDimension.mm | 4 +- Source/Layout/ASLayout.mm | 12 ++--- Source/Layout/ASLayoutSpec.mm | 4 +- Source/Layout/ASRatioLayoutSpec.mm | 2 +- Source/Layout/ASStackLayoutSpec.mm | 2 +- Source/Private/ASCollectionLayoutCache.mm | 2 +- Source/Private/ASMutableElementMap.m | 2 +- Source/Private/ASRectMap.mm | 6 +-- Source/Private/_ASCoreAnimationExtras.mm | 8 ++-- Source/Private/_ASHierarchyChangeSet.mm | 22 ++++----- Tests/ASCollectionModernDataSourceTests.m | 3 +- Tests/ASLayoutEngineTests.mm | 58 +++++++++++------------ Tests/ASLayoutTestNode.mm | 4 +- Tests/ASPerformanceTestContext.m | 15 ++++-- Tests/ASTLayoutFixture.mm | 14 +++--- 33 files changed, 149 insertions(+), 131 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e027a04e3..608e20e81b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ - Add an experimental deallocation queue implementation that's more efficient. [Adlai Holler](https://github.com/Adlai-Holler) - Standardize property declaration style. [Adlai Holler](https://github.com/Adlai-Holler) - [ASTableView] Fix an issue that causes table view to use one of a cell's invalid layouts instead of generating a new one. [Huy Nguyen](https://github.com/nguyenhuy) [#942](https://github.com/TextureGroup/Texture/pull/942) +- Introduce let / var macros and some further cleanup. [Michael Schneider](https://github.com/maicki) [#1012](https://github.com/TextureGroup/Texture/pull/1012) ## 2.6 - [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 555707f3d5..cef0d581ad 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -1545,7 +1545,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; // If the data source implements canMoveItem, let them decide. if (_asyncDataSourceFlags.collectionNodeCanMoveItem) { - if (auto cellNode = [self nodeForItemAtIndexPath:indexPath]) { + if (let cellNode = [self nodeForItemAtIndexPath:indexPath]) { GET_COLLECTIONNODE_OR_RETURN(collectionNode, NO); return [_asyncDataSource collectionNode:collectionNode canMoveItemWithNode:cellNode]; } @@ -1561,7 +1561,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; // Inform the data source first, in case they call nodeForItemAtIndexPath:. // We want to make sure we return them the node for the item they have in mind. - if (auto collectionNode = self.collectionNode) { + if (let collectionNode = self.collectionNode) { [_asyncDataSource collectionNode:collectionNode moveItemAtIndexPath:sourceIndexPath toIndexPath:destinationIndexPath]; } @@ -1996,7 +1996,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; - (NSArray *)dataController:(ASDataController *)dataController supplementaryNodeKindsInSections:(NSIndexSet *)sections { if (_asyncDataSourceFlags.collectionNodeSupplementaryElementKindsInSection) { - auto kinds = [[NSMutableSet alloc] init]; + let kinds = [[NSMutableSet alloc] init]; GET_COLLECTIONNODE_OR_RETURN(collectionNode, @[]); [sections enumerateIndexesUsingBlock:^(NSUInteger section, BOOL * _Nonnull stop) { NSArray *kindsForSection = [_asyncDataSource collectionNode:collectionNode supplementaryElementKindsInSection:section]; @@ -2214,7 +2214,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; return; } - auto uikitIndexPaths = ASArrayByFlatMapping(nodes, ASCellNode *node, [self indexPathForNode:node]); + let uikitIndexPaths = ASArrayByFlatMapping(nodes, ASCellNode *node, [self indexPathForNode:node]); [_layoutFacilitator collectionViewWillEditCellsAtIndexPaths:uikitIndexPaths batched:NO]; diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 239057e33f..2ec4a9bff6 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -646,8 +646,8 @@ ASLayoutElementStyleExtensibilityForwarding ASDN::MutexLocker l(__instanceLock__); // Update calculated layout - auto previousLayout = _calculatedDisplayNodeLayout; - auto pendingLayout = std::make_shared(newLayout, + let previousLayout = _calculatedDisplayNodeLayout; + let pendingLayout = std::make_shared(newLayout, constrainedSize, constrainedSize.max, newLayoutVersion); @@ -767,10 +767,10 @@ ASLayoutElementStyleExtensibilityForwarding NSArray *removedSubnodes = [context removedSubnodes]; NSMutableArray *insertedSubnodes = [[context insertedSubnodes] mutableCopy]; - auto movedSubnodes = [[NSMutableArray alloc] init]; + let movedSubnodes = [[NSMutableArray alloc] init]; - auto insertedSubnodeContexts = [[NSMutableArray<_ASAnimatedTransitionContext *> alloc] init]; - auto removedSubnodeContexts = [[NSMutableArray<_ASAnimatedTransitionContext *> alloc] init]; + let insertedSubnodeContexts = [[NSMutableArray<_ASAnimatedTransitionContext *> alloc] init]; + let removedSubnodeContexts = [[NSMutableArray<_ASAnimatedTransitionContext *> alloc] init]; for (ASDisplayNode *subnode in [context subnodesForKey:ASTransitionContextToLayoutKey]) { if ([insertedSubnodes containsObject:subnode] == NO) { @@ -905,9 +905,9 @@ ASLayoutElementStyleExtensibilityForwarding NSArray *subnodes = [self subnodes]; NSArray *sublayouts = _calculatedDisplayNodeLayout->layout.sublayouts; - auto currentSubnodes = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality + let currentSubnodes = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality capacity:subnodes.count]; - auto layoutSubnodes = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality + let layoutSubnodes = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality capacity:sublayouts.count];; for (ASDisplayNode *subnode in subnodes) { [currentSubnodes addObject:subnode]; diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index d29fa61c4d..53dfac3d36 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -3674,7 +3674,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (NSString *)debugDescription { ASPushMainThreadAssertionsDisabled(); - auto result = ASObjectDescriptionMake(self, [self propertiesForDebugDescription]); + let result = ASObjectDescriptionMake(self, [self propertiesForDebugDescription]); ASPopMainThreadAssertionsDisabled(); return result; } @@ -3746,7 +3746,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { ASPushMainThreadAssertionsDisabled(); ASDN::MutexLocker l(__instanceLock__); - auto props = [NSMutableArray array]; + let props = [[NSMutableArray alloc] init]; [props addObject:@{ @"layoutVersion": @(_layoutVersion.load()) }]; [props addObject:@{ @"bounds": [NSValue valueWithCGRect:self.bounds] }]; diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 6eb76ba694..b572c9d973 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -225,7 +225,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize { - auto image = ASLockedSelf(_image); + let image = ASLockedSelf(_image); if (image == nil) { return [super calculateSizeThatFits:constrainedSize]; diff --git a/Source/ASMainThreadDeallocation.mm b/Source/ASMainThreadDeallocation.mm index 36c13421cd..98484088f7 100644 --- a/Source/ASMainThreadDeallocation.mm +++ b/Source/ASMainThreadDeallocation.mm @@ -146,7 +146,7 @@ + (BOOL)needsMainThreadDeallocation { - auto name = class_getName(self); + let name = class_getName(self); if (0 == strncmp(name, "AV", 2) || 0 == strncmp(name, "UI", 2) || 0 == strncmp(name, "CA", 2)) { return YES; } diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index f28e063ff3..be5bf1df49 100755 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -351,7 +351,7 @@ // Call out to the delegate. if (_delegateFlags.delegateDidLoadImageWithInfo) { ASUnlockScope(self); - auto info = [[ASNetworkImageLoadInfo alloc] initWithURL:url sourceType:ASNetworkImageSourceSynchronousCache downloadIdentifier:nil userInfo:nil]; + let info = [[ASNetworkImageLoadInfo alloc] initWithURL:url sourceType:ASNetworkImageSourceSynchronousCache downloadIdentifier:nil userInfo:nil]; [_delegate imageNode:self didLoadImage:result info:info]; } else if (_delegateFlags.delegateDidLoadImage) { ASUnlockScope(self); @@ -629,7 +629,7 @@ } else { // First try to load the path directly, for efficiency assuming a developer who // doesn't want caching is trying to be as minimal as possible. - auto nonAnimatedImage = [[UIImage alloc] initWithContentsOfFile:URL.path]; + var nonAnimatedImage = [[UIImage alloc] initWithContentsOfFile:URL.path]; if (nonAnimatedImage == nil) { // If we couldn't find it, execute an -imageNamed:-like search so we can find resources even if the // extension is not provided in the path. This allows the same path to work regardless of shouldCacheImage. @@ -642,7 +642,7 @@ // If the file may be an animated gif and then created an animated image. id animatedImage = nil; if (_downloaderFlags.downloaderImplementsAnimatedImage) { - auto data = [[NSData alloc] initWithContentsOfURL:URL]; + let data = [[NSData alloc] initWithContentsOfURL:URL]; if (data != nil) { animatedImage = [_downloader animatedImageWithData:data]; @@ -665,7 +665,7 @@ if (_delegateFlags.delegateDidLoadImageWithInfo) { ASUnlockScope(self); - auto info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:ASNetworkImageSourceFileURL downloadIdentifier:nil userInfo:nil]; + let info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:ASNetworkImageSourceFileURL downloadIdentifier:nil userInfo:nil]; [delegate imageNode:self didLoadImage:self.image info:info]; } else if (_delegateFlags.delegateDidLoadImage) { ASUnlockScope(self); @@ -674,7 +674,7 @@ }); } else { __weak __typeof__(self) weakSelf = self; - auto finished = ^(id imageContainer, NSError *error, id downloadIdentifier, ASNetworkImageSourceType imageSource, id userInfo) { + let finished = ^(id imageContainer, NSError *error, id downloadIdentifier, ASNetworkImageSourceType imageSource, id userInfo) { ASPerformBlockOnBackgroundThread(^{ __typeof__(self) strongSelf = weakSelf; if (strongSelf == nil) { @@ -720,7 +720,7 @@ if (newImage) { if (_delegateFlags.delegateDidLoadImageWithInfo) { calloutBlock = ^(ASNetworkImageNode *strongSelf) { - auto info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:imageSource downloadIdentifier:downloadIdentifier userInfo:userInfo]; + let info = [[ASNetworkImageLoadInfo alloc] initWithURL:URL sourceType:imageSource downloadIdentifier:downloadIdentifier userInfo:userInfo]; [delegate imageNode:strongSelf didLoadImage:newImage info:info]; }; } else if (_delegateFlags.delegateDidLoadImage) { @@ -736,7 +736,7 @@ if (calloutBlock) { ASPerformBlockOnMainThread(^{ - if (auto strongSelf = weakSelf) { + if (let strongSelf = weakSelf) { calloutBlock(strongSelf); } }); diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index c14eccac51..6f5c2232a5 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -220,13 +220,13 @@ static void runLoopSourceCallback(void *info) { NSParameterAssert(objectPtr != NULL); // Cast to CFType so we can manipulate retain count manually. - auto cfPtr = (CFTypeRef *)(void *)objectPtr; + let cfPtr = (CFTypeRef *)(void *)objectPtr; if (!cfPtr || !*cfPtr) { return; } _lock.lock(); - auto isFirstEntry = _queue.empty(); + let isFirstEntry = _queue.empty(); // Push the pointer into our queue and clear their pointer. // This "steals" the +1 from ARC and nils their pointer so they can't // access or release the object. @@ -244,9 +244,9 @@ static void runLoopSourceCallback(void *info) { - (void)drain { _lock.lock(); - auto q = std::move(_queue); + let q = std::move(_queue); _lock.unlock(); - for (auto ref : q) { + for (let ref : q) { // NOTE: Could check that retain count is 1 and retry later if not. CFRelease(ref); } @@ -488,11 +488,11 @@ typedef enum { } // itemsToProcess will be empty if _queueConsumer == nil so no need to check again. - auto count = itemsToProcess.size(); + let count = itemsToProcess.size(); if (count > 0) { as_activity_scope_verbose(as_activity_create("Process run loop queue batch", _rootActivity, OS_ACTIVITY_FLAG_DEFAULT)); - auto itemsEnd = itemsToProcess.cend(); - for (auto iterator = itemsToProcess.begin(); iterator < itemsEnd; iterator++) { + let itemsEnd = itemsToProcess.cend(); + for (var iterator = itemsToProcess.begin(); iterator < itemsEnd; iterator++) { __unsafe_unretained id value = *iterator; _queueConsumer(value, isQueueDrained && iterator == itemsEnd - 1); as_log_verbose(ASDisplayLog(), "processed %@", value); @@ -711,11 +711,11 @@ static int const kASASCATransactionQueuePostOrder = 3000000; } // itemsToProcess will be empty if _queueConsumer == nil so no need to check again. - auto count = itemsToProcess.size(); + let count = itemsToProcess.size(); if (count > 0) { as_activity_scope_verbose(as_activity_create("Process run loop queue batch", _rootActivity, OS_ACTIVITY_FLAG_DEFAULT)); - auto itemsEnd = itemsToProcess.cend(); - for (auto iterator = itemsToProcess.begin(); iterator < itemsEnd; iterator++) { + let itemsEnd = itemsToProcess.cend(); + for (var iterator = itemsToProcess.begin(); iterator < itemsEnd; iterator++) { __unsafe_unretained id value = *iterator; [value prepareForCATransactionCommit]; as_log_verbose(ASDisplayLog(), "processed %@", value); diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index 003b819365..ae215a1210 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -676,7 +676,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; - (NSArray *)visibleNodes { - auto elements = [self visibleElementsForRangeController:_rangeController]; + let elements = [self visibleElementsForRangeController:_rangeController]; return ASArrayByFlatMapping(elements, ASCollectionElement *e, e.node); } @@ -762,7 +762,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell"; NSArray *nodes = [_cellsForLayoutUpdates allObjects]; [_cellsForLayoutUpdates removeAllObjects]; - auto nodesSizeChanged = [[NSMutableArray alloc] init]; + let nodesSizeChanged = [[NSMutableArray alloc] init]; [_dataController relayoutNodes:nodes nodesSizeChanged:nodesSizeChanged]; if (nodesSizeChanged.count > 0) { [self requeryNodeHeights]; diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 96842d26a0..75507a994f 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -859,7 +859,7 @@ static CGRect ASTextNodeAdjustRenderRectForShadowPadding(CGRect rendererRect, UI ASLockScopeSelf(); NSArray *rects = [[self _locked_renderer] rectsForTextRange:textRange measureOption:measureOption]; - auto adjustedRects = [[NSMutableArray alloc] init]; + let adjustedRects = [[NSMutableArray alloc] init]; for (NSValue *rectValue in rects) { CGRect rect = [rectValue CGRectValue]; @@ -1308,7 +1308,7 @@ static NSAttributedString *DefaultTruncationAttributedString() NSDictionary *originalStringAttributes = [originalString attributesAtIndex:originalStringLength-1 effectiveRange:NULL]; [truncationString enumerateAttributesInRange:NSMakeRange(0, truncationString.length) options:0 usingBlock: ^(NSDictionary *attributes, NSRange range, BOOL *stop) { - NSMutableDictionary *futureTruncationAttributes = [NSMutableDictionary dictionaryWithDictionary:originalStringAttributes]; + NSMutableDictionary *futureTruncationAttributes = [originalStringAttributes mutableCopy]; [futureTruncationAttributes addEntriesFromDictionary:attributes]; [truncationMutableString setAttributes:futureTruncationAttributes range:range]; }]; diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index d0513d6168..92dc243b2f 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -408,7 +408,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; CGRect containerBounds = (CGRect){ .size = container.size }; { - for (auto &t : cacheValue->_layouts) { + for (let &t : cacheValue->_layouts) { CGSize constrainedSize = std::get<0>(t); ASTextLayout *layout = std::get<1>(t); @@ -1135,7 +1135,7 @@ static NSAttributedString *DefaultTruncationAttributedString() NSDictionary *originalStringAttributes = [originalString attributesAtIndex:originalStringLength-1 effectiveRange:NULL]; [truncationString enumerateAttributesInRange:NSMakeRange(0, truncationString.length) options:0 usingBlock: ^(NSDictionary *attributes, NSRange range, BOOL *stop) { - NSMutableDictionary *futureTruncationAttributes = [NSMutableDictionary dictionaryWithDictionary:originalStringAttributes]; + NSMutableDictionary *futureTruncationAttributes = [originalStringAttributes mutableCopy]; [futureTruncationAttributes addEntriesFromDictionary:attributes]; [truncationMutableString setAttributes:futureTruncationAttributes range:range]; }]; diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index 54a7b85946..2fabc0dde5 100755 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -20,6 +20,14 @@ #define AS_EXTERN FOUNDATION_EXTERN #define unowned __unsafe_unretained +#if defined(__cplusplus) +# define var auto +# define let const auto +#else +# define var __auto_type +# define let const __auto_type +#endif + #ifdef __GNUC__ # define ASDISPLAYNODE_GNUC(major, minor) \ (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) diff --git a/Source/Details/ASBasicImageDownloader.mm b/Source/Details/ASBasicImageDownloader.mm index 33b5244ce4..b98feb31f5 100644 --- a/Source/Details/ASBasicImageDownloader.mm +++ b/Source/Details/ASBasicImageDownloader.mm @@ -245,7 +245,7 @@ static const char *kContextKey = NSStringFromClass(ASBasicImageDownloaderContext // cause significant performance issues. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // associate metadata with it - NSMutableDictionary *callbackData = [[NSMutableDictionary alloc] init]; + let callbackData = [[NSMutableDictionary alloc] init]; callbackData[kASBasicImageDownloaderContextCallbackQueue] = callbackQueue ? : dispatch_get_main_queue(); if (downloadProgress) { @@ -256,7 +256,7 @@ static const char *kContextKey = NSStringFromClass(ASBasicImageDownloaderContext callbackData[kASBasicImageDownloaderContextCompletionBlock] = [completion copy]; } - [context addCallbackData:[NSDictionary dictionaryWithDictionary:callbackData]]; + [context addCallbackData:[[NSDictionary alloc] initWithDictionary:callbackData]]; // Create new task if necessary NSURLSessionDownloadTask *task = (NSURLSessionDownloadTask *)[context createSessionTaskIfNecessaryWithBlock:^(){return [_session downloadTaskWithURL:URL];}]; diff --git a/Source/Details/ASCollectionLayoutState.mm b/Source/Details/ASCollectionLayoutState.mm index 6aae8aa26e..bdfaa8a720 100644 --- a/Source/Details/ASCollectionLayoutState.mm +++ b/Source/Details/ASCollectionLayoutState.mm @@ -159,7 +159,7 @@ elementToLayoutAttributesTable:[NSMapTable elementToLayoutAttributesTable]]; } // Use a set here because some items may span multiple pages - auto result = [[NSMutableSet alloc] init]; + let result = [[NSMutableSet alloc] init]; for (id pagePtr in pages) { ASPageCoordinate page = (ASPageCoordinate)pagePtr; NSArray *allAttrs = [_pageToLayoutAttributesTable objectForPage:page]; diff --git a/Source/Details/ASDataController.mm b/Source/Details/ASDataController.mm index 845d9c10b8..05e266a7dc 100644 --- a/Source/Details/ASDataController.mm +++ b/Source/Details/ASDataController.mm @@ -214,7 +214,7 @@ typedef void (^ASDataControllerSynchronizationBlock)(); return @[]; } - auto indexPaths = [[NSMutableArray alloc] init]; + let indexPaths = [[NSMutableArray alloc] init]; if ([kind isEqualToString:ASDataControllerRowNodeKind]) { std::vector counts = [self itemCountsFromDataSource]; [sections enumerateRangesUsingBlock:^(NSRange range, BOOL * _Nonnull stop) { @@ -671,7 +671,7 @@ typedef void (^ASDataControllerSynchronizationBlock)(); [layoutDelegateClass calculateLayoutWithContext:layoutContext]; completion(); } else { - auto elementsToProcess = [[NSMutableArray alloc] init]; + let elementsToProcess = [[NSMutableArray alloc] init]; for (ASCollectionElement *element in newMap) { ASCellNode *nodeIfAllocated = element.nodeIfAllocated; if (nodeIfAllocated.shouldUseUIKitCell) { @@ -827,10 +827,10 @@ typedef void (^ASDataControllerSynchronizationBlock)(); } id dataSource = self.dataSource; - auto visibleMap = self.visibleMap; - auto pendingMap = self.pendingMap; + let visibleMap = self.visibleMap; + let pendingMap = self.pendingMap; for (ASCellNode *node in nodes) { - auto element = node.collectionElement; + let element = node.collectionElement; NSIndexPath *indexPathInPendingMap = [pendingMap indexPathForElement:element]; // Ensure the element is present in both maps or skip it. If it's not in the visible map, // then we can't check the presented size. If it's not in the pending map, we can't get the constrained size. diff --git a/Source/Details/ASIntegerMap.mm b/Source/Details/ASIntegerMap.mm index e80ab7bfa1..4577218dc9 100644 --- a/Source/Details/ASIntegerMap.mm +++ b/Source/Details/ASIntegerMap.mm @@ -102,7 +102,7 @@ return NSNotFound; } - auto result = _map.find(key); + let result = _map.find(key); return result != _map.end() ? result->second : NSNotFound; } @@ -122,9 +122,10 @@ return self; } - auto result = [[ASIntegerMap alloc] init]; - for (auto it = _map.begin(); it != _map.end(); it++) { - result->_map[it->second] = it->first; + let result = [[ASIntegerMap alloc] init]; + + for (let &e : _map) { + result->_map[e.second] = e.first; } return result; } @@ -137,7 +138,7 @@ return self; } - auto newMap = [[ASIntegerMap allocWithZone:zone] init]; + let newMap = [[ASIntegerMap allocWithZone:zone] init]; newMap->_map = _map; return newMap; } @@ -155,8 +156,8 @@ } else { // { 1->2 3->4 5->6 } NSMutableString *str = [NSMutableString string]; - for (auto it = _map.begin(); it != _map.end(); it++) { - [str appendFormat:@" %zd->%zd", it->first, it->second]; + for (let &e : _map) { + [str appendFormat:@" %zd->%zd", e.first, e.second]; } // Remove leading space if (str.length > 0) { @@ -179,7 +180,7 @@ return YES; } - if (auto otherMap = ASDynamicCast(object, ASIntegerMap)) { + if (let otherMap = ASDynamicCast(object, ASIntegerMap)) { return otherMap->_map == _map; } return NO; diff --git a/Source/Details/ASRangeController.mm b/Source/Details/ASRangeController.mm index abd56cc361..1b141a3cd8 100644 --- a/Source/Details/ASRangeController.mm +++ b/Source/Details/ASRangeController.mm @@ -225,7 +225,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; // TODO: Consider if we need to use this codepath, or can rely on something more similar to the data & display ranges // Example: ... = [_layoutController indexPathsForScrolling:scrollDirection rangeType:ASLayoutRangeTypeVisible]; - auto visibleElements = [_dataSource visibleElementsForRangeController:self]; + var visibleElements = [_dataSource visibleElementsForRangeController:self]; NSHashTable *newVisibleNodes = [NSHashTable hashTableWithOptions:NSHashTableObjectPointerPersonality]; ASSignpostStart(ASSignpostRangeControllerUpdate); diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index c03fe46b26..5c61aa7838 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -283,7 +283,7 @@ namespace ASDN { return os_unfair_lock_trylock(&_unfair); } } else { - auto result = pthread_mutex_trylock(&_m); + let result = pthread_mutex_trylock(&_m); if (result == 0) { return true; } else if (result == EBUSY) { diff --git a/Source/Layout/ASDimension.mm b/Source/Layout/ASDimension.mm index 2fd9cf63dd..4fd0e18001 100644 --- a/Source/Layout/ASDimension.mm +++ b/Source/Layout/ASDimension.mm @@ -97,8 +97,8 @@ struct _Range { ASSizeRange ASSizeRangeIntersect(ASSizeRange sizeRange, ASSizeRange otherSizeRange) { - auto w = _Range({sizeRange.min.width, sizeRange.max.width}).intersect({otherSizeRange.min.width, otherSizeRange.max.width}); - auto h = _Range({sizeRange.min.height, sizeRange.max.height}).intersect({otherSizeRange.min.height, otherSizeRange.max.height}); + let w = _Range({sizeRange.min.width, sizeRange.max.width}).intersect({otherSizeRange.min.width, otherSizeRange.max.width}); + let h = _Range({sizeRange.min.height, sizeRange.max.height}).intersect({otherSizeRange.min.height, otherSizeRange.max.height}); return {{w.min, h.min}, {w.max, h.max}}; } diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 2007c28da8..7766295692 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -251,10 +251,10 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( if (ASLayoutIsDisplayNodeType(layout)) { if (sublayoutsCount > 0 || CGPointEqualToPoint(ASCeilPointValues(absolutePosition), layout.position) == NO) { // Only create a new layout if the existing one can't be reused, which means it has either some sublayouts or an invalid absolute position. - auto newLayout = [ASLayout layoutWithLayoutElement:layout->_layoutElement - size:layout.size - position:absolutePosition - sublayouts:@[]]; + let newLayout = [ASLayout layoutWithLayoutElement:layout->_layoutElement + size:layout.size + position:absolutePosition + sublayouts:@[]]; flattenedSublayouts.push_back(newLayout); } else { flattenedSublayouts.push_back(layout); @@ -348,11 +348,11 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( NSMutableArray *result = [NSMutableArray array]; [result addObject:@{ @"size" : [NSValue valueWithCGSize:self.size] }]; - if (auto layoutElement = self.layoutElement) { + if (let layoutElement = self.layoutElement) { [result addObject:@{ @"layoutElement" : layoutElement }]; } - auto pos = self.position; + let pos = self.position; if (!ASPointIsNull(pos)) { [result addObject:@{ @"position" : [NSValue valueWithCGPoint:pos] }]; } diff --git a/Source/Layout/ASLayoutSpec.mm b/Source/Layout/ASLayoutSpec.mm index d52702fbaa..010eee43e7 100644 --- a/Source/Layout/ASLayoutSpec.mm +++ b/Source/Layout/ASLayoutSpec.mm @@ -166,10 +166,10 @@ ASLayoutElementStyleExtensibilityForwarding - (NSMutableArray *)propertiesForDescription { - auto result = [NSMutableArray array]; + let result = [NSMutableArray array]; if (NSArray *children = self.children) { // Use tiny descriptions because these trees can get nested very deep. - auto tinyDescriptions = ASArrayByFlatMapping(children, id object, ASObjectDescriptionMakeTiny(object)); + let tinyDescriptions = ASArrayByFlatMapping(children, id object, ASObjectDescriptionMakeTiny(object)); [result addObject:@{ @"children": tinyDescriptions }]; } return result; diff --git a/Source/Layout/ASRatioLayoutSpec.mm b/Source/Layout/ASRatioLayoutSpec.mm index aec3a9c8f1..194eed20c3 100644 --- a/Source/Layout/ASRatioLayoutSpec.mm +++ b/Source/Layout/ASRatioLayoutSpec.mm @@ -83,7 +83,7 @@ } // Choose the size closest to the desired ratio. - const auto &bestSize = std::max_element(sizeOptions.begin(), sizeOptions.end(), [&](const CGSize &a, const CGSize &b){ + let &bestSize = std::max_element(sizeOptions.begin(), sizeOptions.end(), [&](const CGSize &a, const CGSize &b){ return std::fabs((a.height / a.width) - _ratio) > std::fabs((b.height / b.width) - _ratio); }); diff --git a/Source/Layout/ASStackLayoutSpec.mm b/Source/Layout/ASStackLayoutSpec.mm index 3952ab6e8b..f7ace8cd1e 100644 --- a/Source/Layout/ASStackLayoutSpec.mm +++ b/Source/Layout/ASStackLayoutSpec.mm @@ -160,7 +160,7 @@ self.style.descender = stackChildren.back().style.descender; } - auto sublayouts = [[NSMutableArray alloc] init]; + const auto sublayouts = [[NSMutableArray alloc] init]; for (const auto &item : positionedLayout.items) { [sublayouts addObject:item.layout]; } diff --git a/Source/Private/ASCollectionLayoutCache.mm b/Source/Private/ASCollectionLayoutCache.mm index 94b2bc18b6..102f516188 100644 --- a/Source/Private/ASCollectionLayoutCache.mm +++ b/Source/Private/ASCollectionLayoutCache.mm @@ -62,7 +62,7 @@ } ASDN::MutexLocker l(__instanceLock__); - auto innerMap = [_map objectForKey:elements]; + var innerMap = [_map objectForKey:elements]; if (innerMap == nil) { innerMap = [NSMapTable strongToStrongObjectsMapTable]; [_map setObject:innerMap forKey:elements]; diff --git a/Source/Private/ASMutableElementMap.m b/Source/Private/ASMutableElementMap.m index 2b51902131..a5b40d0518 100644 --- a/Source/Private/ASMutableElementMap.m +++ b/Source/Private/ASMutableElementMap.m @@ -142,7 +142,7 @@ typedef NSMutableDictionary * _Nonnull obj, BOOL * _Nonnull stop) { deepCopy[key] = [obj mutableCopy]; }]; diff --git a/Source/Private/ASRectMap.mm b/Source/Private/ASRectMap.mm index 2e4398c32a..14c3754808 100644 --- a/Source/Private/ASRectMap.mm +++ b/Source/Private/ASRectMap.mm @@ -26,7 +26,7 @@ - (CGRect)rectForKey:(id)key { - auto result = _map.find((__bridge void *)key); + let result = _map.find((__bridge void *)key); if (result != _map.end()) { // result->first is the key; result->second is the value, a CGRect. return result->second; @@ -62,8 +62,8 @@ // { ptr1->rect1 ptr2->rect2 ptr3->rect3 } NSMutableString *str = [NSMutableString string]; - for (auto it = _map.begin(); it != _map.end(); it++) { - [str appendFormat:@" %@->%@", it->first, NSStringFromCGRect(it->second)]; + for (let &e : _map) { + [str appendFormat:@" %@->%@", e.first, NSStringFromCGRect(e.second)]; } [result addObject:@{ @"ASRectMap": str }]; diff --git a/Source/Private/_ASCoreAnimationExtras.mm b/Source/Private/_ASCoreAnimationExtras.mm index 34a515abd2..bdf51a768c 100644 --- a/Source/Private/_ASCoreAnimationExtras.mm +++ b/Source/Private/_ASCoreAnimationExtras.mm @@ -98,7 +98,7 @@ static const struct _UIContentModeStringLUTEntry UIContentModeDescriptionLUT[] = NSString *ASDisplayNodeNSStringFromUIContentMode(UIViewContentMode contentMode) { - for (auto &e : UIContentModeDescriptionLUT) { + for (let &e : UIContentModeDescriptionLUT) { if (e.contentMode == contentMode) { return e.string; } @@ -108,7 +108,7 @@ NSString *ASDisplayNodeNSStringFromUIContentMode(UIViewContentMode contentMode) UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string) { - for (auto &e : UIContentModeDescriptionLUT) { + for (let &e : UIContentModeDescriptionLUT) { if (ASObjectIsEqual(e.string, string)) { return e.contentMode; } @@ -118,7 +118,7 @@ UIViewContentMode ASDisplayNodeUIContentModeFromNSString(NSString *string) NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIViewContentMode contentMode) { - for (auto &e : UIContentModeCAGravityLUT) { + for (let &e : UIContentModeCAGravityLUT) { if (e.contentMode == contentMode) { return e.string; } @@ -140,7 +140,7 @@ UIViewContentMode ASDisplayNodeUIContentModeFromCAContentsGravity(NSString *cons return cachedModes[foundCacheIndex]; } - for (auto &e : UIContentModeCAGravityLUT) { + for (let &e : UIContentModeCAGravityLUT) { if (ASObjectIsEqual(e.string, contentsGravity)) { UIViewContentMode foundContentMode = e.contentMode; diff --git a/Source/Private/_ASHierarchyChangeSet.mm b/Source/Private/_ASHierarchyChangeSet.mm index f35b656e3b..437e7c56ce 100644 --- a/Source/Private/_ASHierarchyChangeSet.mm +++ b/Source/Private/_ASHierarchyChangeSet.mm @@ -238,7 +238,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) - (NSIndexSet *)indexesForItemChangesOfType:(_ASHierarchyChangeType)changeType inSection:(NSUInteger)section { [self _ensureCompleted]; - auto result = [[NSMutableIndexSet alloc] init]; + let result = [[NSMutableIndexSet alloc] init]; for (_ASHierarchyItemChange *change in [self itemChangesOfType:changeType]) { [result addIndexes:[NSIndexSet as_indexSetFromIndexPaths:change.indexPaths inSection:section]]; } @@ -280,10 +280,10 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) if (_itemMappings == nil) { _itemMappings = [[NSMutableArray alloc] init]; - auto insertMap = [_ASHierarchyItemChange sectionToIndexSetMapFromChanges:_originalInsertItemChanges]; - auto deleteMap = [_ASHierarchyItemChange sectionToIndexSetMapFromChanges:_originalDeleteItemChanges]; + let insertMap = [_ASHierarchyItemChange sectionToIndexSetMapFromChanges:_originalInsertItemChanges]; + let deleteMap = [_ASHierarchyItemChange sectionToIndexSetMapFromChanges:_originalDeleteItemChanges]; NSInteger oldSection = 0; - for (auto oldCount : _oldItemCounts) { + for (let oldCount : _oldItemCounts) { NSInteger newSection = [self newSectionForOldSection:oldSection]; ASIntegerMap *table; if (newSection == NSNotFound) { @@ -498,7 +498,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) for (_ASHierarchyItemChange *change in _reloadItemChanges) { NSAssert(change.changeType == _ASHierarchyChangeTypeReload, @"It must be a reload change to be in here"); - auto newIndexPaths = ASArrayByFlatMapping(change.indexPaths, NSIndexPath *indexPath, [self newIndexPathForOldIndexPath:indexPath]); + let newIndexPaths = ASArrayByFlatMapping(change.indexPaths, NSIndexPath *indexPath, [self newIndexPathForOldIndexPath:indexPath]); // All reload changes are translated into deletes and inserts // We delete the items that needs reload together with other deleted items, at their original index @@ -752,7 +752,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) NSMutableArray *result = [[NSMutableArray alloc] init]; __block ASDataControllerAnimationOptions currentOptions = 0; - auto currentIndexes = [[NSMutableIndexSet alloc] init]; + let currentIndexes = [[NSMutableIndexSet alloc] init]; BOOL reverse = type == _ASHierarchyChangeTypeDelete || type == _ASHierarchyChangeTypeOriginalDelete; NSEnumerationOptions options = reverse ? NSEnumerationReverse : kNilOptions; @@ -791,7 +791,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) + (NSMutableIndexSet *)allIndexesInSectionChanges:(NSArray<_ASHierarchySectionChange *> *)changes { - auto indexes = [[NSMutableIndexSet alloc] init]; + let indexes = [[NSMutableIndexSet alloc] init]; for (_ASHierarchySectionChange *change in changes) { [indexes addIndexes:change.indexSet]; } @@ -918,10 +918,10 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) ASDisplayNodeAssert(ASHierarchyChangeTypeIsFinal(type), @"Attempt to sort and coalesce item changes of intermediary type %@. Why?", NSStringFromASHierarchyChangeType(type)); // Lookup table [NSIndexPath: AnimationOptions] - NSMutableDictionary *animationOptions = [NSMutableDictionary new]; + let animationOptions = [[NSMutableDictionary alloc] init]; // All changed index paths, sorted - NSMutableArray *allIndexPaths = [[NSMutableArray alloc] init]; + let allIndexPaths = [[NSMutableArray alloc] init]; for (_ASHierarchyItemChange *change in changes) { for (NSIndexPath *indexPath in change.indexPaths) { @@ -936,10 +936,10 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) [allIndexPaths sortUsingSelector:sorting]; // Create new changes by grouping sorted changes by animation option - auto result = [[NSMutableArray<_ASHierarchyItemChange *> alloc] init]; + let result = [[NSMutableArray<_ASHierarchyItemChange *> alloc] init]; ASDataControllerAnimationOptions currentOptions = 0; - auto currentIndexPaths = [[NSMutableArray alloc] init]; + let currentIndexPaths = [[NSMutableArray alloc] init]; for (NSIndexPath *indexPath in allIndexPaths) { ASDataControllerAnimationOptions options = [animationOptions[indexPath] integerValue]; diff --git a/Tests/ASCollectionModernDataSourceTests.m b/Tests/ASCollectionModernDataSourceTests.m index ff084a7b16..046b6a374f 100644 --- a/Tests/ASCollectionModernDataSourceTests.m +++ b/Tests/ASCollectionModernDataSourceTests.m @@ -308,8 +308,7 @@ [self expectDataSourceCountMethods]; // Combine reloads + inserts and expect them to load content for all of them, in ascending order. - NSMutableDictionary *insertsPlusReloads = [NSMutableDictionary dictionary]; - [insertsPlusReloads addEntriesFromDictionary:insertedItems]; + NSMutableDictionary *insertsPlusReloads = [[NSMutableDictionary alloc] initWithDictionary:insertedItems]; // Go through reloaded sections and add all their items into `insertsPlusReloads` [reloadedSectionIndexes enumerateIndexesUsingBlock:^(NSUInteger section, BOOL * _Nonnull stop) { diff --git a/Tests/ASLayoutEngineTests.mm b/Tests/ASLayoutEngineTests.mm index 719a84d5ee..6b864c4da0 100644 --- a/Tests/ASLayoutEngineTests.mm +++ b/Tests/ASLayoutEngineTests.mm @@ -298,7 +298,7 @@ // are common to both fixture2 and fixture4 are available from the cache. } else { // Incorrect behavior: nodeC will get measured against its new bounds on main. - auto cPendingSize = [fixture2 layoutForNode:nodeC].size; + let cPendingSize = [fixture2 layoutForNode:nodeC].size; OCMExpect([nodeC.mock calculateLayoutThatFits:ASSizeRangeMake(cPendingSize)]).onMainThread(); } [window layoutIfNeeded]; @@ -368,16 +368,16 @@ - (void)verifyFixture:(ASTLayoutFixture *)fixture { - auto expected = fixture.layout; + let expected = fixture.layout; // Ensure expected == frames - auto frames = [fixture.rootNode currentLayoutBasedOnFrames]; + let frames = [fixture.rootNode currentLayoutBasedOnFrames]; if (![expected isEqual:frames]) { XCTFail(@"\n*** Layout verification failed – frames don't match expected. ***\nGot:\n%@\nExpected:\n%@", [frames recursiveDescription], [expected recursiveDescription]); } // Ensure expected == calculatedLayout - auto calculated = fixture.rootNode.calculatedLayout; + let calculated = fixture.rootNode.calculatedLayout; if (![expected isEqual:calculated]) { XCTFail(@"\n*** Layout verification failed – calculated layout doesn't match expected. ***\nGot:\n%@\nExpected:\n%@", [calculated recursiveDescription], [expected recursiveDescription]); } @@ -406,22 +406,22 @@ */ - (ASTLayoutFixture *)createFixture1 { - auto fixture = [[ASTLayoutFixture alloc] init]; + let fixture = [[ASTLayoutFixture alloc] init]; // nodeB [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeB]; - auto layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; + let layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; // nodeC [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeC]; - auto layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{4,0} sublayouts:nil]; + let layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{4,0} sublayouts:nil]; // nodeD [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeD]; - auto layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; + let layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; [fixture addSizeRange:{{10, 1}, {10, 1}} forNode:nodeA]; - auto layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; + let layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; fixture.layout = layoutA; [fixture.layoutSpecBlocks setObject:fixture1and3and5NodeALayoutSpecBlock forKey:nodeA]; @@ -441,22 +441,22 @@ */ - (ASTLayoutFixture *)createFixture2 { - auto fixture = [[ASTLayoutFixture alloc] init]; + let fixture = [[ASTLayoutFixture alloc] init]; // nodeB [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeB]; - auto layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; + let layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; // nodeC [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeC]; - auto layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{4,1} position:{3,0} sublayouts:nil]; + let layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{4,1} position:{3,0} sublayouts:nil]; // nodeE [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeE]; - auto layoutE = [ASLayout layoutWithLayoutElement:nodeE size:{1,1} position:{9,0} sublayouts:nil]; + let layoutE = [ASLayout layoutWithLayoutElement:nodeE size:{1,1} position:{9,0} sublayouts:nil]; [fixture addSizeRange:{{10, 1}, {10, 1}} forNode:nodeA]; - auto layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutE ]]; + let layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutE ]]; fixture.layout = layoutA; ASLayoutSpecBlock specBlockA = ^ASLayoutSpec * _Nonnull(__kindof ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize) { @@ -477,24 +477,24 @@ */ - (ASTLayoutFixture *)createFixture3 { - auto fixture = [[ASTLayoutFixture alloc] init]; + let fixture = [[ASTLayoutFixture alloc] init]; // nodeB wants 8,1 but it will settle for 7,1 [fixture setReturnedSize:{8,1} forNode:nodeB]; [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeB]; [fixture addSizeRange:{{7, 0}, {7, 1}} forNode:nodeB]; - auto layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{7,1} position:{0,0} sublayouts:nil]; + let layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{7,1} position:{0,0} sublayouts:nil]; // nodeC [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeC]; - auto layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{7,0} sublayouts:nil]; + let layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{7,0} sublayouts:nil]; // nodeD [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeD]; - auto layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; + let layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; [fixture addSizeRange:{{10, 1}, {10, 1}} forNode:nodeA]; - auto layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; + let layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; fixture.layout = layoutA; [fixture.layoutSpecBlocks setObject:fixture1and3and5NodeALayoutSpecBlock forKey:nodeA]; @@ -520,22 +520,22 @@ */ - (ASTLayoutFixture *)createFixture4 { - auto fixture = [[ASTLayoutFixture alloc] init]; + let fixture = [[ASTLayoutFixture alloc] init]; // nodeB [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeB]; - auto layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; + let layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; // nodeD [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeD]; - auto layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{2,1} position:{4,0} sublayouts:nil]; + let layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{2,1} position:{4,0} sublayouts:nil]; // nodeE [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeE]; - auto layoutE = [ASLayout layoutWithLayoutElement:nodeE size:{1,1} position:{9,0} sublayouts:nil]; + let layoutE = [ASLayout layoutWithLayoutElement:nodeE size:{1,1} position:{9,0} sublayouts:nil]; [fixture addSizeRange:{{10, 1}, {10, 1}} forNode:nodeA]; - auto layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutD, layoutE ]]; + let layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{10,1} position:ASPointNull sublayouts:@[ layoutB, layoutD, layoutE ]]; fixture.layout = layoutA; ASLayoutSpecBlock specBlockA = ^ASLayoutSpec * _Nonnull(__kindof ASDisplayNode * _Nonnull node, ASSizeRange constrainedSize) { @@ -552,22 +552,22 @@ */ - (ASTLayoutFixture *)createFixture5 { - auto fixture = [[ASTLayoutFixture alloc] init]; + let fixture = [[ASTLayoutFixture alloc] init]; // nodeB [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeB]; - auto layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; + let layoutB = [ASLayout layoutWithLayoutElement:nodeB size:{1,1} position:{0,0} sublayouts:nil]; // nodeC [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeC]; - auto layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{4,0} sublayouts:nil]; + let layoutC = [ASLayout layoutWithLayoutElement:nodeC size:{2,1} position:{4,0} sublayouts:nil]; // nodeD [fixture addSizeRange:{{0, 0}, {INFINITY, 1}} forNode:nodeD]; - auto layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; + let layoutD = [ASLayout layoutWithLayoutElement:nodeD size:{1,1} position:{9,0} sublayouts:nil]; [fixture addSizeRange:{{15, 1}, {15, 1}} forNode:nodeA]; - auto layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{15,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; + let layoutA = [ASLayout layoutWithLayoutElement:nodeA size:{15,1} position:ASPointNull sublayouts:@[ layoutB, layoutC, layoutD ]]; fixture.layout = layoutA; [fixture.layoutSpecBlocks setObject:fixture1and3and5NodeALayoutSpecBlock forKey:nodeA]; diff --git a/Tests/ASLayoutTestNode.mm b/Tests/ASLayoutTestNode.mm index 3a112422a7..3b064b814f 100644 --- a/Tests/ASLayoutTestNode.mm +++ b/Tests/ASLayoutTestNode.mm @@ -39,7 +39,7 @@ - (ASLayout *)_currentLayoutBasedOnFramesForRootNode:(BOOL)isRootNode { - auto sublayouts = [NSMutableArray array]; + let sublayouts = [[NSMutableArray alloc] init]; for (ASLayoutTestNode *subnode in self.subnodes) { [sublayouts addObject:[subnode _currentLayoutBasedOnFramesForRootNode:NO]]; } @@ -64,7 +64,7 @@ return [super calculateLayoutThatFits:constrainedSize]; } else { // Interestingly, the infra will auto-clamp sizes from calculateSizeThatFits, but not from calculateLayoutThatFits. - auto size = ASSizeRangeClamp(constrainedSize, self.testSize); + let size = ASSizeRangeClamp(constrainedSize, self.testSize); return [ASLayout layoutWithLayoutElement:self size:size]; } } diff --git a/Tests/ASPerformanceTestContext.m b/Tests/ASPerformanceTestContext.m index ee6027aff7..94f5dba204 100644 --- a/Tests/ASPerformanceTestContext.m +++ b/Tests/ASPerformanceTestContext.m @@ -2,8 +2,17 @@ // ASPerformanceTestContext.m // Texture // -// Created by Adlai Holler on 8/28/16. -// Copyright © 2016 Facebook. All rights reserved. +// 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 /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) through the 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 @@ -24,7 +33,7 @@ { self = [super init]; if (self != nil) { - _userInfo = [NSMutableDictionary dictionary]; + _userInfo = [[NSMutableDictionary alloc] init]; } return self; } diff --git a/Tests/ASTLayoutFixture.mm b/Tests/ASTLayoutFixture.mm index 2232e91904..7e4878cf29 100644 --- a/Tests/ASTLayoutFixture.mm +++ b/Tests/ASTLayoutFixture.mm @@ -37,9 +37,9 @@ - (void)addSizeRange:(ASSizeRange)sizeRange forNode:(ASLayoutTestNode *)node { - auto ranges = [_sizeRanges objectForKey:node]; + var ranges = [_sizeRanges objectForKey:node]; if (ranges == nil) { - ranges = [NSMutableArray array]; + ranges = [[NSMutableArray alloc] init]; [_sizeRanges setObject:ranges forKey:node]; } [ranges addObject:[NSValue valueWithBytes:&sizeRange objCType:@encode(ASSizeRange)]]; @@ -52,7 +52,7 @@ - (ASSizeRange)firstSizeRangeForNode:(ASLayoutTestNode *)node { - auto val = [_sizeRanges objectForKey:node].firstObject; + let val = [_sizeRanges objectForKey:node].firstObject; ASSizeRange r; [val getValue:&r]; return r; @@ -104,7 +104,7 @@ - (NSSet *)allNodes { - auto allLayouts = [NSMutableArray array]; + let allLayouts = [NSMutableArray array]; [ASTLayoutFixture collectAllLayoutsFromLayout:self.layout array:allLayouts]; return [NSSet setWithArray:[allLayouts valueForKey:@"layoutElement"]]; } @@ -113,7 +113,7 @@ { // Update layoutSpecBlock for parent nodes, set automatic subnode management for (ASDisplayNode *node in _layoutSpecBlocks) { - auto block = [_layoutSpecBlocks objectForKey:node]; + let block = [_layoutSpecBlocks objectForKey:node]; if (node.layoutSpecBlock != block) { node.automaticallyManagesSubnodes = YES; node.layoutSpecBlock = block; @@ -128,9 +128,9 @@ /// to the layout size if needed, then call -setNeedsLayout - (void)setTestSizesOfLeafNodesInLayout:(ASLayout *)layout { - auto node = (ASLayoutTestNode *)layout.layoutElement; + let node = (ASLayoutTestNode *)layout.layoutElement; if (layout.sublayouts.count == 0) { - auto override = [self.returnedSizes objectForKey:node]; + let override = [self.returnedSizes objectForKey:node]; node.testSize = override ? override.CGSizeValue : layout.size; } else { node.testSize = CGSizeZero; From a08d2210cfa87bd4b44d4cc3c4749c4f93b197b9 Mon Sep 17 00:00:00 2001 From: Sergey Pronin <1236794+wannabehero@users.noreply.github.com> Date: Tue, 10 Jul 2018 21:16:13 +0300 Subject: [PATCH 16/97] [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy (#1015) * Adds missing UIScrollViewDelegate method to IGListKit proxy implementation * Updates CHANGELOG --- CHANGELOG.md | 1 + Source/Private/ASIGListAdapterBasedDataSource.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 608e20e81b..53b52df65d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) - Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) - Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) +- [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/Private/ASIGListAdapterBasedDataSource.m b/Source/Private/ASIGListAdapterBasedDataSource.m index ab18636228..dc63e53b78 100644 --- a/Source/Private/ASIGListAdapterBasedDataSource.m +++ b/Source/Private/ASIGListAdapterBasedDataSource.m @@ -115,6 +115,11 @@ typedef struct { [self.delegate scrollViewDidEndDragging:scrollView willDecelerate:decelerate]; } +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView +{ + [self.delegate scrollViewDidEndDecelerating:scrollView]; +} + - (BOOL)shouldBatchFetchForCollectionNode:(ASCollectionNode *)collectionNode { NSInteger sectionCount = [self numberOfSectionsInCollectionNode:collectionNode]; From 5ffcd405c6c6052a8de7ce35515077891e9bd9fa Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 12 Jul 2018 11:25:35 -0700 Subject: [PATCH 17/97] Fix misleading/scary stack trace shown when an assertion occurs during node measurement (#1022) - Currently, there is a pair of mutex unlock and unlock that wraps around `-_u_measureNodeWithBoundsIfNecessary:` in `__layout`. That is because this method must be called without the lock. - When an assertion occurs within that method, the runtime bails early without reacquire the lock (so the lock is free now). However, the runtime then hits the end of the outmost mutex locker scope and tries to release the lock that it no longer holds, causing another assertion in ASThread to be shown to user (#932). This makes it extremely hard to idenfity the root assertion. - Fix by replacing the unlock/lock pair with a mutex unlocker. --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53b52df65d..2002cc0add 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) - Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) - [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) +- Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 53dfac3d36..2b251adbc0 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -1040,10 +1040,11 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); // This method will confirm that the layout is up to date (and update if needed). // Importantly, it will also APPLY the layout to all of our subnodes if (unless parent is transitioning). - __instanceLock__.unlock(); - [self _u_measureNodeWithBoundsIfNecessary:bounds]; - __instanceLock__.lock(); - + { + ASDN::MutexUnlocker u(__instanceLock__); + [self _u_measureNodeWithBoundsIfNecessary:bounds]; + } + [self _locked_layoutPlaceholderIfNecessary]; } From 814fc382c7b76ebe65ab9f06584da2a19a4a514c Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 12 Jul 2018 11:26:26 -0700 Subject: [PATCH 18/97] Make sure -_completePendingLayoutTransition is called without the node's instance lock #trivial (#1023) This is because committing the layout transition (aka `-_completeLayoutTransition:`) results in subnode insertions and removals which must be called lock-free. --- Source/ASDisplayNode+Layout.mm | 225 +++++++++++++++++---------------- 1 file changed, 118 insertions(+), 107 deletions(-) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 2ec4a9bff6..e77c354ab9 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -296,113 +296,118 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_u_measureNodeWithBoundsIfNecessary:(CGRect)bounds { ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock); - ASDN::MutexLocker l(__instanceLock__); - // Check if we are a subnode in a layout transition. - // In this case no measurement is needed as it's part of the layout transition - if ([self _isLayoutTransitionInvalid]) { - return; - } - CGSize boundsSizeForLayout = ASCeilSizeValues(bounds.size); - - // Prefer a newer and not yet applied _pendingDisplayNodeLayout over _calculatedDisplayNodeLayout - // If there is no such _pending, check if _calculated is valid to reuse (avoiding recalculation below). - BOOL pendingLayoutIsPreferred = NO; - if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { - NSUInteger calculatedVersion = _calculatedDisplayNodeLayout->version; - NSUInteger pendingVersion = _pendingDisplayNodeLayout->version; - if (pendingVersion > calculatedVersion) { - pendingLayoutIsPreferred = YES; // Newer _pending - } else if (pendingVersion == calculatedVersion - && !ASSizeRangeEqualToSizeRange(_pendingDisplayNodeLayout->constrainedSize, - _calculatedDisplayNodeLayout->constrainedSize)) { - pendingLayoutIsPreferred = YES; // _pending with a different constrained size + BOOL isInLayoutPendingState = NO; + { + ASDN::MutexLocker l(__instanceLock__); + // Check if we are a subnode in a layout transition. + // In this case no measurement is needed as it's part of the layout transition + if ([self _isLayoutTransitionInvalid]) { + return; } - } - BOOL calculatedLayoutIsReusable = (_calculatedDisplayNodeLayout->isValid(_layoutVersion) - && (_calculatedDisplayNodeLayout->requestedLayoutFromAbove - || CGSizeEqualToSize(_calculatedDisplayNodeLayout->layout.size, boundsSizeForLayout))); - if (!pendingLayoutIsPreferred && calculatedLayoutIsReusable) { - return; + + CGSize boundsSizeForLayout = ASCeilSizeValues(bounds.size); + + // Prefer a newer and not yet applied _pendingDisplayNodeLayout over _calculatedDisplayNodeLayout + // If there is no such _pending, check if _calculated is valid to reuse (avoiding recalculation below). + BOOL pendingLayoutIsPreferred = NO; + if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { + NSUInteger calculatedVersion = _calculatedDisplayNodeLayout->version; + NSUInteger pendingVersion = _pendingDisplayNodeLayout->version; + if (pendingVersion > calculatedVersion) { + pendingLayoutIsPreferred = YES; // Newer _pending + } else if (pendingVersion == calculatedVersion + && !ASSizeRangeEqualToSizeRange(_pendingDisplayNodeLayout->constrainedSize, + _calculatedDisplayNodeLayout->constrainedSize)) { + pendingLayoutIsPreferred = YES; // _pending with a different constrained size + } + } + BOOL calculatedLayoutIsReusable = (_calculatedDisplayNodeLayout->isValid(_layoutVersion) + && (_calculatedDisplayNodeLayout->requestedLayoutFromAbove + || CGSizeEqualToSize(_calculatedDisplayNodeLayout->layout.size, boundsSizeForLayout))); + if (!pendingLayoutIsPreferred && calculatedLayoutIsReusable) { + return; + } + + as_activity_create_for_scope("Update node layout for current bounds"); + as_log_verbose(ASLayoutLog(), "Node %@, bounds size %@, calculatedSize %@, calculatedIsDirty %d", self, NSStringFromCGSize(boundsSizeForLayout), NSStringFromCGSize(_calculatedDisplayNodeLayout->layout.size), _calculatedDisplayNodeLayout->version < _layoutVersion.load()); + // _calculatedDisplayNodeLayout is not reusable we need to transition to a new one + [self cancelLayoutTransition]; + + BOOL didCreateNewContext = NO; + ASLayoutElementContext *context = ASLayoutElementGetCurrentContext(); + if (context == nil) { + context = [[ASLayoutElementContext alloc] init]; + ASLayoutElementPushContext(context); + didCreateNewContext = YES; + } + + // Figure out previous and pending layouts for layout transition + std::shared_ptr nextLayout = _pendingDisplayNodeLayout; +#define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout->layout.size, boundsSizeForLayout) + + // nextLayout was likely created by a call to layoutThatFits:, check if it is valid and can be applied. + // If our bounds size is different than it, or invalid, recalculate. Use #define to avoid nullptr-> + BOOL pendingLayoutApplicable = NO; + if (nextLayout == nullptr) { + as_log_verbose(ASLayoutLog(), "No pending layout."); + } else if (nextLayout->version < _layoutVersion) { + as_log_verbose(ASLayoutLog(), "Pending layout is stale."); + } else if (layoutSizeDifferentFromBounds) { + as_log_verbose(ASLayoutLog(), "Pending layout size %@ doesn't match bounds size.", NSStringFromCGSize(nextLayout->layout.size)); + } else { + as_log_verbose(ASLayoutLog(), "Using pending layout %@.", nextLayout->layout); + pendingLayoutApplicable = YES; + } + + if (!pendingLayoutApplicable) { + as_log_verbose(ASLayoutLog(), "Measuring with previous constrained size."); + // Use the last known constrainedSize passed from a parent during layout (if never, use bounds). + NSUInteger version = _layoutVersion; + ASSizeRange constrainedSize = [self _locked_constrainedSizeForLayoutPass]; + ASLayout *layout = [self calculateLayoutThatFits:constrainedSize + restrictedToSize:self.style.size + relativeToParentSize:boundsSizeForLayout]; + nextLayout = std::make_shared(layout, constrainedSize, boundsSizeForLayout, version); + // Now that the constrained size of pending layout might have been reused, the layout is useless + // Release it and any orphaned subnodes it retains + _pendingDisplayNodeLayout = nullptr; + } + + if (didCreateNewContext) { + ASLayoutElementPopContext(); + } + + // If our new layout's desired size for self doesn't match current size, ask our parent to update it. + // This can occur for either pre-calculated or newly-calculated layouts. + if (nextLayout->requestedLayoutFromAbove == NO + && CGSizeEqualToSize(boundsSizeForLayout, nextLayout->layout.size) == NO) { + as_log_verbose(ASLayoutLog(), "Layout size doesn't match bounds size. Requesting layout from above."); + // The layout that we have specifies that this node (self) would like to be a different size + // than it currently is. Because that size has been computed within the constrainedSize, we + // expect that calling setNeedsLayoutFromAbove will result in our parent resizing us to this. + // However, in some cases apps may manually interfere with this (setting a different bounds). + // In this case, we need to detect that we've already asked to be resized to match this + // particular ASLayout object, and shouldn't loop asking again unless we have a different ASLayout. + nextLayout->requestedLayoutFromAbove = YES; + __instanceLock__.unlock(); + [self _u_setNeedsLayoutFromAbove]; + __instanceLock__.lock(); + // Update the layout's version here because _u_setNeedsLayoutFromAbove calls __setNeedsLayout which in turn increases _layoutVersion + // Failing to do this will cause the layout to be invalid immediately + nextLayout->version = _layoutVersion; + } + + // Prepare to transition to nextLayout + ASDisplayNodeAssertNotNil(nextLayout->layout, @"nextLayout->layout should not be nil! %@", self); + _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self + pendingLayout:nextLayout + previousLayout:_calculatedDisplayNodeLayout]; + isInLayoutPendingState = ASHierarchyStateIncludesLayoutPending(_hierarchyState); } - as_activity_create_for_scope("Update node layout for current bounds"); - as_log_verbose(ASLayoutLog(), "Node %@, bounds size %@, calculatedSize %@, calculatedIsDirty %d", self, NSStringFromCGSize(boundsSizeForLayout), NSStringFromCGSize(_calculatedDisplayNodeLayout->layout.size), _calculatedDisplayNodeLayout->version < _layoutVersion.load()); - // _calculatedDisplayNodeLayout is not reusable we need to transition to a new one - [self cancelLayoutTransition]; - - BOOL didCreateNewContext = NO; - ASLayoutElementContext *context = ASLayoutElementGetCurrentContext(); - if (context == nil) { - context = [[ASLayoutElementContext alloc] init]; - ASLayoutElementPushContext(context); - didCreateNewContext = YES; - } - - // Figure out previous and pending layouts for layout transition - std::shared_ptr nextLayout = _pendingDisplayNodeLayout; - #define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout->layout.size, boundsSizeForLayout) - - // nextLayout was likely created by a call to layoutThatFits:, check if it is valid and can be applied. - // If our bounds size is different than it, or invalid, recalculate. Use #define to avoid nullptr-> - BOOL pendingLayoutApplicable = NO; - if (nextLayout == nullptr) { - as_log_verbose(ASLayoutLog(), "No pending layout."); - } else if (nextLayout->version < _layoutVersion) { - as_log_verbose(ASLayoutLog(), "Pending layout is stale."); - } else if (layoutSizeDifferentFromBounds) { - as_log_verbose(ASLayoutLog(), "Pending layout size %@ doesn't match bounds size.", NSStringFromCGSize(nextLayout->layout.size)); - } else { - as_log_verbose(ASLayoutLog(), "Using pending layout %@.", nextLayout->layout); - pendingLayoutApplicable = YES; - } - - if (!pendingLayoutApplicable) { - as_log_verbose(ASLayoutLog(), "Measuring with previous constrained size."); - // Use the last known constrainedSize passed from a parent during layout (if never, use bounds). - NSUInteger version = _layoutVersion; - ASSizeRange constrainedSize = [self _locked_constrainedSizeForLayoutPass]; - ASLayout *layout = [self calculateLayoutThatFits:constrainedSize - restrictedToSize:self.style.size - relativeToParentSize:boundsSizeForLayout]; - nextLayout = std::make_shared(layout, constrainedSize, boundsSizeForLayout, version); - // Now that the constrained size of pending layout might have been reused, the layout is useless - // Release it and any orphaned subnodes it retains - _pendingDisplayNodeLayout = nullptr; - } - - if (didCreateNewContext) { - ASLayoutElementPopContext(); - } - - // If our new layout's desired size for self doesn't match current size, ask our parent to update it. - // This can occur for either pre-calculated or newly-calculated layouts. - if (nextLayout->requestedLayoutFromAbove == NO - && CGSizeEqualToSize(boundsSizeForLayout, nextLayout->layout.size) == NO) { - as_log_verbose(ASLayoutLog(), "Layout size doesn't match bounds size. Requesting layout from above."); - // The layout that we have specifies that this node (self) would like to be a different size - // than it currently is. Because that size has been computed within the constrainedSize, we - // expect that calling setNeedsLayoutFromAbove will result in our parent resizing us to this. - // However, in some cases apps may manually interfere with this (setting a different bounds). - // In this case, we need to detect that we've already asked to be resized to match this - // particular ASLayout object, and shouldn't loop asking again unless we have a different ASLayout. - nextLayout->requestedLayoutFromAbove = YES; - __instanceLock__.unlock(); - [self _u_setNeedsLayoutFromAbove]; - __instanceLock__.lock(); - // Update the layout's version here because _u_setNeedsLayoutFromAbove calls __setNeedsLayout which in turn increases _layoutVersion - // Failing to do this will cause the layout to be invalid immediately - nextLayout->version = _layoutVersion; - } - - // Prepare to transition to nextLayout - ASDisplayNodeAssertNotNil(nextLayout->layout, @"nextLayout->layout should not be nil! %@", self); - _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self - pendingLayout:nextLayout - previousLayout:_calculatedDisplayNodeLayout]; - // If a parent is currently executing a layout transition, perform our layout application after it. - if (ASHierarchyStateIncludesLayoutPending(_hierarchyState) == NO) { + if (isInLayoutPendingState == NO) { // If no transition, apply our new layout immediately (common case). [self _completePendingLayoutTransition]; } @@ -860,12 +865,18 @@ ASLayoutElementStyleExtensibilityForwarding */ - (void)_completePendingLayoutTransition { - __instanceLock__.lock(); - ASLayoutTransition *pendingLayoutTransition = _pendingLayoutTransition; - __instanceLock__.unlock(); - + ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock); + + ASLayoutTransition *pendingLayoutTransition = nil; + { + ASDN::MutexLocker l(__instanceLock__); + pendingLayoutTransition = _pendingLayoutTransition; + if (pendingLayoutTransition != nil) { + [self _locked_setCalculatedDisplayNodeLayout:pendingLayoutTransition.pendingLayout]; + } + } + if (pendingLayoutTransition != nil) { - [self _setCalculatedDisplayNodeLayout:pendingLayoutTransition.pendingLayout]; [self _completeLayoutTransition:pendingLayoutTransition]; [self _pendingLayoutTransitionDidComplete]; } From 763332f2a7b22553fab9fd2605756efa8006415d Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 12 Jul 2018 15:39:02 -0700 Subject: [PATCH 19/97] Add showsHorizontal(Vertical)ScrollIndicator property applying from pending state (#1016) --- Source/ASCollectionNode.mm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index 9fbc19cce8..59714ef62e 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -199,14 +199,16 @@ if (_pendingState) { _ASCollectionPendingState *pendingState = _pendingState; - self.pendingState = nil; - view.asyncDelegate = pendingState.delegate; - view.asyncDataSource = pendingState.dataSource; - view.inverted = pendingState.inverted; - view.allowsSelection = pendingState.allowsSelection; - view.allowsMultipleSelection = pendingState.allowsMultipleSelection; - view.usesSynchronousDataLoading = pendingState.usesSynchronousDataLoading; - view.layoutInspector = pendingState.layoutInspector; + self.pendingState = nil; + view.asyncDelegate = pendingState.delegate; + view.asyncDataSource = pendingState.dataSource; + view.inverted = pendingState.inverted; + view.allowsSelection = pendingState.allowsSelection; + view.allowsMultipleSelection = pendingState.allowsMultipleSelection; + view.usesSynchronousDataLoading = pendingState.usesSynchronousDataLoading; + view.layoutInspector = pendingState.layoutInspector; + view.showsVerticalScrollIndicator = pendingState.showsVerticalScrollIndicator; + view.showsHorizontalScrollIndicator = pendingState.showsHorizontalScrollIndicator; // Only apply these flags if they're enabled; the view might come with them turned on. if (pendingState.alwaysBounceVertical) { From 7c1aee73150d93e8d3c2a274c0d44d254630b06a Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 12 Jul 2018 21:09:24 -0700 Subject: [PATCH 20/97] Fix i386 build by providing fallbacks to thread_local variables (#1025) --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 11 +++++++-- Source/Base/ASAssert.m | 36 +++++++++++++++++++++++++++++- Source/Base/ASAvailability.h | 6 +++++ Source/Layout/ASLayoutElement.mm | 38 ++++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2002cc0add..9e9b667d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) - [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) - Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) +- Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 2b251adbc0..7650399372 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -1076,22 +1076,29 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); restrictedToSize:(ASLayoutElementSize)size relativeToParentSize:(CGSize)parentSize { - // We only want one calculateLayout signpost interval per thread. - static _Thread_local NSInteger tls_callDepth; as_activity_scope_verbose(as_activity_create("Calculate node layout", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT)); as_log_verbose(ASLayoutLog(), "Calculating layout for %@ sizeRange %@", self, NSStringFromASSizeRange(constrainedSize)); + +#if AS_KDEBUG_ENABLE + // We only want one calculateLayout signpost interval per thread. + // Currently there is no fallback for profiling i386, since it's not useful. + static _Thread_local NSInteger tls_callDepth; if (tls_callDepth++ == 0) { ASSignpostStart(ASSignpostCalculateLayout); } +#endif ASSizeRange styleAndParentSize = ASLayoutElementSizeResolve(self.style.size, parentSize); const ASSizeRange resolvedRange = ASSizeRangeIntersect(constrainedSize, styleAndParentSize); ASLayout *result = [self calculateLayoutThatFits:resolvedRange]; as_log_verbose(ASLayoutLog(), "Calculated layout %@", result); +#if AS_KDEBUG_ENABLE if (--tls_callDepth == 0) { ASSignpostEnd(ASSignpostCalculateLayout); } +#endif + return result; } diff --git a/Source/Base/ASAssert.m b/Source/Base/ASAssert.m index d346dfedbe..0eceba944b 100644 --- a/Source/Base/ASAssert.m +++ b/Source/Base/ASAssert.m @@ -11,9 +11,11 @@ // #import +#import + +#if AS_TLS_AVAILABLE static _Thread_local int tls_mainThreadAssertionsDisabledCount; - BOOL ASMainThreadAssertionsAreDisabled() { return tls_mainThreadAssertionsDisabledCount > 0; } @@ -26,3 +28,35 @@ void ASPopMainThreadAssertionsDisabled() { tls_mainThreadAssertionsDisabledCount -= 1; ASDisplayNodeCAssert(tls_mainThreadAssertionsDisabledCount >= 0, @"Attempt to pop thread assertion-disabling without corresponding push."); } + +#else + +#import + +static pthread_key_t ASMainThreadAssertionsDisabledKey() { + static pthread_key_t k; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + pthread_key_create(&k, NULL); + }); + return k; +} + +BOOL ASMainThreadAssertionsAreDisabled() { + return (pthread_getspecific(ASMainThreadAssertionsDisabledKey()) > 0); +} + +void ASPushMainThreadAssertionsDisabled() { + let key = ASMainThreadAssertionsDisabledKey(); + let oldVal = pthread_getspecific(key); + pthread_setspecific(key, oldVal + 1); +} + +void ASPopMainThreadAssertionsDisabled() { + let key = ASMainThreadAssertionsDisabledKey(); + let oldVal = pthread_getspecific(key); + pthread_setspecific(key, oldVal - 1); + ASDisplayNodeCAssert(oldVal > 0, @"Attempt to pop thread assertion-disabling without corresponding push."); +} + +#endif // AS_TLS_AVAILABLE diff --git a/Source/Base/ASAvailability.h b/Source/Base/ASAvailability.h index c05ddd3fa6..3cb4862f9c 100644 --- a/Source/Base/ASAvailability.h +++ b/Source/Base/ASAvailability.h @@ -19,6 +19,12 @@ #pragma once +#ifdef __i386__ + #define AS_TLS_AVAILABLE 0 +#else + #define AS_TLS_AVAILABLE 1 +#endif + #ifndef kCFCoreFoundationVersionNumber_iOS_10_0 #define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00 #endif diff --git a/Source/Layout/ASLayoutElement.mm b/Source/Layout/ASLayoutElement.mm index 62dd62e66e..bd17461a63 100644 --- a/Source/Layout/ASLayoutElement.mm +++ b/Source/Layout/ASLayoutElement.mm @@ -50,6 +50,8 @@ CGSize const ASLayoutElementParentSizeUndefined = {ASLayoutElementParentDimensio int32_t const ASLayoutElementContextInvalidTransitionID = 0; int32_t const ASLayoutElementContextDefaultTransitionID = ASLayoutElementContextInvalidTransitionID + 1; +#if AS_TLS_AVAILABLE + static _Thread_local __unsafe_unretained ASLayoutElementContext *tls_context; void ASLayoutElementPushContext(ASLayoutElementContext *context) @@ -73,6 +75,42 @@ void ASLayoutElementPopContext() tls_context = nil; } +#else + +static pthread_key_t ASLayoutElementContextKey() { + static pthread_key_t k; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + pthread_key_create(&k, NULL); + }); + return k; +} +void ASLayoutElementPushContext(ASLayoutElementContext *context) +{ + // NOTE: It would be easy to support nested contexts – just use an NSMutableArray here. + ASDisplayNodeCAssertNil(pthread_getspecific(ASLayoutElementContextKey()), @"Nested ASLayoutElementContexts aren't supported."); + + let cfCtx = (__bridge_retained CFTypeRef)context; + pthread_setspecific(ASLayoutElementContextKey(), cfCtx); +} + +ASLayoutElementContext *ASLayoutElementGetCurrentContext() +{ + // Don't retain here. Caller will retain if it wants to! + let ctxPtr = pthread_getspecific(ASLayoutElementContextKey()); + return (__bridge ASLayoutElementContext *)ctxPtr; +} + +void ASLayoutElementPopContext() +{ + let ctx = (CFTypeRef)pthread_getspecific(ASLayoutElementContextKey()); + ASDisplayNodeCAssertNotNil(ctx, @"Attempt to pop context when there wasn't a context!"); + CFRelease(ctx); + pthread_setspecific(ASLayoutElementContextKey(), NULL); +} + +#endif // AS_TLS_AVAILABLE + #pragma mark - ASLayoutElementStyle NSString * const ASLayoutElementStyleWidthProperty = @"ASLayoutElementStyleWidthProperty"; From 8986838b48d69e78a7f923192f0e09dcde09f74a Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 13 Jul 2018 10:19:03 -0700 Subject: [PATCH 21/97] Add move detection and support to ASLayoutTransition (#1006) * Add move detection and support to ASLayoutTransition ...and NSArray+Diffing. Add some tests. * Update CHANGELOG.md * Update CHANGELOG.md * Update ASLayout+IGListKit.h * Update ASLayout+IGListKit.mm * Use std collections to avoid NSNumber boxing * Update ASLayoutTransition.mm * Code review updates. * Use `unordered_multimap` on stack instead of unordered_map on heap * Remove notFound BOOL (use NSNotFound sentinel value) and put some vars inside the if (insertions/moves) loop * Don't copy defaultCompare block (redundant under ARC) * Whitespace * Remove unneeded mutableCopy-s in ArrayDiffingTests * Code review updates. * Type _subnodeMoves pair.first to ASDisplayNode * instead of id * C++ enumeration * unowned refs for adding previousLayout nodes to _subnodeMoves * Remove unreleated ASDynamicCast that is probably right though * Add commentary to NSArray+Diffing.h; make multimap elements unowned * Use std::make_pair, optimize ASLayout+IGListKit * Oops I thought I had added these headers but nope * Simplify simplify * Diff subnodes instead of sublayouts * Another randomized test with actual ASLayouts --- AsyncDisplayKit.xcodeproj/project.pbxproj | 16 +- CHANGELOG.md | 1 + Source/ASDisplayNode+Layout.mm | 2 +- Source/AsyncDisplayKit.h | 1 + Source/Details/NSArray+Diffing.h | 62 +++++++ Source/Details/NSArray+Diffing.m | 113 ------------ Source/Details/NSArray+Diffing.mm | 185 ++++++++++++++++++++ Source/Layout/ASLayout+IGListKit.h | 19 ++ Source/Layout/ASLayout+IGListKit.mm | 34 ++++ Source/Layout/ASLayout.mm | 2 + Source/Private/ASLayoutTransition.h | 5 +- Source/Private/ASLayoutTransition.mm | 79 ++++++--- Tests/ASDisplayNodeImplicitHierarchyTests.m | 6 +- Tests/ASDisplayNodeTests.mm | 100 ++++++++++- Tests/ArrayDiffingTests.m | 180 ++++++++++++++++++- 15 files changed, 654 insertions(+), 151 deletions(-) delete mode 100644 Source/Details/NSArray+Diffing.m create mode 100644 Source/Details/NSArray+Diffing.mm create mode 100644 Source/Layout/ASLayout+IGListKit.h create mode 100644 Source/Layout/ASLayout+IGListKit.mm diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index bb8227f276..4ce8706e62 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ 058D0A40195D057000B7D73C /* ASTextNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 058D0A36195D057000B7D73C /* ASTextNodeTests.m */; }; 058D0A41195D057000B7D73C /* ASTextNodeWordKernerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 058D0A37195D057000B7D73C /* ASTextNodeWordKernerTests.mm */; }; 05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 05EA6FE61AC0966E00E35788 /* ASSnapshotTestCase.m */; }; + 0FAFDF7520EC1C90003A51C0 /* ASLayout+IGListKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FAFDF7320EC1C8F003A51C0 /* ASLayout+IGListKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0FAFDF7620EC1C90003A51C0 /* ASLayout+IGListKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FAFDF7420EC1C90003A51C0 /* ASLayout+IGListKit.mm */; }; 18C2ED7F1B9B7DE800F627B3 /* ASCollectionNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 18C2ED7C1B9B7DE800F627B3 /* ASCollectionNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 18C2ED831B9B7DE800F627B3 /* ASCollectionNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 18C2ED7D1B9B7DE800F627B3 /* ASCollectionNode.mm */; }; 1A6C000D1FAB4E2100D05926 /* ASCornerLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6C000B1FAB4E2000D05926 /* ASCornerLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -108,7 +110,7 @@ 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E1C1B373A2C007741D0 /* ASCollectionViewLayoutController.m */; }; 509E68651B3AEDC5009B9150 /* CoreGraphics+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; }; 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */; }; - 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.m in Sources */ = {isa = PBXBuildFile; fileRef = DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */; }; + 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.mm in Sources */ = {isa = PBXBuildFile; fileRef = DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */; }; 636EA1A51C7FF4EF00EE152F /* ASDefaultPlayButton.m in Sources */ = {isa = PBXBuildFile; fileRef = AEB7B0191C5962EA00662EF4 /* ASDefaultPlayButton.m */; }; 680346941CE4052A0009FEB4 /* ASNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; 68355B341CB579B9001D4E68 /* ASImageNode+AnimatedImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 68355B2E1CB5799E001D4E68 /* ASImageNode+AnimatedImage.mm */; }; @@ -601,6 +603,8 @@ 058D0A44195D058D00B7D73C /* ASBaseDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASBaseDefines.h; sourceTree = ""; }; 05EA6FE61AC0966E00E35788 /* ASSnapshotTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASSnapshotTestCase.m; sourceTree = ""; }; 05F20AA31A15733C00DCA68A /* ASImageProtocols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASImageProtocols.h; sourceTree = ""; }; + 0FAFDF7320EC1C8F003A51C0 /* ASLayout+IGListKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASLayout+IGListKit.h"; sourceTree = ""; }; + 0FAFDF7420EC1C90003A51C0 /* ASLayout+IGListKit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ASLayout+IGListKit.mm"; sourceTree = ""; }; 18C2ED7C1B9B7DE800F627B3 /* ASCollectionNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionNode.h; sourceTree = ""; }; 18C2ED7D1B9B7DE800F627B3 /* ASCollectionNode.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASCollectionNode.mm; sourceTree = ""; }; 1950C4481A3BB5C1005C8279 /* ASEqualityHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASEqualityHelpers.h; sourceTree = ""; }; @@ -964,7 +968,7 @@ DB55C2601C6408D6004EDCF5 /* _ASTransitionContext.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _ASTransitionContext.m; path = ../_ASTransitionContext.m; sourceTree = ""; }; DB55C2651C641AE4004EDCF5 /* ASContextTransitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASContextTransitioning.h; sourceTree = ""; }; DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Diffing.h"; sourceTree = ""; }; - DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Diffing.m"; sourceTree = ""; }; + DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSArray+Diffing.mm"; sourceTree = ""; }; DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ArrayDiffingTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; DBC453211C5FD97200B16017 /* ASDisplayNodeImplicitHierarchyTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASDisplayNodeImplicitHierarchyTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; DBDB83921C6E879900D0098C /* ASPagerFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPagerFlowLayout.h; sourceTree = ""; }; @@ -1416,7 +1420,7 @@ 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */, 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */, DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */, - DBC452DA1C5BF64600B16017 /* NSArray+Diffing.m */, + DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */, CC4981BA1D1C7F65004E13CC /* NSIndexSet+ASHelpers.h */, CC4981BB1D1C7F65004E13CC /* NSIndexSet+ASHelpers.m */, 058D09F5195D050800B7D73C /* NSMutableAttributedString+TextKitAdditions.h */, @@ -1635,6 +1639,8 @@ ACF6ED0A1B17843500DA7C62 /* ASInsetLayoutSpec.mm */, ACF6ED0B1B17843500DA7C62 /* ASLayout.h */, ACF6ED0C1B17843500DA7C62 /* ASLayout.mm */, + 0FAFDF7320EC1C8F003A51C0 /* ASLayout+IGListKit.h */, + 0FAFDF7420EC1C90003A51C0 /* ASLayout+IGListKit.mm */, ACF6ED111B17843500DA7C62 /* ASLayoutElement.h */, E55D86311CA8A14000A0C26F /* ASLayoutElement.mm */, 698C8B601CAB49FC0052DC3F /* ASLayoutElementExtensibility.h */, @@ -1850,6 +1856,7 @@ 69E0E8A71D356C9400627613 /* ASEqualityHelpers.h in Headers */, 698C8B621CAB49FC0052DC3F /* ASLayoutElementExtensibility.h in Headers */, 69F10C871C84C35D0026140C /* ASRangeControllerUpdateRangeProtocol+Beta.h in Headers */, + 0FAFDF7520EC1C90003A51C0 /* ASLayout+IGListKit.h in Headers */, B350623C1B010EFD0018CF92 /* _ASAsyncTransaction.h in Headers */, 68355B411CB57A6C001D4E68 /* ASImageContainerProtocolCategories.h in Headers */, 7630FFA81C9E267E007A7C0E /* ASVideoNode.h in Headers */, @@ -2368,6 +2375,7 @@ E5B078001E69F4EB00C24B5B /* ASElementMap.m in Sources */, 9C8898BC1C738BA800D6B02E /* ASTextKitFontSizeAdjuster.mm in Sources */, 690ED59B1E36D118000627C0 /* ASImageNode+tvOS.m in Sources */, + 0FAFDF7620EC1C90003A51C0 /* ASLayout+IGListKit.mm in Sources */, CCDC9B4E200991D10063C1F8 /* ASGraphicsContext.m in Sources */, CCCCCCD81EC3EF060087FE10 /* ASTextInput.m in Sources */, 34EFC7621B701CA400AD841F /* ASBackgroundLayoutSpec.mm in Sources */, @@ -2402,7 +2410,7 @@ B350624E1B010EFD0018CF92 /* ASDisplayNode+AsyncDisplay.mm in Sources */, E5667E8E1F33872700FA6FC0 /* _ASCollectionGalleryLayoutInfo.m in Sources */, 25E327591C16819500A2170C /* ASPagerNode.m in Sources */, - 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.m in Sources */, + 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.mm in Sources */, B35062501B010EFD0018CF92 /* ASDisplayNode+DebugTiming.mm in Sources */, DEC146B91C37A16A004A0EE7 /* ASCollectionInternal.m in Sources */, 254C6B891BF94F8A003EC431 /* ASTextKitRenderer+Positioning.mm in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e9b667d24..9b76352672 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASLayoutTransition] Add support for preserving order after node moves during transitions. (This order defines the z-order as well.) [Kevin Smith](https://github.com/wiseoldduck) [#1006] - [ASDisplayNode] Adds support for multiple interface state delegates. [Garrett Moon](https://github.com/garrettmoon) [#979](https://github.com/TextureGroup/Texture/pull/979) - [ASDataController] Add capability to renew supplementary views (update map) when size change from zero to non-zero.[Max Wang](https://github.com/wsdwsd0829) [#842](https://github.com/TextureGroup/Texture/pull/842) - Make `ASPerformMainThreadDeallocation` visible in C. [Adlai Holler](https://github.com/Adlai-Holler) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index e77c354ab9..19ed422bf1 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -685,7 +685,7 @@ ASLayoutElementStyleExtensibilityForwarding } // Apply the subnode insertion immediately to be able to animate the nodes - [pendingLayoutTransition applySubnodeInsertions]; + [pendingLayoutTransition applySubnodeInsertionsAndMoves]; // Kick off animating the layout transition { diff --git a/Source/AsyncDisplayKit.h b/Source/AsyncDisplayKit.h index 227b13f21c..d98d003615 100644 --- a/Source/AsyncDisplayKit.h +++ b/Source/AsyncDisplayKit.h @@ -137,3 +137,4 @@ #import #import +#import diff --git a/Source/Details/NSArray+Diffing.h b/Source/Details/NSArray+Diffing.h index 3a1729337f..3fd83806e2 100644 --- a/Source/Details/NSArray+Diffing.h +++ b/Source/Details/NSArray+Diffing.h @@ -17,6 +17,60 @@ #import +/** + * These changes can be used to transform `self` to `array` by applying them in (any) order, *without shifting* the + * other elements. This can be done (in an NSMutableArray) by calling `setObject:atIndexedSubscript:` (or just use + * [subscripting] directly) for insertions from `array` into `self` (not the seemingly more apt `insertObject:atIndex`!), + * and using the same method for deletions from `self` (*set* a `[NSNull null]` as opposed to `removeObject:atIndex:`). + * After all inserts/deletes have been applied, there will be no nulls left (except possibly at the end of the array if + * `[array count] < [self count]`) + + * Some examples: + * in: ab c + * out: abdc + * diff: ..+. + * + * in: abcd + * out: dcba + * dif: ---.+++ + * + * in: abcd + * out: ab d + * diff: ..-. + * + * in: a bcd + * out: adbc + * diff: .+..- + * + * If `moves` pointer is passed in, instances where one element moves to another location are detected and reported, + * possibly replacing pairs of delete/insert. The process for transforming an array remains the same, however now it is + * important to apply the moves in order and not overwrite an element that needs to be moved somewhere else. + * + * the same examples, with moves: + * in: ab c + * out: abdc + * diff: ..+. + * + * in: abcd + * out: dcba + * diff: 321. + * + * in: abcd + * out: ab d + * diff: ..-. + * + * in: abcd + * out: adbc + * diff: .312 + * + * Other notes: + * + * No index will be both moved from and deleted. + * Each index 0...[self count] will be either moved from or deleted. If it is moved to the same location, we omit it. + * Each index 0...[array count] will be the destination of ONE move or ONE insert. + * Knowing these things means any two of the three (delete, move, insert) implies the third. + */ + @interface NSArray (Diffing) /** @@ -35,4 +89,12 @@ */ - (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions compareBlock:(BOOL (^)(id lhs, id rhs))comparison; +/** + * @abstract Compares two arrays, providing the insertion, deletion, and move indexes needed to transform into the target array. + * @discussion This compares the equality of each object with `isEqual:`. + * This diffing algorithm uses a bottom-up memoized longest common subsequence solution to identify differences. + * It runs in O(mn) complexity. + * The moves are returned in ascending order of their destination index. + */ +- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions moves:(NSArray **)moves; @end diff --git a/Source/Details/NSArray+Diffing.m b/Source/Details/NSArray+Diffing.m deleted file mode 100644 index ee0ba0ff3e..0000000000 --- a/Source/Details/NSArray+Diffing.m +++ /dev/null @@ -1,113 +0,0 @@ -// -// NSArray+Diffing.m -// 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 /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 -#import - -@implementation NSArray (Diffing) - -- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions -{ - [self asdk_diffWithArray:array insertions:insertions deletions:deletions compareBlock:^BOOL(id lhs, id rhs) { - return [lhs isEqual:rhs]; - }]; -} - -- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions compareBlock:(BOOL (^)(id lhs, id rhs))comparison -{ - NSAssert(comparison != nil, @"Comparison block is required"); - NSIndexSet *commonIndexes = [self _asdk_commonIndexesWithArray:array compareBlock:comparison]; - - if (insertions) { - NSArray *commonObjects = [self objectsAtIndexes:commonIndexes]; - NSMutableIndexSet *insertionIndexes = [[NSMutableIndexSet alloc] init]; - for (NSInteger i = 0, j = 0; i < commonObjects.count || j < array.count;) { - if (i < commonObjects.count && j < array.count && comparison(commonObjects[i], array[j])) { - i++; j++; - } else { - [insertionIndexes addIndex:j]; - j++; - } - } - *insertions = insertionIndexes; - } - - if (deletions) { - NSMutableIndexSet *deletionIndexes = [[NSMutableIndexSet alloc] init]; - for (NSInteger i = 0; i < self.count; i++) { - if (![commonIndexes containsIndex:i]) { - [deletionIndexes addIndex:i]; - } - } - *deletions = deletionIndexes; - } -} - -- (NSIndexSet *)_asdk_commonIndexesWithArray:(NSArray *)array compareBlock:(BOOL (^)(id lhs, id rhs))comparison -{ - NSAssert(comparison != nil, @"Comparison block is required"); - - NSInteger selfCount = self.count; - NSInteger arrayCount = array.count; - - // Allocate the diff map in the heap so we don't blow the stack for large arrays. - NSInteger **lengths = NULL; - lengths = (NSInteger **)malloc(sizeof(NSInteger*) * (selfCount+1)); - if (lengths == NULL) { - ASDisplayNodeFailAssert(@"Failed to allocate memory for diffing"); - return nil; - } - - for (NSInteger i = 0; i <= selfCount; i++) { - lengths[i] = (NSInteger *)malloc(sizeof(NSInteger) * (arrayCount+1)); - if (lengths[i] == NULL) { - ASDisplayNodeFailAssert(@"Failed to allocate memory for diffing"); - return nil; - } - id selfObj = i > 0 ? self[i-1] : nil; - for (NSInteger j = 0; j <= arrayCount; j++) { - if (i == 0 || j == 0) { - lengths[i][j] = 0; - } else if (comparison(selfObj, array[j-1])) { - lengths[i][j] = 1 + lengths[i-1][j-1]; - } else { - lengths[i][j] = MAX(lengths[i-1][j], lengths[i][j-1]); - } - } - } - - NSMutableIndexSet *common = [[NSMutableIndexSet alloc] init]; - NSInteger i = selfCount, j = arrayCount; - while(i > 0 && j > 0) { - if (comparison(self[i-1], array[j-1])) { - [common addIndex:(i-1)]; - i--; j--; - } else if (lengths[i-1][j] > lengths[i][j-1]) { - i--; - } else { - j--; - } - } - - for (NSInteger i = 0; i <= selfCount; i++) { - free(lengths[i]); - } - free(lengths); - return common; -} - -@end diff --git a/Source/Details/NSArray+Diffing.mm b/Source/Details/NSArray+Diffing.mm new file mode 100644 index 0000000000..64063ff71b --- /dev/null +++ b/Source/Details/NSArray+Diffing.mm @@ -0,0 +1,185 @@ +// +// NSArray+Diffing.m +// 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 /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 +#import +#import +#import + +@implementation NSArray (Diffing) + +typedef BOOL (^compareBlock)(id _Nonnull lhs, id _Nonnull rhs); + +- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions +{ + [self asdk_diffWithArray:array insertions:insertions deletions:deletions moves:nil compareBlock:[NSArray defaultCompareBlock]]; +} + +- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions + compareBlock:(compareBlock)comparison +{ + [self asdk_diffWithArray:array insertions:insertions deletions:deletions moves:nil compareBlock:comparison]; +} + +- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions + moves:(NSArray **)moves +{ + [self asdk_diffWithArray:array insertions:insertions deletions:deletions moves:moves + compareBlock:[NSArray defaultCompareBlock]]; +} + +- (void)asdk_diffWithArray:(NSArray *)array insertions:(NSIndexSet **)insertions deletions:(NSIndexSet **)deletions + moves:(NSArray **)moves compareBlock:(compareBlock)comparison +{ + struct NSObjectHash + { + std::size_t operator()(id k) const { return (std::size_t) [k hash]; }; + }; + struct NSObjectCompare + { + bool operator()(id lhs, id rhs) const { return (bool) [lhs isEqual:rhs]; }; + }; + std::unordered_multimap potentialMoves; + + NSAssert(comparison != nil, @"Comparison block is required"); + NSAssert(moves == nil || comparison == [NSArray defaultCompareBlock], @"move detection requires isEqual: and hash (no custom compare)"); + NSMutableArray *moveIndexPaths = nil; + NSMutableIndexSet *insertionIndexes = nil, *deletionIndexes = nil; + if (moves) { + moveIndexPaths = [NSMutableArray new]; + } + NSMutableIndexSet *commonIndexes = [self _asdk_commonIndexesWithArray:array compareBlock:comparison]; + + if (deletions || moves) { + deletionIndexes = [NSMutableIndexSet indexSet]; + NSUInteger i = 0; + for (id element in self) { + if (![commonIndexes containsIndex:i]) { + [deletionIndexes addIndex:i]; + } + if (moves) { + potentialMoves.insert(std::pair(element, i)); + } + ++i; + } + } + + if (insertions || moves) { + insertionIndexes = [NSMutableIndexSet indexSet]; + NSArray *commonObjects = [self objectsAtIndexes:commonIndexes]; + for (NSUInteger i = 0, j = 0; j < array.count; j++) { + auto moveFound = potentialMoves.find(array[j]); + NSUInteger movedFrom = NSNotFound; + if (moveFound != potentialMoves.end() && moveFound->second != j) { + movedFrom = moveFound->second; + potentialMoves.erase(moveFound); + [moveIndexPaths addObject:[NSIndexPath indexPathForItem:j inSection:movedFrom]]; + } + if (i < commonObjects.count && j < array.count && comparison(commonObjects[i], array[j])) { + i++; + } else { + if (movedFrom != NSNotFound) { + // moves will coalesce a delete / insert - the insert is just not done, and here we remove the delete: + [deletionIndexes removeIndex:movedFrom]; + // OR a move will have come from the LCS: + if ([commonIndexes containsIndex:movedFrom]) { + [commonIndexes removeIndex:movedFrom]; + commonObjects = [self objectsAtIndexes:commonIndexes]; + } + } else { + [insertionIndexes addIndex:j]; + } + } + } + } + + if (moves) {*moves = moveIndexPaths;} + if (deletions) {*deletions = deletionIndexes;} + if (insertions) {*insertions = insertionIndexes;} +} + +// https://github.com/raywenderlich/swift-algorithm-club/tree/master/Longest%20Common%20Subsequence is not exactly this code (obviously), but +// is a good commentary on the algorithm. +- (NSMutableIndexSet *)_asdk_commonIndexesWithArray:(NSArray *)array compareBlock:(BOOL (^)(id lhs, id rhs))comparison +{ + NSAssert(comparison != nil, @"Comparison block is required"); + + NSInteger selfCount = self.count; + NSInteger arrayCount = array.count; + + // Allocate the diff map in the heap so we don't blow the stack for large arrays. + NSInteger **lengths = NULL; + lengths = (NSInteger **)malloc(sizeof(NSInteger*) * (selfCount+1)); + if (lengths == NULL) { + ASDisplayNodeFailAssert(@"Failed to allocate memory for diffing"); + return nil; + } + // Fill in a LCS length matrix: + for (NSInteger i = 0; i <= selfCount; i++) { + lengths[i] = (NSInteger *)malloc(sizeof(NSInteger) * (arrayCount+1)); + if (lengths[i] == NULL) { + ASDisplayNodeFailAssert(@"Failed to allocate memory for diffing"); + return nil; + } + id selfObj = i > 0 ? self[i-1] : nil; + for (NSInteger j = 0; j <= arrayCount; j++) { + if (i == 0 || j == 0) { + lengths[i][j] = 0; + } else if (comparison(selfObj, array[j-1])) { + lengths[i][j] = 1 + lengths[i-1][j-1]; + } else { + lengths[i][j] = MAX(lengths[i-1][j], lengths[i][j-1]); + } + } + } + // Backtrack to fill in indices based on length matrix: + NSMutableIndexSet *common = [NSMutableIndexSet indexSet]; + NSInteger i = selfCount, j = arrayCount; + while(i > 0 && j > 0) { + if (comparison(self[i-1], array[j-1])) { + [common addIndex:(i-1)]; + i--; j--; + } else if (lengths[i-1][j] > lengths[i][j-1]) { + i--; + } else { + j--; + } + } + + for (NSInteger i = 0; i <= selfCount; i++) { + free(lengths[i]); + } + free(lengths); + return common; +} + +static compareBlock defaultCompare = nil; + ++ (compareBlock)defaultCompareBlock +{ + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + defaultCompare = ^BOOL(id lhs, id rhs) { + return [lhs isEqual:rhs]; + }; + }); + + return defaultCompare; +} + +@end diff --git a/Source/Layout/ASLayout+IGListKit.h b/Source/Layout/ASLayout+IGListKit.h new file mode 100644 index 0000000000..65c45a0298 --- /dev/null +++ b/Source/Layout/ASLayout+IGListKit.h @@ -0,0 +1,19 @@ +// +// ASLayout+IGListKit.mm +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 +// + +#if AS_IG_LIST_KIT +#import +#import +@interface ASLayout(IGListKit) +@end + +#endif // AS_IG_LIST_KIT diff --git a/Source/Layout/ASLayout+IGListKit.mm b/Source/Layout/ASLayout+IGListKit.mm new file mode 100644 index 0000000000..438689153e --- /dev/null +++ b/Source/Layout/ASLayout+IGListKit.mm @@ -0,0 +1,34 @@ +// +// ASLayout+IGListKit.mm +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 +#if AS_IG_LIST_KIT +#import "ASLayout+IGListKit.h" + +@interface ASLayout() { +@public + id _layoutElement; +} +@end + +@implementation ASLayout(IGListKit) + +- (id )diffIdentifier +{ + return self->_layoutElement; +} + +- (BOOL)isEqualToDiffableObject:(id )other +{ + return [self isEqual:other]; +} +@end +#endif // AS_IG_LIST_KIT diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 7766295692..4245159fbd 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -283,6 +283,8 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( - (BOOL)isEqual:(id)object { + if (self == object) return YES; + ASLayout *layout = ASDynamicCast(object, ASLayout); if (layout == nil) { return NO; diff --git a/Source/Private/ASLayoutTransition.h b/Source/Private/ASLayoutTransition.h index a34dd2e72a..1060a57d81 100644 --- a/Source/Private/ASLayoutTransition.h +++ b/Source/Private/ASLayoutTransition.h @@ -85,9 +85,10 @@ AS_SUBCLASSING_RESTRICTED - (void)commitTransition; /** - * Insert all new subnodes that were added between the previous layout and the pending layout + * Insert all new subnodes that were added and move the subnodes that moved between the previous layout and + * the pending layout. */ -- (void)applySubnodeInsertions; +- (void)applySubnodeInsertionsAndMoves; /** * Remove all subnodes that are removed between the previous layout and the pending layout diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index f1b15dd02a..77a8fdd7c1 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -25,10 +25,11 @@ #import #import -#import -#import -#import +#if AS_IG_LIST_KIT +#import +#import +#endif /** * Search the whole layout stack if at least one layout has a layoutElement object that can not be layed out asynchronous. @@ -66,7 +67,7 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { NSArray *_insertedSubnodes; NSArray *_removedSubnodes; std::vector _insertedSubnodePositions; - std::vector _removedSubnodePositions; + std::vector> _subnodeMoves; } - (instancetype)initWithNode:(ASDisplayNode *)node @@ -98,27 +99,44 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { - (void)commitTransition { - [self applySubnodeInsertions]; [self applySubnodeRemovals]; + [self applySubnodeInsertionsAndMoves]; } -- (void)applySubnodeInsertions +- (void)applySubnodeInsertionsAndMoves { ASDN::MutexSharedLocker l(__instanceLock__); [self calculateSubnodeOperationsIfNeeded]; // Create an activity even if no subnodes affected. - as_activity_create_for_scope("Apply subnode insertions"); - if (_insertedSubnodes.count == 0) { + as_activity_create_for_scope("Apply subnode insertions and moves"); + if (_insertedSubnodePositions.size() == 0 && _subnodeMoves.size() == 0) { return; } ASDisplayNodeLogEvent(_node, @"insertSubnodes: %@", _insertedSubnodes); NSUInteger i = 0; - for (ASDisplayNode *node in _insertedSubnodes) { + NSUInteger j = 0; + for (auto const &move : _subnodeMoves) { + [move.first _removeFromSupernodeIfEqualTo:_node]; + } + j = 0; + while (i < _insertedSubnodePositions.size() && j < _subnodeMoves.size()) { NSUInteger p = _insertedSubnodePositions[i]; - [_node _insertSubnode:node atIndex:p]; - i += 1; + NSUInteger q = _subnodeMoves[j].second; + if (p < q) { + [_node _insertSubnode:_insertedSubnodes[i] atIndex:p]; + i++; + } else { + [_node _insertSubnode:_subnodeMoves[j].first atIndex:q]; + j++; + } + } + for (; i < _insertedSubnodePositions.size(); ++i) { + [_node _insertSubnode:_insertedSubnodes[i] atIndex:_insertedSubnodePositions[i]]; + } + for (; j < _subnodeMoves.size(); ++j) { + [_node _insertSubnode:_subnodeMoves[j].first atIndex:_subnodeMoves[j].second]; } } @@ -156,23 +174,42 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { ASLayout *pendingLayout = _pendingLayout->layout; if (previousLayout) { +#if AS_IG_LIST_KIT + // IGListDiff completes in linear time O(m+n), so use it if we have it: + IGListIndexSetResult *result = IGListDiff(previousLayout.sublayouts, pendingLayout.sublayouts, IGListDiffEquality); + _insertedSubnodePositions = findNodesInLayoutAtIndexes(pendingLayout, result.inserts, &_insertedSubnodes); + findNodesInLayoutAtIndexes(previousLayout, result.deletes, &_removedSubnodes); + for (IGListMoveIndex *move in result.moves) { + _subnodeMoves.push_back(std::make_pair(previousLayout.sublayouts[move.from].layoutElement, move.to)); + } + + // Sort by ascending order of move destinations, this will allow easy loop of `insertSubnode:AtIndex` later. + std::sort(_subnodeMoves.begin(), _subnodeMoves.end(), [](std::pair, NSUInteger> a, + std::pair b) { + return a.second < b.second; + }); +#else NSIndexSet *insertions, *deletions; - [previousLayout.sublayouts asdk_diffWithArray:pendingLayout.sublayouts + NSArray *moves; + NSArray *previousNodes = [previousLayout.sublayouts valueForKey:@"layoutElement"]; + NSArray *pendingNodes = [pendingLayout.sublayouts valueForKey:@"layoutElement"]; + [previousNodes asdk_diffWithArray:pendingNodes insertions:&insertions deletions:&deletions - compareBlock:^BOOL(ASLayout *lhs, ASLayout *rhs) { - return ASObjectIsEqual(lhs.layoutElement, rhs.layoutElement); - }]; + moves:&moves]; + _insertedSubnodePositions = findNodesInLayoutAtIndexes(pendingLayout, insertions, &_insertedSubnodes); - _removedSubnodePositions = findNodesInLayoutAtIndexesWithFilteredNodes(previousLayout, - deletions, - _insertedSubnodes, - &_removedSubnodes); + _removedSubnodes = [previousNodes objectsAtIndexes:deletions]; + // These should arrive sorted in ascending order of move destinations. + for (NSIndexPath *move in moves) { + _subnodeMoves.push_back(std::make_pair(previousLayout.sublayouts[([move indexAtPosition:0])].layoutElement, + [move indexAtPosition:1])); + } +#endif } else { NSIndexSet *indexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [pendingLayout.sublayouts count])]; _insertedSubnodePositions = findNodesInLayoutAtIndexes(pendingLayout, indexes, &_insertedSubnodes); _removedSubnodes = nil; - _removedSubnodePositions.clear(); } _calculatedSubnodeOperations = YES; } @@ -254,7 +291,7 @@ static inline std::vector findNodesInLayoutAtIndexesWithFilteredNode for (ASLayout *sublayout in layout.sublayouts) { if (idx > lastIndex) { break; } if (idx >= firstIndex && [indexes containsIndex:idx]) { - ASDisplayNode *node = (ASDisplayNode *)sublayout.layoutElement; + ASDisplayNode *node = (ASDisplayNode *) sublayout.layoutElement; ASDisplayNodeCAssert(node, @"ASDisplayNode was deallocated before it was added to a subnode. It's likely the case that you use automatically manages subnodes and allocate a ASDisplayNode in layoutSpecThatFits: and don't have any strong reference to it."); // Ignore the odd case in which a non-node sublayout is accessed and the type cast fails if (node != nil) { diff --git a/Tests/ASDisplayNodeImplicitHierarchyTests.m b/Tests/ASDisplayNodeImplicitHierarchyTests.m index 383d5cfd9a..5d305ceb87 100644 --- a/Tests/ASDisplayNodeImplicitHierarchyTests.m +++ b/Tests/ASDisplayNodeImplicitHierarchyTests.m @@ -150,7 +150,11 @@ ASDisplayNode *node1 = [[ASDisplayNode alloc] init]; ASDisplayNode *node2 = [[ASDisplayNode alloc] init]; ASDisplayNode *node3 = [[ASDisplayNode alloc] init]; - + + node1.debugName = @"a"; + node2.debugName = @"b"; + node3.debugName = @"c"; + // As we will involve a stack spec we have to give the nodes an intrinsic content size node1.style.preferredSize = kSize; node2.style.preferredSize = kSize; diff --git a/Tests/ASDisplayNodeTests.mm b/Tests/ASDisplayNodeTests.mm index a75f16f21d..ba7ee7b53e 100644 --- a/Tests/ASDisplayNodeTests.mm +++ b/Tests/ASDisplayNodeTests.mm @@ -2415,6 +2415,77 @@ static bool stringContainsPointer(NSString *description, id p) { XCTAssertThrowsSpecificNamed([node calculateLayoutThatFits:ASSizeRangeMake(CGSizeMake(100, 100))], NSException, NSInternalInconsistencyException); } +- (void)testThatStackSpecOrdersSubnodesCorrectlyRandomness +{ + // This test ensures that the z-order of nodes matches the stack spec, including after several random relayouts / transitions. + ASDisplayNode *node = [[ASDisplayNode alloc] init]; + node.automaticallyManagesSubnodes = YES; + + DeclareNodeNamed(a); + DeclareNodeNamed(b); + DeclareNodeNamed(c); + DeclareNodeNamed(d); + DeclareNodeNamed(e); + DeclareNodeNamed(f); + DeclareNodeNamed(g); + DeclareNodeNamed(h); + DeclareNodeNamed(i); + DeclareNodeNamed(j); + + NSMutableArray *allNodes = [@[a, b, c, d, e, f, g, h, i, j] mutableCopy]; + NSArray *testPrevious = @[]; + NSArray __block *testPending = @[]; + + int len1 = 1 + arc4random_uniform(9); + for (NSUInteger n = 0; n < len1; n++) { // shuffle and add + [allNodes exchangeObjectAtIndex:n withObjectAtIndex:n + arc4random_uniform(10 - (uint32_t) n)]; + testPrevious = [testPrevious arrayByAddingObject:allNodes[n]]; + } + + __block NSUInteger testCount = 0; + node.layoutSpecBlock = ^(ASDisplayNode *node, ASSizeRange size) { + ASStackLayoutSpec *stack = [ASStackLayoutSpec verticalStackLayoutSpec]; + + if (testCount++ == 0) { + stack.children = testPrevious; + } + else { + testPending = @[]; + int len2 = 1 + arc4random_uniform(9); + for (NSUInteger n = 0; n < len2; n++) { // shuffle and add + [allNodes exchangeObjectAtIndex:n withObjectAtIndex:n + arc4random_uniform(10 - (uint32_t) n)]; + testPending = [testPending arrayByAddingObject:allNodes[n]]; + } + stack.children = testPending; + } + + return stack; + }; + + ASDisplayNodeSizeToFitSize(node, CGSizeMake(100, 100)); + [node.view layoutIfNeeded]; + + // Because automaticallyManagesSubnodes is used, the subnodes array is constructed from the layout spec's children. + NSString *expected = [[testPrevious valueForKey:@"debugName"] componentsJoinedByString:@","]; + XCTAssert([node.subnodes isEqualToArray:testPrevious], @"subnodes: %@, array: %@", node.subnodes, testPrevious); + XCTAssertNodeSubnodeSubviewSublayerOrder(node, YES /* isLoaded */, NO /* isLayerBacked */, + expected, @"Initial order"); + + for (NSUInteger n = 0; n < 25; n++) { + [node invalidateCalculatedLayout]; + [node.view setNeedsLayout]; + [node.view layoutIfNeeded]; + + + XCTAssert([node.subnodes isEqualToArray:testPending], @"subnodes: %@, array: %@", node.subnodes, testPending); + expected = [[testPending valueForKey:@"debugName"] componentsJoinedByString:@","]; + + XCTAssertEqualObjects(orderStringFromSubnodes(node), expected, @"Incorrect node order for Random order #%ld", (unsigned long) n); + XCTAssertEqualObjects(orderStringFromSubviews(node.view), expected, @"Incorrect subviews for Random order #%ld", (unsigned long) n); + XCTAssertEqualObjects(orderStringFromSublayers(node.layer), expected, @"Incorrect sublayers for Random order #%ld", (unsigned long) n); + } +} + - (void)testThatStackSpecOrdersSubnodesCorrectly { // This test ensures that the z-order of nodes matches the stack spec, including after relayout / transition. @@ -2425,14 +2496,26 @@ static bool stringContainsPointer(NSString *description, id p) { DeclareNodeNamed(b); DeclareNodeNamed(c); DeclareNodeNamed(d); + DeclareNodeNamed(e); NSArray *nodesForwardOrder = @[a, b, c, d]; NSArray *nodesReverseOrder = @[d, c, b, a]; + NSArray *addAndMoveOrder = @[a, b, e, d, c]; __block BOOL flipItemOrder = NO; + __block NSUInteger testCount = 0; node.layoutSpecBlock = ^(ASDisplayNode *node, ASSizeRange size) { ASStackLayoutSpec *stack = [ASStackLayoutSpec verticalStackLayoutSpec]; - stack.children = flipItemOrder ? nodesReverseOrder : nodesForwardOrder; + switch(testCount) { + case 0: + stack.children = nodesForwardOrder; break; + case 1: + stack.children = nodesReverseOrder; break; + case 2: + default: + stack.children = addAndMoveOrder; break; + } + testCount++; return stack; }; @@ -2446,13 +2529,22 @@ static bool stringContainsPointer(NSString *description, id p) { flipItemOrder = YES; [node invalidateCalculatedLayout]; + [node.view setNeedsLayout]; [node.view layoutIfNeeded]; // In this case, it's critical that the items are in the new order so that event handling and apparent z-position are correct. // FIXME: The reversal case is not currently passing. - // XCTAssert([node.subnodes isEqualToArray:nodesReverseOrder], @"subnodes: %@, array: %@", node.subnodes, nodesReverseOrder); - // XCTAssertNodeSubnodeSubviewSublayerOrder(node, YES /* isLoaded */, NO /* isLayerBacked */, - // @"d,c,b,a", @"Reverse order"); + XCTAssert([node.subnodes isEqualToArray:nodesReverseOrder], @"subnodes: %@, array: %@", node.subnodes, nodesReverseOrder); + XCTAssertNodeSubnodeSubviewSublayerOrder(node, YES /* isLoaded */, NO /* isLayerBacked */, + @"d,c,b,a", @"Reverse order"); + + [node invalidateCalculatedLayout]; + [node.view setNeedsLayout]; + [node.view layoutIfNeeded]; + XCTAssert([node.subnodes isEqualToArray:addAndMoveOrder], @"subnodes: %@, array: %@", node.subnodes, addAndMoveOrder); + XCTAssertNodeSubnodeSubviewSublayerOrder(node, YES /* isLoaded */, NO /* isLayerBacked */, + @"a,b,e,d,c", @"AddAndMove order"); + } - (void)testThatOverlaySpecOrdersSubnodesCorrectly diff --git a/Tests/ArrayDiffingTests.m b/Tests/ArrayDiffingTests.m index 5d25bfde7e..b9af5681aa 100644 --- a/Tests/ArrayDiffingTests.m +++ b/Tests/ArrayDiffingTests.m @@ -127,7 +127,8 @@ @[@0, @1, @2], ], ]; - + + long n = 0; for (NSArray *test in tests) { NSIndexSet *insertions, *deletions; [test[0] asdk_diffWithArray:test[1] insertions:&insertions deletions:&deletions]; @@ -135,17 +136,186 @@ NSMutableIndexSet *mutableDeletions = [deletions mutableCopy]; for (NSNumber *index in (NSArray *)test[2]) { - XCTAssert([mutableInsertions containsIndex:[index integerValue]]); + XCTAssert([mutableInsertions containsIndex:[index integerValue]], @"Test #%ld: insertions %@ does not contain %@", + n, insertions, index); [mutableInsertions removeIndex:[index integerValue]]; } for (NSNumber *index in (NSArray *)test[3]) { - XCTAssert([mutableDeletions containsIndex:[index integerValue]]); + XCTAssert([mutableDeletions containsIndex:[index integerValue]], @"Test #%ld: deletions %@ does not contain %@", + n, deletions, index + ); [mutableDeletions removeIndex:[index integerValue]]; } - XCTAssert([mutableInsertions count] == 0, @"Unaccounted insertions: %@", mutableInsertions); - XCTAssert([mutableDeletions count] == 0, @"Unaccounted deletions: %@", mutableDeletions); + XCTAssert([mutableInsertions count] == 0, @"Test #%ld: Unaccounted insertions: %@", n, mutableInsertions); + XCTAssert([mutableDeletions count] == 0, @"Test #%ld: Unaccounted deletions: %@", n, mutableDeletions); + n++; } } +- (void)testDiffingInsertsDeletesAndMoves +{ + NSArray *tests = @[ + @[ + @[@"a", @"b"], + @[@"b", @"a"], + @[], + @[], + @[[NSIndexPath indexPathWithIndexes:(NSUInteger[]) {1, 0} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]) {0, 1} length:2] + ]], + @[ + @[@"bob", @"alice", @"dave"], + @[@"bob", @"alice", @"dave", @"gary"], + @[@3], + @[], + @[]], + @[ + @[@"a", @"b", @"c", @"d"], + @[@"d", @"c", @"b", @"a"], + @[], + @[], + @[[NSIndexPath indexPathWithIndexes:(NSUInteger[]){3, 0} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){2, 1} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){1, 2} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){0, 3} length:2] + ]], + @[ + @[@"bob", @"alice", @"dave"], + @[@"bob", @"gary", @"dave", @"alice"], + @[@1], + @[], + @[[NSIndexPath indexPathWithIndexes:(NSUInteger[]) {1, 3} length:2] + ]], + @[ + @[@"bob", @"alice", @"dave"], + @[@"bob", @"alice"], + @[], + @[@2], + @[]], + @[ + @[@"bob", @"alice", @"dave"], + @[], + @[], + @[@0, @1, @2], + @[]], + @[ + @[@"bob", @"alice", @"dave"], + @[@"gary", @"alice", @"dave", @"jack"], + @[@0, @3], + @[@0], + @[]], + @[ + @[@"bob", @"alice", @"dave", @"judy", @"lynda", @"tony"], + @[@"gary", @"bob", @"suzy", @"tony"], + @[@0, @2], + @[@1, @2, @3, @4], + @[[NSIndexPath indexPathWithIndexes:(NSUInteger[]){0, 1} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){5, 3} length:2] + ]], + @[ + @[@"bob", @"alice", @"dave", @"judy"], + @[@"judy", @"dave", @"alice", @"bob"], + @[], + @[], + @[[NSIndexPath indexPathWithIndexes:(NSUInteger[]){3, 0} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){2, 1} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){1, 2} length:2], + [NSIndexPath indexPathWithIndexes:(NSUInteger[]){0, 3} length:2] + ]] + + ]; + + long n = 0; + for (NSArray *test in tests) { + NSIndexSet *insertions, *deletions; + NSArray *moves; + [test[0] asdk_diffWithArray:test[1] insertions:&insertions deletions:&deletions moves:&moves]; + NSMutableIndexSet *mutableInsertions = [insertions mutableCopy]; + NSMutableIndexSet *mutableDeletions = [deletions mutableCopy]; + + for (NSNumber *index in (NSArray *) test[2]) { + XCTAssert([mutableInsertions containsIndex:[index integerValue]], @"Test #%ld, insertions does not contain %ld", + n, (long)[index integerValue]); + [mutableInsertions removeIndex:(NSUInteger) [index integerValue]]; + } + for (NSNumber *index in (NSArray *) test[3]) { + XCTAssert([mutableDeletions containsIndex:[index integerValue]], @"Test #%ld, deletions does not contain %ld", + n, (long)[index integerValue]); + [mutableDeletions removeIndex:(NSUInteger) [index integerValue]]; + } + + XCTAssert([mutableInsertions count] == 0, @"Test #%ld, Unaccounted insertions: %@", n, mutableInsertions); + XCTAssert([mutableDeletions count] == 0, @"Test #%ld, Unaccounted deletions: %@", n, mutableDeletions); + + XCTAssert([moves isEqual:test[4]], @"Test #%ld, %@ !isEqual: %@", n, moves, test[4]); + n++; + } +} + +- (void)testArrayDiffingRebuildingWithRandomElements +{ + NSArray *original = @[]; + NSArray *pending = @[]; + + NSIndexSet *insertions = nil; + NSIndexSet *deletions = nil; + NSArray *moves; + + for (int testNumber = 0; testNumber <= 25; testNumber++) { + int len = arc4random_uniform(10); + for (int j = 0; j < len; j++) { + original = [original arrayByAddingObject:@(arc4random_uniform(25))]; + } + len = arc4random_uniform(10); + for (int j = 0; j < len; j++) { + pending = [pending arrayByAddingObject:@(arc4random_uniform(25))]; + } + // Some sequences that presented issues in the past: + if (testNumber == 0) { + original = @[@20, @11, @14, @2, @14, @5, @4, @18, @0]; + pending = @[@9, @18, @18, @19, @20, @18, @22, @10, @3]; + } + if (testNumber == 1) { + original = @[@5, @9, @21, @11, @5, @9, @8]; + pending = @[@2, @12, @17, @19, @9, @1, @8, @5, @21]; + } + if (testNumber == 2) { + original = @[@14, @14, @12, @8, @20, @4, @0, @10]; + pending = @[@14]; + } + + [original asdk_diffWithArray:pending insertions:&insertions deletions:&deletions moves:&moves]; + + NSMutableArray *deletionsList = [NSMutableArray new]; + [deletions enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + [deletionsList addObject:@(idx)]; + }]; + NSMutableArray *insertionsList = [NSMutableArray new]; + [insertions enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) { + [insertionsList addObject:@(idx)]; + }]; + + NSUInteger i = 0; + NSUInteger j = 0; + NSMutableArray *test = [NSMutableArray new]; + for (NSUInteger count = 0; count < [pending count]; count++) { + if (i < [insertionsList count] && [insertionsList[i] unsignedIntegerValue] == count) { + [test addObject:pending[[insertionsList[i] unsignedIntegerValue]]]; + i++; + } else if (j < [moves count] && [moves[j] indexAtPosition:1] == count) { + [test addObject:original[[moves[j] indexAtPosition:0]]]; + j++; + } else { + [test addObject:original[count]]; + } + } + + XCTAssert([test isEqualToArray:pending], @"Did not mutate to expected new array:\n [%@] -> [%@], actual: [%@]\ninsertions: %@\nmoves: %@\ndeletions: %@", + [original componentsJoinedByString:@","], [pending componentsJoinedByString:@","], [test componentsJoinedByString:@","], + insertions, moves, deletions); + original = @[]; + pending = @[]; + } +} @end From af7f71f92dc0c264d73cb31db97173f92c1d396c Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 13 Jul 2018 11:56:54 -0700 Subject: [PATCH 22/97] Address warnings in Xcode >= 9.3 about using %zd for NSInteger (#1026) --- Source/ASConfiguration.m | 9 +++------ Source/ASDisplayNode.mm | 4 ++-- Source/Details/ASElementMap.m | 4 ++-- Source/Details/ASIntegerMap.mm | 2 +- Source/Private/ASTwoDimensionalArrayUtils.m | 4 ++-- .../TextExperiment/Component/ASTextLine.m | 2 +- Source/Private/_ASCoreAnimationExtras.mm | 2 +- Source/Private/_ASHierarchyChangeSet.mm | 16 ++++++++-------- 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Source/ASConfiguration.m b/Source/ASConfiguration.m index 1c1dbec012..6918c47aa5 100644 --- a/Source/ASConfiguration.m +++ b/Source/ASConfiguration.m @@ -15,19 +15,16 @@ /// Not too performance-sensitive here. -/// Get this from C++, without the extra exception handling. -#define autotype __auto_type - @implementation ASConfiguration - (instancetype)initWithDictionary:(NSDictionary *)dictionary { if (self = [super init]) { if (dictionary != nil) { - autotype featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray); - autotype version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue; + let featureStrings = ASDynamicCast(dictionary[@"experimental_features"], NSArray); + let version = ASDynamicCast(dictionary[@"version"], NSNumber).integerValue; if (version != ASConfigurationSchemaCurrentVersion) { - NSLog(@"Texture warning: configuration schema is old version (%zd vs %zd)", version, ASConfigurationSchemaCurrentVersion); + NSLog(@"Texture warning: configuration schema is old version (%ld vs %ld)", (long)version, (long)ASConfigurationSchemaCurrentVersion); } self.experimentalFeatures = ASExperimentalFeaturesFromArray(featureStrings); } else { diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 7650399372..4efd133758 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2225,7 +2225,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { NSUInteger subnodesCount = _subnodes.count; __instanceLock__.unlock(); if (subnodeIndex > subnodesCount || subnodeIndex < 0) { - ASDisplayNodeFailAssert(@"Cannot insert a subnode at index %zd. Count is %zd", subnodeIndex, subnodesCount); + ASDisplayNodeFailAssert(@"Cannot insert a subnode at index %ld. Count is %ld", (long)subnodeIndex, (long)subnodesCount); return; } @@ -2540,7 +2540,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { ASDN::MutexLocker l(__instanceLock__); if (idx > _subnodes.count || idx < 0) { - ASDisplayNodeFailAssert(@"Cannot insert a subnode at index %zd. Count is %zd", idx, _subnodes.count); + ASDisplayNodeFailAssert(@"Cannot insert a subnode at index %ld. Count is %ld", (long)idx, (long)_subnodes.count); return; } diff --git a/Source/Details/ASElementMap.m b/Source/Details/ASElementMap.m index dd451a872a..f27ba1b574 100644 --- a/Source/Details/ASElementMap.m +++ b/Source/Details/ASElementMap.m @@ -244,7 +244,7 @@ NSInteger sectionCount = _sectionsOfItems.count; if (section >= sectionCount || section < 0) { if (assert) { - ASDisplayNodeFailAssert(@"Invalid section index %zd when there are only %zd sections!", section, sectionCount); + ASDisplayNodeFailAssert(@"Invalid section index %ld when there are only %ld sections!", (long)section, (long)sectionCount); } return NO; } else { @@ -272,7 +272,7 @@ NSInteger item = indexPath.item; if (item >= itemCount || item < 0) { if (assert) { - ASDisplayNodeFailAssert(@"Invalid item index %zd in section %zd which only has %zd items!", item, section, itemCount); + ASDisplayNodeFailAssert(@"Invalid item index %ld in section %ld which only has %ld items!", (long)item, (long)section, (long)itemCount); } return NO; } diff --git a/Source/Details/ASIntegerMap.mm b/Source/Details/ASIntegerMap.mm index 4577218dc9..6d542b2081 100644 --- a/Source/Details/ASIntegerMap.mm +++ b/Source/Details/ASIntegerMap.mm @@ -157,7 +157,7 @@ // { 1->2 3->4 5->6 } NSMutableString *str = [NSMutableString string]; for (let &e : _map) { - [str appendFormat:@" %zd->%zd", e.first, e.second]; + [str appendFormat:@" %ld->%ld", (long)e.first, (long)e.second]; } // Remove leading space if (str.length > 0) { diff --git a/Source/Private/ASTwoDimensionalArrayUtils.m b/Source/Private/ASTwoDimensionalArrayUtils.m index d1ce81360e..7b7b80431a 100644 --- a/Source/Private/ASTwoDimensionalArrayUtils.m +++ b/Source/Private/ASTwoDimensionalArrayUtils.m @@ -55,14 +55,14 @@ void ASDeleteElementsInTwoDimensionalArrayAtIndexPaths(NSMutableArray *mutableAr for (NSIndexPath *indexPath in indexPaths) { NSInteger section = indexPath.section; if (section >= mutableArray.count) { - ASDisplayNodeCFailAssert(@"Invalid section index %zd – only %zd sections", section, mutableArray.count); + ASDisplayNodeCFailAssert(@"Invalid section index %ld – only %ld sections", (long)section, (long)mutableArray.count); continue; } NSMutableArray *subarray = mutableArray[section]; NSInteger item = indexPath.item; if (item >= subarray.count) { - ASDisplayNodeCFailAssert(@"Invalid item index %zd – only %zd items in section %zd", item, subarray.count, section); + ASDisplayNodeCFailAssert(@"Invalid item index %ld – only %ld items in section %ld", (long)item, (long)subarray.count, (long)section); continue; } [subarray removeObjectAtIndex:item]; diff --git a/Source/Private/TextExperiment/Component/ASTextLine.m b/Source/Private/TextExperiment/Component/ASTextLine.m index a0b8a173d0..e1adec8fe8 100755 --- a/Source/Private/TextExperiment/Component/ASTextLine.m +++ b/Source/Private/TextExperiment/Component/ASTextLine.m @@ -153,7 +153,7 @@ - (NSString *)description { NSMutableString *desc = @"".mutableCopy; NSRange range = self.range; - [desc appendFormat:@" row:%zd range:%tu,%tu",self, self.row, range.location, range.length]; + [desc appendFormat:@" row:%ld range:%tu,%tu", self, (long)self.row, range.location, range.length]; [desc appendFormat:@" position:%@",NSStringFromCGPoint(self.position)]; [desc appendFormat:@" bounds:%@",NSStringFromCGRect(self.bounds)]; return desc; diff --git a/Source/Private/_ASCoreAnimationExtras.mm b/Source/Private/_ASCoreAnimationExtras.mm index bdf51a768c..e31d386692 100644 --- a/Source/Private/_ASCoreAnimationExtras.mm +++ b/Source/Private/_ASCoreAnimationExtras.mm @@ -123,7 +123,7 @@ NSString *const ASDisplayNodeCAContentsGravityFromUIContentMode(UIViewContentMod return e.string; } } - ASDisplayNodeCAssert(contentMode == UIViewContentModeRedraw, @"Encountered an unknown contentMode %zd. Is this a new version of iOS?", contentMode); + ASDisplayNodeCAssert(contentMode == UIViewContentModeRedraw, @"Encountered an unknown contentMode %ld. Is this a new version of iOS?", (long)contentMode); // Redraw is ok to return nil. return nil; } diff --git a/Source/Private/_ASHierarchyChangeSet.mm b/Source/Private/_ASHierarchyChangeSet.mm index 437e7c56ce..e3b7ab94e6 100644 --- a/Source/Private/_ASHierarchyChangeSet.mm +++ b/Source/Private/_ASHierarchyChangeSet.mm @@ -536,7 +536,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) NSInteger deletedSectionCount = _deletedSections.count; // Assert that the new section count is correct. if (newSectionCount != oldSectionCount + insertedSectionCount - deletedSectionCount) { - ASFailUpdateValidation(@"Invalid number of sections. The number of sections after the update (%zd) must be equal to the number of sections before the update (%zd) plus or minus the number of sections inserted or deleted (%tu inserted, %tu deleted)", newSectionCount, oldSectionCount, insertedSectionCount, deletedSectionCount); + ASFailUpdateValidation(@"Invalid number of sections. The number of sections after the update (%ld) must be equal to the number of sections before the update (%ld) plus or minus the number of sections inserted or deleted (%ld inserted, %ld deleted)", (long)newSectionCount, (long)oldSectionCount, (long)insertedSectionCount, (long)deletedSectionCount); return; } @@ -548,7 +548,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) invalidSectionDelete = [_deletedSections indexGreaterThanIndex:oldSectionCount - 1]; } if (invalidSectionDelete != NSNotFound) { - ASFailUpdateValidation(@"Attempt to delete section %zd but there are only %zd sections before the update.", invalidSectionDelete, oldSectionCount); + ASFailUpdateValidation(@"Attempt to delete section %ld but there are only %ld sections before the update.", (long)invalidSectionDelete, (long)oldSectionCount); return; } @@ -558,14 +558,14 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) NSInteger section = indexPath.section; NSInteger item = indexPath.item; if (section >= oldSectionCount) { - ASFailUpdateValidation(@"Attempt to delete item %zd from section %zd, but there are only %zd sections before the update.", item, section, oldSectionCount); + ASFailUpdateValidation(@"Attempt to delete item %ld from section %ld, but there are only %ld sections before the update.", (long)item, (long)section, (long)oldSectionCount); return; } // Assert that item delete happened to a valid item. NSInteger oldItemCount = _oldItemCounts[section]; if (item >= oldItemCount) { - ASFailUpdateValidation(@"Attempt to delete item %zd from section %zd, which only contains %zd items before the update.", item, section, oldItemCount); + ASFailUpdateValidation(@"Attempt to delete item %ld from section %ld, which only contains %ld items before the update.", (long)item, (long)section, (long)oldItemCount); return; } } @@ -577,14 +577,14 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) NSInteger item = indexPath.item; // Assert that item insert happened in a valid section. if (section >= newSectionCount) { - ASFailUpdateValidation(@"Attempt to insert item %zd into section %zd, but there are only %zd sections after the update.", item, section, newSectionCount); + ASFailUpdateValidation(@"Attempt to insert item %ld into section %ld, but there are only %ld sections after the update.", (long)item, (long)section, (long)newSectionCount); return; } // Assert that item delete happened to a valid item. NSInteger newItemCount = _newItemCounts[section]; if (item >= newItemCount) { - ASFailUpdateValidation(@"Attempt to insert item %zd into section %zd, which only contains %zd items after the update.", item, section, newItemCount); + ASFailUpdateValidation(@"Attempt to insert item %ld into section %ld, which only contains %ld items after the update.", (long)item, (long)section, (long)newItemCount); return; } } @@ -598,7 +598,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) invalidSectionInsert = [_insertedSections indexGreaterThanIndex:newSectionCount - 1]; } if (invalidSectionInsert != NSNotFound) { - ASFailUpdateValidation(@"Attempt to insert section %zd but there are only %zd sections after the update.", invalidSectionInsert, newSectionCount); + ASFailUpdateValidation(@"Attempt to insert section %ld but there are only %ld sections after the update.", (long)invalidSectionInsert, (long)newSectionCount); return; } @@ -631,7 +631,7 @@ NSString *NSStringFromASHierarchyChangeType(_ASHierarchyChangeType changeType) NSInteger insertedItemCount = originalInsertedItems.count; NSInteger deletedItemCount = originalDeletedItems.count; if (newItemCount != oldItemCount + insertedItemCount - deletedItemCount) { - ASFailUpdateValidation(@"Invalid number of items in section %zd. The number of items after the update (%zd) must be equal to the number of items before the update (%zd) plus or minus the number of items inserted or deleted (%zd inserted, %zd deleted).", oldSection, newItemCount, oldItemCount, insertedItemCount, deletedItemCount); + ASFailUpdateValidation(@"Invalid number of items in section %ld. The number of items after the update (%ld) must be equal to the number of items before the update (%ld) plus or minus the number of items inserted or deleted (%ld inserted, %ld deleted).", (long)oldSection, (long)newItemCount, (long)oldItemCount, (long)insertedItemCount, (long)deletedItemCount); return; } } From 8cd123b0dee0e4e9ac868e59ece16ba7092fafc3 Mon Sep 17 00:00:00 2001 From: huang-kun Date: Sat, 14 Jul 2018 04:09:59 +0800 Subject: [PATCH 23/97] Add an introduction for ASCornerLayoutSpec in layout2-layoutspec-types.md (#1021) --- docs/_docs/layout2-layoutspec-types.md | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/_docs/layout2-layoutspec-types.md b/docs/_docs/layout2-layoutspec-types.md index f382df0d42..e0ce92fde5 100755 --- a/docs/_docs/layout2-layoutspec-types.md +++ b/docs/_docs/layout2-layoutspec-types.md @@ -19,6 +19,7 @@ The following `ASLayoutSpec` subclasses can be used to compose simple or very co
  • ASRelativeLayoutSpec
  • ASAbsoluteLayoutSpec
  • +
  • ASCornerLayoutSpec
  • You may also subclass `ASLayoutSpec` in order to make your own, custom layout specs. @@ -434,6 +435,48 @@ override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec +## ASCornerLayoutSpec +`ASCornerLayoutSpec` is a new convenient layout spec for fast corner element layout. The easy way to position an element in corner is to use declarative code expression rather than manual coordinate calculation, and ASCornerLayoutSpec can achieve this goal. + + + +`ASCornerLayoutSpec` takes good care of its own size calculation. The best scenario to explain this would be the case that adding a small badge view at the corner of user's avatar image and there is no need to worry about the fact that little-exceeded badge frame (which out of avatar image frame) may affect the whole layout size. By default, the size of corner element will not be added to layout size, only if you manually turn on the `wrapsCorner` property. + +`ASCornerLayoutSpec` is introduced from version 2.7 and above. + +
    + + Swift + Objective-C + + +
    +
    +- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constrainedSize
    +{
    +  ...
    +  // Layout the center of badge to the top right corner of avatar.
    +  ASCornerLayoutSpec *cornerSpec = [ASCornerLayoutSpec cornerLayoutSpecWithChild:self.avatarNode corner:self.badgeNode location:ASCornerLayoutLocationTopRight];
    +  // Slightly shift center of badge inside of avatar.
    +  cornerSpec.offset = CGPointMake(-3, 3);
    +  ...
    +}
    +
    + + +
    +
    + ## ASLayoutSpec `ASLayoutSpec` is the main class from that all layout spec's are subclassed. It's main job is to handle all the children management, but it also can be used to create custom layout specs. Only the super advanced should want / need to create a custom subclasses of `ASLayoutSpec` though. Instead try to use provided layout specs and compose them together to create more advanced layouts. From 0dc97fbb2f179812291966dd0a311f2eea8d7543 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Fri, 13 Jul 2018 14:58:16 -0700 Subject: [PATCH 24/97] Stricter locking assertions (#1024) - Rename `ASDisplayNodeAssertLockUnownedByCurrentThread` to `ASAssertUnlocked`, and `ASDisplayNodeAssertLockOwnedByCurrentThread` to `ASAssertLocked` -> shorter and hopefully easier to distinguish between the two. - Add assertions to `_locked_` and `_u_` (i.e "unlocked") methods. - Turn `CHECK_LOCKING_SAFETY` flag on by default. After #1022 and #1023, we're in a good shape to actually enforce locked/unlocked requirements of internal methods. Our test suite passed, and we'll test more at Pinterest after the sync this week. - Fix ASVideoNode to avoid calling `play` while holding the lock. That method inserts a subnode and must be called lock free. - Simplify `_loaded(node)` to only nil-check `_layer` because regardless of whether the node is view or layer backed, the layer should always be set if loaded. Use it throughout. - Other minor changes. --- CHANGELOG.md | 1 + Source/ASDisplayNode+Layout.mm | 100 ++++++++++-------- Source/ASDisplayNode.mm | 73 ++++++++----- Source/ASImageNode+AnimatedImage.mm | 12 +++ Source/ASImageNode.mm | 1 + Source/ASNetworkImageNode.mm | 8 ++ Source/ASTextNode.mm | 8 +- Source/ASTextNode2.mm | 7 +- Source/ASVideoNode.mm | 3 + Source/ASVideoPlayerNode.mm | 13 +++ Source/Details/ASThread.h | 14 +-- .../Private/ASDisplayNode+FrameworkPrivate.h | 5 + Source/Private/ASDisplayNode+UIViewBridge.mm | 25 +++-- Source/Private/ASDisplayNodeInternal.h | 3 + 14 files changed, 180 insertions(+), 93 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b76352672..c4d9115752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) - Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) - Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) +- Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 19ed422bf1..c6f25202d2 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -184,6 +184,7 @@ ASLayoutElementStyleExtensibilityForwarding - (ASSizeRange)_locked_constrainedSizeForCalculatedLayout { + ASAssertLocked(__instanceLock__); if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { return _pendingDisplayNodeLayout->constrainedSize; } @@ -218,9 +219,10 @@ ASLayoutElementStyleExtensibilityForwarding */ - (void)_u_setNeedsLayoutFromAbove { - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock); - as_activity_create_for_scope("Set needs layout from above"); ASDisplayNodeAssertThreadAffinity(self); + ASAssertUnlocked(__instanceLock__); + + as_activity_create_for_scope("Set needs layout from above"); // Mark the node for layout in the next layout pass [self setNeedsLayout]; @@ -243,7 +245,7 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_rootNodeDidInvalidateSize { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); __instanceLock__.lock(); @@ -273,7 +275,7 @@ ASLayoutElementStyleExtensibilityForwarding - (void)displayNodeDidInvalidateSizeNewSize:(CGSize)size { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); // The default implementation of display node changes the size of itself to the new size CGRect oldBounds = self.bounds; @@ -295,19 +297,19 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_u_measureNodeWithBoundsIfNecessary:(CGRect)bounds { - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock); + ASAssertUnlocked(__instanceLock__); BOOL isInLayoutPendingState = NO; { ASDN::MutexLocker l(__instanceLock__); // Check if we are a subnode in a layout transition. // In this case no measurement is needed as it's part of the layout transition - if ([self _isLayoutTransitionInvalid]) { + if ([self _locked_isLayoutTransitionInvalid]) { return; } - + CGSize boundsSizeForLayout = ASCeilSizeValues(bounds.size); - + // Prefer a newer and not yet applied _pendingDisplayNodeLayout over _calculatedDisplayNodeLayout // If there is no such _pending, check if _calculated is valid to reuse (avoiding recalculation below). BOOL pendingLayoutIsPreferred = NO; @@ -328,12 +330,16 @@ ASLayoutElementStyleExtensibilityForwarding if (!pendingLayoutIsPreferred && calculatedLayoutIsReusable) { return; } - + as_activity_create_for_scope("Update node layout for current bounds"); - as_log_verbose(ASLayoutLog(), "Node %@, bounds size %@, calculatedSize %@, calculatedIsDirty %d", self, NSStringFromCGSize(boundsSizeForLayout), NSStringFromCGSize(_calculatedDisplayNodeLayout->layout.size), _calculatedDisplayNodeLayout->version < _layoutVersion.load()); + as_log_verbose(ASLayoutLog(), "Node %@, bounds size %@, calculatedSize %@, calculatedIsDirty %d", + self, + NSStringFromCGSize(boundsSizeForLayout), + NSStringFromCGSize(_calculatedDisplayNodeLayout->layout.size), + _calculatedDisplayNodeLayout->version < _layoutVersion); // _calculatedDisplayNodeLayout is not reusable we need to transition to a new one [self cancelLayoutTransition]; - + BOOL didCreateNewContext = NO; ASLayoutElementContext *context = ASLayoutElementGetCurrentContext(); if (context == nil) { @@ -341,17 +347,17 @@ ASLayoutElementStyleExtensibilityForwarding ASLayoutElementPushContext(context); didCreateNewContext = YES; } - + // Figure out previous and pending layouts for layout transition std::shared_ptr nextLayout = _pendingDisplayNodeLayout; -#define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout->layout.size, boundsSizeForLayout) - + #define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout->layout.size, boundsSizeForLayout) + // nextLayout was likely created by a call to layoutThatFits:, check if it is valid and can be applied. // If our bounds size is different than it, or invalid, recalculate. Use #define to avoid nullptr-> BOOL pendingLayoutApplicable = NO; if (nextLayout == nullptr) { as_log_verbose(ASLayoutLog(), "No pending layout."); - } else if (nextLayout->version < _layoutVersion) { + } else if (nextLayout->isValid(_layoutVersion) == NO) { as_log_verbose(ASLayoutLog(), "Pending layout is stale."); } else if (layoutSizeDifferentFromBounds) { as_log_verbose(ASLayoutLog(), "Pending layout size %@ doesn't match bounds size.", NSStringFromCGSize(nextLayout->layout.size)); @@ -359,7 +365,7 @@ ASLayoutElementStyleExtensibilityForwarding as_log_verbose(ASLayoutLog(), "Using pending layout %@.", nextLayout->layout); pendingLayoutApplicable = YES; } - + if (!pendingLayoutApplicable) { as_log_verbose(ASLayoutLog(), "Measuring with previous constrained size."); // Use the last known constrainedSize passed from a parent during layout (if never, use bounds). @@ -373,11 +379,11 @@ ASLayoutElementStyleExtensibilityForwarding // Release it and any orphaned subnodes it retains _pendingDisplayNodeLayout = nullptr; } - + if (didCreateNewContext) { ASLayoutElementPopContext(); } - + // If our new layout's desired size for self doesn't match current size, ask our parent to update it. // This can occur for either pre-calculated or newly-calculated layouts. if (nextLayout->requestedLayoutFromAbove == NO @@ -390,14 +396,17 @@ ASLayoutElementStyleExtensibilityForwarding // In this case, we need to detect that we've already asked to be resized to match this // particular ASLayout object, and shouldn't loop asking again unless we have a different ASLayout. nextLayout->requestedLayoutFromAbove = YES; - __instanceLock__.unlock(); - [self _u_setNeedsLayoutFromAbove]; - __instanceLock__.lock(); + + { + ASDN::MutexUnlocker u(__instanceLock__); + [self _u_setNeedsLayoutFromAbove]; + } + // Update the layout's version here because _u_setNeedsLayoutFromAbove calls __setNeedsLayout which in turn increases _layoutVersion // Failing to do this will cause the layout to be invalid immediately nextLayout->version = _layoutVersion; } - + // Prepare to transition to nextLayout ASDisplayNodeAssertNotNil(nextLayout->layout, @"nextLayout->layout should not be nil! %@", self); _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self @@ -405,7 +414,7 @@ ASLayoutElementStyleExtensibilityForwarding previousLayout:_calculatedDisplayNodeLayout]; isInLayoutPendingState = ASHierarchyStateIncludesLayoutPending(_hierarchyState); } - + // If a parent is currently executing a layout transition, perform our layout application after it. if (isInLayoutPendingState == NO) { // If no transition, apply our new layout immediately (common case). @@ -413,18 +422,26 @@ ASLayoutElementStyleExtensibilityForwarding } } +- (ASSizeRange)_constrainedSizeForLayoutPass +{ + ASDN::MutexLocker l(__instanceLock__); + return [self _locked_constrainedSizeForLayoutPass]; +} + - (ASSizeRange)_locked_constrainedSizeForLayoutPass { // TODO: The logic in -_u_setNeedsLayoutFromAbove seems correct and doesn't use this method. // logic seems correct. For what case does -this method need to do the CGSizeEqual checks? // IF WE CAN REMOVE BOUNDS CHECKS HERE, THEN WE CAN ALSO REMOVE "REQUESTED FROM ABOVE" CHECK - + + ASAssertLocked(__instanceLock__); + CGSize boundsSizeForLayout = ASCeilSizeValues(self.threadSafeBounds.size); - + // Checkout if constrained size of pending or calculated display node layout can be used if (_pendingDisplayNodeLayout != nullptr && (_pendingDisplayNodeLayout->requestedLayoutFromAbove - || CGSizeEqualToSize(_pendingDisplayNodeLayout->layout.size, boundsSizeForLayout))) { + || CGSizeEqualToSize(_pendingDisplayNodeLayout->layout.size, boundsSizeForLayout))) { // We assume the size from the last returned layoutThatFits: layout was applied so use the pending display node // layout constrained size return _pendingDisplayNodeLayout->constrainedSize; @@ -444,7 +461,7 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_layoutSublayouts { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASLayout *layout; { @@ -503,6 +520,7 @@ ASLayoutElementStyleExtensibilityForwarding - (BOOL)_locked_isLayoutTransitionInvalid { + ASAssertLocked(__instanceLock__); if (ASHierarchyStateIncludesLayoutPending(_hierarchyState)) { ASLayoutElementContext *context = ASLayoutElementGetCurrentContext(); if (context == nil || _pendingTransitionID != context.transitionID) { @@ -535,18 +553,10 @@ ASLayoutElementStyleExtensibilityForwarding measurementCompletion:(void(^)())completion { ASDisplayNodeAssertMainThread(); - - ASSizeRange sizeRange; - { - ASDN::MutexLocker l(__instanceLock__); - sizeRange = [self _locked_constrainedSizeForLayoutPass]; - } - - [self transitionLayoutWithSizeRange:sizeRange + [self transitionLayoutWithSizeRange:[self _constrainedSizeForLayoutPass] animated:animated shouldMeasureAsync:shouldMeasureAsync measurementCompletion:completion]; - } - (void)transitionLayoutWithSizeRange:(ASSizeRange)constrainedSize @@ -653,9 +663,9 @@ ASLayoutElementStyleExtensibilityForwarding // Update calculated layout let previousLayout = _calculatedDisplayNodeLayout; let pendingLayout = std::make_shared(newLayout, - constrainedSize, - constrainedSize.max, - newLayoutVersion); + constrainedSize, + constrainedSize.max, + newLayoutVersion); [self _locked_setCalculatedDisplayNodeLayout:pendingLayout]; // Setup pending layout transition for animation @@ -865,8 +875,8 @@ ASLayoutElementStyleExtensibilityForwarding */ - (void)_completePendingLayoutTransition { - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock); - + ASAssertUnlocked(__instanceLock__); + ASLayoutTransition *pendingLayoutTransition = nil; { ASDN::MutexLocker l(__instanceLock__); @@ -875,7 +885,7 @@ ASLayoutElementStyleExtensibilityForwarding [self _locked_setCalculatedDisplayNodeLayout:pendingLayoutTransition.pendingLayout]; } } - + if (pendingLayoutTransition != nil) { [self _completeLayoutTransition:pendingLayoutTransition]; [self _pendingLayoutTransitionDidComplete]; @@ -895,6 +905,8 @@ ASLayoutElementStyleExtensibilityForwarding // Trampoline to the main thread if necessary if (ASDisplayNodeThreadIsMain() || layoutTransition.isSynchronous == NO) { + // Committing the layout transition will result in subnode insertions and removals, both of which must be called without the lock held + ASAssertUnlocked(__instanceLock__); [layoutTransition commitTransition]; } else { // Subnode insertions and removals need to happen always on the main thread if at least one subnode is already loaded @@ -948,12 +960,13 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_pendingLayoutTransitionDidComplete { // This assertion introduces a breaking behavior for nodes that has ASM enabled but also manually manage some subnodes. - // Let's gate it behind YOGA flag and remove it right after a branch cut. + // Let's gate it behind YOGA flag. #if YOGA [self _assertSubnodeState]; #endif // Subclass hook + ASAssertUnlocked(__instanceLock__); [self calculatedLayoutDidChange]; // Grab lock after calling out to subclass @@ -998,6 +1011,7 @@ ASLayoutElementStyleExtensibilityForwarding - (void)_locked_setCalculatedDisplayNodeLayout:(std::shared_ptr)displayNodeLayout { + ASAssertLocked(__instanceLock__); ASDisplayNodeAssertTrue(displayNodeLayout->layout.layoutElement == self); ASDisplayNodeAssertTrue(displayNodeLayout->layout.size.width >= 0.0); ASDisplayNodeAssertTrue(displayNodeLayout->layout.size.height >= 0.0); diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 4efd133758..6272fa018f 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -460,11 +460,14 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (BOOL)_locked_shouldLoadViewOrLayer { + ASAssertLocked(__instanceLock__); return !_flags.isDeallocating && !(_hierarchyState & ASHierarchyStateRasterized); } - (UIView *)_locked_viewToLoad { + ASAssertLocked(__instanceLock__); + UIView *view = nil; if (_viewBlock) { view = _viewBlock(); @@ -503,6 +506,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (CALayer *)_locked_layerToLoad { + ASAssertLocked(__instanceLock__); ASDisplayNodeAssert(_flags.layerBacked, @"_layerToLoad is only for layer-backed nodes"); CALayer *layer = nil; @@ -521,6 +525,8 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (void)_locked_loadViewOrLayer { + ASAssertLocked(__instanceLock__); + if (_flags.layerBacked) { TIME_SCOPED(_debugTimeToCreateView); _layer = [self _locked_layerToLoad]; @@ -549,7 +555,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (void)_didLoad { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeLogEvent(self, @"didLoad"); as_log_verbose(ASNodeLog(), "didLoad %@", self); TIME_SCOPED(_debugTimeForDidLoad); @@ -584,7 +590,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); if (ASDisplayNodeThreadIsMain()) { // Because the view and layer can only be created and destroyed on Main, that is also the only thread // where the state of this property can change. As an optimization, we can avoid locking. - return [self _locked_isNodeLoaded]; + return _loaded(self); } else { ASDN::MutexLocker l(__instanceLock__); return [self _locked_isNodeLoaded]; @@ -593,7 +599,8 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (BOOL)_locked_isNodeLoaded { - return (_view != nil || (_layer != nil && _flags.layerBacked)); + ASAssertLocked(__instanceLock__); + return _loaded(self); } #pragma mark - Misc Setter / Getter @@ -696,6 +703,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (_ASDisplayLayer *)_locked_asyncLayer { + ASAssertLocked(__instanceLock__); return [_layer isKindOfClass:[_ASDisplayLayer class]] ? (_ASDisplayLayer *)_layer : nil; } @@ -754,6 +762,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (CGRect)_locked_threadSafeBounds { + ASAssertLocked(__instanceLock__); return _threadSafeBounds; } @@ -1014,7 +1023,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (void)__layout { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); BOOL loaded = NO; { @@ -1066,7 +1075,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); { // Hook for subclasses ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); } @@ -1226,6 +1235,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); - (id)_locked_layoutElementThatFits:(ASSizeRange)constrainedSize { + ASAssertLocked(__instanceLock__); __ASDisplayNodeCheckForLayoutMethodOverrides; BOOL measureLayoutSpec = _measurementOptions & ASDisplayNodePerformanceMeasurementOptionLayoutSpec; @@ -1256,7 +1266,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); { // Hook for subclasses ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(nodeDidLayout)]) { @@ -1310,6 +1320,7 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS */ - (BOOL)_locked_displaysAsynchronously { + ASAssertLocked(__instanceLock__); return checkFlag(Synchronous) == NO && _flags.displaysAsynchronously; } @@ -2093,7 +2104,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (ASDisplayNode *)supernode { #if CHECK_LOCKING_SAFETY - if (__instanceLock__.ownedByCurrentThread()) { + if (__instanceLock__.locked()) { NSLog(@"WARNING: Accessing supernode while holding recursive instance lock of this node is worrisome. It's likely that you will soon try to acquire the supernode's lock, and this can easily cause deadlocks."); } #endif @@ -2187,7 +2198,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { /* * Central private helper method that should eventually be called if submethods add, insert or replace subnodes - * This method is called with thread affinity. + * This method is called with thread affinity and without lock held. * * @param subnode The subnode to insert * @param subnodeIndex The index in _subnodes to insert it @@ -2197,7 +2208,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { */ - (void)_insertSubnode:(ASDisplayNode *)subnode atSubnodeIndex:(NSInteger)subnodeIndex sublayerIndex:(NSInteger)sublayerIndex andRemoveSubnode:(ASDisplayNode *)oldSubnode { - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASDisplayNodeAssertThreadAffinity(self); + ASAssertUnlocked(__instanceLock__); + as_log_verbose(ASNodeLog(), "Insert subnode %@ at index %zd of %@ and remove subnode %@", subnode, subnodeIndex, self, oldSubnode); if (subnode == nil || subnode == self) { @@ -2405,6 +2418,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_insertSubnode:(ASDisplayNode *)subnode belowSubnode:(ASDisplayNode *)below { ASDisplayNodeAssertThreadAffinity(self); + ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2468,6 +2482,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_insertSubnode:(ASDisplayNode *)subnode aboveSubnode:(ASDisplayNode *)above { ASDisplayNodeAssertThreadAffinity(self); + ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2529,6 +2544,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_insertSubnode:(ASDisplayNode *)subnode atIndex:(NSInteger)idx { ASDisplayNodeAssertThreadAffinity(self); + ASAssertUnlocked(__instanceLock__); if (subnode == nil) { ASDisplayNodeFailAssert(@"Cannot insert a nil subnode"); @@ -2565,7 +2581,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_removeSubnode:(ASDisplayNode *)subnode { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); // Don't call self.supernode here because that will retain/autorelease the supernode. This method -_removeSupernode: is often called while tearing down a node hierarchy, and the supernode in question might be in the middle of its -dealloc. The supernode is never messaged, only compared by value, so this is safe. // The particular issue that triggers this edge case is when a node calls -removeFromSupernode on a subnode from within its own -dealloc method. @@ -2591,7 +2607,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_removeFromSupernode { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); __instanceLock__.lock(); __weak ASDisplayNode *supernode = _supernode; @@ -2605,7 +2621,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_removeFromSupernodeIfEqualTo:(ASDisplayNode *)supernode { ASDisplayNodeAssertThreadAffinity(self); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); __instanceLock__.lock(); @@ -2698,6 +2714,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_locked_layoutPlaceholderIfNecessary { + ASAssertLocked(__instanceLock__); if ([self _locked_shouldHavePlaceholderLayer]) { [self _locked_setupPlaceholderLayerIfNeeded]; } @@ -2707,12 +2724,14 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (BOOL)_locked_shouldHavePlaceholderLayer { + ASAssertLocked(__instanceLock__); return (_placeholderEnabled && [self _implementsDisplay]); } - (void)_locked_setupPlaceholderLayerIfNeeded { ASDisplayNodeAssertMainThread(); + ASAssertLocked(__instanceLock__); if (!_placeholderLayer) { _placeholderLayer = [CALayer layer]; @@ -2760,7 +2779,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"Should not cause recursive __enterHierarchy"); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeLogEvent(self, @"enterHierarchy"); // Profiling has shown that locking this method is beneficial, so each of the property accesses don't have to lock and unlock. @@ -2809,7 +2828,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"Should not cause recursive __exitHierarchy"); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeLogEvent(self, @"exitHierarchy"); // Profiling has shown that locking this method is beneficial, so each of the property accesses don't have to lock and unlock. @@ -2916,7 +2935,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(_flags.isEnteringHierarchy, @"You should never call -willEnterHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); if (![self supportsRangeManagedInterfaceState]) { self.interfaceState = ASInterfaceStateInHierarchy; @@ -2928,7 +2947,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"You should never call -didEnterHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isExitingHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); ASDisplayNodeAssert(_flags.isInHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); } - (void)didExitHierarchy @@ -2936,7 +2955,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { ASDisplayNodeAssertMainThread(); ASDisplayNodeAssert(_flags.isExitingHierarchy, @"You should never call -didExitHierarchy directly. Appearance is automatically managed by ASDisplayNode"); ASDisplayNodeAssert(!_flags.isEnteringHierarchy, @"ASDisplayNode inconsistency. __enterHierarchy and __exitHierarchy are mutually exclusive"); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); // This case is important when tearing down hierarchies. We must deliver a visibileStateDidChange:NO callback, as part our API guarantee that this method can be used for // things like data analytics about user content viewing. We cannot call the method in the dealloc as any incidental retain operations in client code would fail. @@ -3058,7 +3077,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { ASDisplayNodeAssertMainThread(); // This method manages __instanceLock__ itself, to ensure the lock is not held while didEnter/Exit(.*)State methods are called, thus avoid potential deadlocks - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASInterfaceState oldState = ASInterfaceStateNone; ASInterfaceState newState = ASInterfaceStateNone; @@ -3185,7 +3204,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState { // Subclass hook - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertMainThread(); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(interfaceStateDidChange:fromState:)]) { @@ -3229,7 +3248,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { // subclass override ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(didEnterVisibleState)]) { [delegate didEnterVisibleState]; @@ -3244,7 +3263,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { // subclass override ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(didExitVisibleState)]) { [delegate didExitVisibleState]; @@ -3262,7 +3281,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { // subclass override ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(didEnterDisplayState)]) { [delegate didEnterDisplayState]; @@ -3274,7 +3293,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { { // subclass override ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(didExitDisplayState)]) { [delegate didExitDisplayState]; @@ -3316,7 +3335,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)didEnterPreloadState { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); // If this node has ASM enabled and is not yet visible, force a layout pass to apply its applicable pending layout, if any, // so that its subnodes are inserted/deleted and start preloading right away. @@ -3340,7 +3359,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)didExitPreloadState { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); for (id delegate in _interfaceStateDelegates) { if ([delegate respondsToSelector:@selector(didExitPreloadState)]) { [delegate didExitPreloadState]; @@ -3445,6 +3464,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_locked_applyPendingStateToViewOrLayer { ASDisplayNodeAssertMainThread(); + ASAssertLocked(__instanceLock__); ASDisplayNodeAssert(self.nodeLoaded, @"must have a view or layer"); TIME_SCOPED(_debugTimeToApplyPendingState); @@ -3464,7 +3484,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)applyPendingViewState { ASDisplayNodeAssertMainThread(); - ASDisplayNodeAssertLockUnownedByCurrentThread(__instanceLock__); + ASAssertUnlocked(__instanceLock__); ASDN::MutexLocker l(__instanceLock__); // FIXME: Ideally we'd call this as soon as the node receives -setNeedsLayout @@ -3483,6 +3503,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)_locked_applyPendingViewState { ASDisplayNodeAssertMainThread(); + ASAssertLocked(__instanceLock__); ASDisplayNodeAssert([self _locked_isNodeLoaded], @"Expected node to be loaded before applying pending state."); if (_flags.layerBacked) { diff --git a/Source/ASImageNode+AnimatedImage.mm b/Source/ASImageNode+AnimatedImage.mm index febbb725e4..bd085eabe1 100644 --- a/Source/ASImageNode+AnimatedImage.mm +++ b/Source/ASImageNode+AnimatedImage.mm @@ -21,6 +21,7 @@ #import #import #import +#import #import #import #import @@ -50,6 +51,8 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_setAnimatedImage:(id )animatedImage { + ASAssertLocked(__instanceLock__); + if (ASObjectIsEqual(_animatedImage, animatedImage) && (animatedImage == nil || animatedImage.playbackReady)) { return; } @@ -124,6 +127,8 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_setCoverImageCompleted:(UIImage *)coverImage { + ASAssertLocked(__instanceLock__); + _displayLinkLock.lock(); BOOL setCoverImage = (_displayLink == nil) || _displayLink.paused; _displayLinkLock.unlock(); @@ -141,6 +146,8 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_setCoverImage:(UIImage *)coverImage { + ASAssertLocked(__instanceLock__); + //If we're a network image node, we want to set the default image so //that it will correctly be restored if it exits the range. #if ASAnimatedImageDebug @@ -182,6 +189,8 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_setShouldAnimate:(BOOL)shouldAnimate { + ASAssertLocked(__instanceLock__); + // This test is explicitly done and not ASPerformBlockOnMainThread as this would perform the block immediately // on main if called on main thread and we have to call methods locked or unlocked based on which thread we are on if (ASDisplayNodeThreadIsMain()) { @@ -215,6 +224,8 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_startAnimating { + ASAssertLocked(__instanceLock__); + // It should be safe to call self.interfaceState in this case as it will only grab the lock of the superclass if (!ASInterfaceStateIncludesVisible(self.interfaceState)) { return; @@ -258,6 +269,7 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_stopAnimating { ASDisplayNodeAssertMainThread(); + ASAssertLocked(__instanceLock__); #if ASAnimatedImageDebug NSLog(@"stopping animation: %p", self); diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index b572c9d973..d060d8993e 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -244,6 +244,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); - (void)_locked_setImage:(UIImage *)image { + ASAssertLocked(__instanceLock__); if (ASObjectIsEqual(_image, image)) { return; } diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index be5bf1df49..cace5498e6 100755 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -20,6 +20,7 @@ #import #import #import +#import #import #import #import @@ -149,6 +150,8 @@ - (void)_locked_setImage:(UIImage *)image { + ASAssertLocked(__instanceLock__); + BOOL imageWasSetExternally = (image != nil); BOOL shouldCancelAndClear = imageWasSetExternally && (imageWasSetExternally != _imageWasSetExternally); _imageWasSetExternally = imageWasSetExternally; @@ -175,6 +178,7 @@ - (void)_locked__setImage:(UIImage *)image { + ASAssertLocked(__instanceLock__); [super _locked_setImage:image]; } @@ -508,6 +512,8 @@ - (void)_locked_cancelDownloadAndClearImageWithResumePossibility:(BOOL)storeResume { + ASAssertLocked(__instanceLock__); + [self _locked_cancelImageDownloadWithResumePossibility:storeResume]; [self _locked_setAnimatedImage:nil]; @@ -532,6 +538,8 @@ - (void)_locked_cancelImageDownloadWithResumePossibility:(BOOL)storeResume { + ASAssertLocked(__instanceLock__); + if (!_downloadIdentifier) { return; } diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 75507a994f..3ffcfe569e 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -26,9 +26,10 @@ #import #import #import +#import +#import #import #import -#import #import #import @@ -343,17 +344,20 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; - (ASTextKitRenderer *)_locked_renderer { + ASAssertLocked(__instanceLock__); return [self _locked_rendererWithBounds:[self _locked_threadSafeBounds]]; } - (ASTextKitRenderer *)_locked_rendererWithBounds:(CGRect)bounds { + ASAssertLocked(__instanceLock__); bounds = UIEdgeInsetsInsetRect(bounds, _textContainerInset); return rendererForAttributes([self _locked_rendererAttributes], bounds.size); } - (ASTextKitAttributes)_locked_rendererAttributes { + ASAssertLocked(__instanceLock__); return { .attributedString = _attributedText, .truncationAttributedString = [self _locked_composedTruncationText], @@ -1272,6 +1276,7 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSAttributedString *)_locked_composedTruncationText { + ASAssertLocked(__instanceLock__); if (_composedTruncationText == nil) { if (_truncationAttributedText != nil && _additionalTruncationMessage != nil) { NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedText]; @@ -1297,6 +1302,7 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSAttributedString *)_locked_prepareTruncationStringForDrawing:(NSAttributedString *)truncationString { + ASAssertLocked(__instanceLock__); truncationString = ASCleanseAttributedStringOfCoreTextAttributes(truncationString); NSMutableAttributedString *truncationMutableString = [truncationString mutableCopy]; // Grab the attributes from the full string diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 92dc243b2f..7d3d8d7b34 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -19,8 +19,9 @@ #import #import #import -#import #import +#import +#import #import #import @@ -1098,7 +1099,7 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSAttributedString *)_locked_composedTruncationText { - ASDisplayNodeAssertLockOwnedByCurrentThread(__instanceLock__); + ASAssertLocked(__instanceLock__); if (_composedTruncationText == nil) { if (_truncationAttributedText != nil && _additionalTruncationMessage != nil) { NSMutableAttributedString *newComposedTruncationString = [[NSMutableAttributedString alloc] initWithAttributedString:_truncationAttributedText]; @@ -1124,7 +1125,7 @@ static NSAttributedString *DefaultTruncationAttributedString() */ - (NSAttributedString *)_locked_prepareTruncationStringForDrawing:(NSAttributedString *)truncationString { - ASDisplayNodeAssertLockOwnedByCurrentThread(__instanceLock__); + ASAssertLocked(__instanceLock__); NSMutableAttributedString *truncationMutableString = [truncationString mutableCopy]; // Grab the attributes from the full string if (_attributedText.length > 0) { diff --git a/Source/ASVideoNode.mm b/Source/ASVideoNode.mm index d67c72ab07..3b8c9bd37c 100644 --- a/Source/ASVideoNode.mm +++ b/Source/ASVideoNode.mm @@ -338,6 +338,7 @@ static NSString * const kRate = @"rate"; if (self.playerState != ASVideoNodePlayerStatePlaying) { self.playerState = ASVideoNodePlayerStateReadyToPlay; if (_shouldBePlaying && ASInterfaceStateIncludesVisible(self.interfaceState)) { + ASUnlockScope(self); [self play]; } } @@ -360,6 +361,8 @@ static NSString * const kRate = @"rate"; if (self.playerState == ASVideoNodePlayerStateLoading && _delegateFlags.delegateVideoNodeDidRecoverFromStall) { [self.delegate videoNodeDidRecoverFromStall:self]; } + + ASUnlockScope(self); [self play]; // autoresume after buffer catches up } } else if ([keyPath isEqualToString:kplaybackBufferEmpty]) { diff --git a/Source/ASVideoPlayerNode.mm b/Source/ASVideoPlayerNode.mm index 7859448a6b..c864c10a94 100644 --- a/Source/ASVideoPlayerNode.mm +++ b/Source/ASVideoPlayerNode.mm @@ -26,6 +26,7 @@ #import #import #import +#import #import static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; @@ -334,6 +335,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createPlaybackButton { + ASAssertLocked(__instanceLock__); + if (_playbackButtonNode == nil) { _playbackButtonNode = [[ASDefaultPlaybackButton alloc] init]; _playbackButtonNode.style.preferredSize = CGSizeMake(16.0, 22.0); @@ -357,6 +360,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createFullScreenButton { + ASAssertLocked(__instanceLock__); + if (_fullScreenButtonNode == nil) { _fullScreenButtonNode = [[ASButtonNode alloc] init]; _fullScreenButtonNode.style.preferredSize = CGSizeMake(16.0, 22.0); @@ -374,6 +379,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createElapsedTextField { + ASAssertLocked(__instanceLock__); + if (_elapsedTextNode == nil) { _elapsedTextNode = [[ASTextNode alloc] init]; _elapsedTextNode.attributedText = [self timeLabelAttributedStringForString:@"00:00" @@ -387,6 +394,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createDurationTextField { + ASAssertLocked(__instanceLock__); + if (_durationTextNode == nil) { _durationTextNode = [[ASTextNode alloc] init]; _durationTextNode.attributedText = [self timeLabelAttributedStringForString:@"00:00" @@ -401,6 +410,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createScrubber { + ASAssertLocked(__instanceLock__); + if (_scrubberNode == nil) { __weak __typeof__(self) weakSelf = self; _scrubberNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView * _Nonnull { @@ -445,6 +456,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)_locked_createControlFlexGrowSpacer { + ASAssertLocked(__instanceLock__); + if (_controlFlexGrowSpacerSpec == nil) { _controlFlexGrowSpacerSpec = [[ASStackLayoutSpec alloc] init]; _controlFlexGrowSpacerSpec.style.flexGrow = 1.0; diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index 5c61aa7838..362f96c5bc 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -108,13 +108,13 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) * Enable this flag to collect information on the owning thread and ownership level of a mutex. * These properties are useful to determine if a mutext has been acquired and in case of a recursive mutex, how many times that happened. * - * This flag also enable locking assertions (e.g ASDisplayNodeAssertLockUnownedByCurrentThread(node)). + * This flag also enable locking assertions (e.g ASAssertUnlocked(node)). * The assertions are useful when you want to indicate and enforce the locking policy/expectation of methods. * To determine when and which methods acquired a (recursive) mutex (to debug deadlocks, for example), * put breakpoints at some assertions. When the breakpoints hit, walk through stack trace frames * and check ownership count of the mutex. */ -#define CHECK_LOCKING_SAFETY 0 +#define CHECK_LOCKING_SAFETY 1 #if TIME_LOCKER #import @@ -138,11 +138,11 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) * and check ownership count of the mutex. */ #if CHECK_LOCKING_SAFETY -#define ASDisplayNodeAssertLockUnownedByCurrentThread(lock) ASDisplayNodeAssertFalse(lock.ownedByCurrentThread()) -#define ASDisplayNodeAssertLockOwnedByCurrentThread(lock) ASDisplayNodeAssert(lock.ownedByCurrentThread()) +#define ASAssertUnlocked(lock) ASDisplayNodeAssertFalse(lock.locked()) +#define ASAssertLocked(lock) ASDisplayNodeAssert(lock.locked(), @"Lock must be held by current thread") #else -#define ASDisplayNodeAssertLockUnownedByCurrentThread(lock) -#define ASDisplayNodeAssertLockOwnedByCurrentThread(lock) +#define ASAssertUnlocked(lock) +#define ASAssertLocked(lock) #endif namespace ASDN { @@ -346,7 +346,7 @@ namespace ASDN { pthread_mutex_t *mutex () { return &_m; } #if CHECK_LOCKING_SAFETY - bool ownedByCurrentThread() { + bool locked() { return _count > 0 && pthread_mach_thread_np(pthread_self()) == _owner; } #endif diff --git a/Source/Private/ASDisplayNode+FrameworkPrivate.h b/Source/Private/ASDisplayNode+FrameworkPrivate.h index 245d9f382c..95a1e8dc35 100644 --- a/Source/Private/ASDisplayNode+FrameworkPrivate.h +++ b/Source/Private/ASDisplayNode+FrameworkPrivate.h @@ -297,6 +297,11 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc */ - (BOOL)_isLayoutTransitionInvalid; +/** + * Same as @c -_isLayoutTransitionInvalid but must be called with the node's instance lock held. + */ +- (BOOL)_locked_isLayoutTransitionInvalid; + /** * Internal method that can be overriden by subclasses to add specific behavior after the measurement of a layout * transition did finish. diff --git a/Source/Private/ASDisplayNode+UIViewBridge.mm b/Source/Private/ASDisplayNode+UIViewBridge.mm index 939ed642c6..55d9704677 100644 --- a/Source/Private/ASDisplayNode+UIViewBridge.mm +++ b/Source/Private/ASDisplayNode+UIViewBridge.mm @@ -41,8 +41,6 @@ #define DISPLAYNODE_USE_LOCKS 1 -#define __loaded(node) (node->_view != nil || (node->_layer != nil && node->_flags.layerBacked)) - #if DISPLAYNODE_USE_LOCKS #define _bridge_prologue_read ASDN::MutexLocker l(__instanceLock__); ASDisplayNodeAssertThreadAffinity(self) #define _bridge_prologue_write ASDN::MutexLocker l(__instanceLock__) @@ -59,7 +57,7 @@ /// returns NO. Otherwise, the pending state can be scheduled and flushed *before* you get a chance /// to apply it. ASDISPLAYNODE_INLINE BOOL ASDisplayNodeShouldApplyBridgedWriteToView(ASDisplayNode *node) { - BOOL loaded = __loaded(node); + BOOL loaded = _loaded(node); if (ASDisplayNodeThreadIsMain()) { return loaded; } else { @@ -70,7 +68,7 @@ ASDISPLAYNODE_INLINE BOOL ASDisplayNodeShouldApplyBridgedWriteToView(ASDisplayNo } }; -#define _getFromViewOrLayer(layerProperty, viewAndPendingViewStateProperty) __loaded(self) ? \ +#define _getFromViewOrLayer(layerProperty, viewAndPendingViewStateProperty) _loaded(self) ? \ (_view ? _view.viewAndPendingViewStateProperty : _layer.layerProperty )\ : ASDisplayNodeGetPendingState(self).viewAndPendingViewStateProperty @@ -80,9 +78,9 @@ ASDISPLAYNODE_INLINE BOOL ASDisplayNodeShouldApplyBridgedWriteToView(ASDisplayNo #define _setToViewOnly(viewAndPendingViewStateProperty, viewAndPendingViewStateExpr) BOOL shouldApply = ASDisplayNodeShouldApplyBridgedWriteToView(self); \ if (shouldApply) { _view.viewAndPendingViewStateProperty = (viewAndPendingViewStateExpr); } else { ASDisplayNodeGetPendingState(self).viewAndPendingViewStateProperty = (viewAndPendingViewStateExpr); } -#define _getFromViewOnly(viewAndPendingViewStateProperty) __loaded(self) ? _view.viewAndPendingViewStateProperty : ASDisplayNodeGetPendingState(self).viewAndPendingViewStateProperty +#define _getFromViewOnly(viewAndPendingViewStateProperty) _loaded(self) ? _view.viewAndPendingViewStateProperty : ASDisplayNodeGetPendingState(self).viewAndPendingViewStateProperty -#define _getFromLayer(layerProperty) __loaded(self) ? _layer.layerProperty : ASDisplayNodeGetPendingState(self).layerProperty +#define _getFromLayer(layerProperty) _loaded(self) ? _layer.layerProperty : ASDisplayNodeGetPendingState(self).layerProperty #define _setToLayer(layerProperty, layerValueExpr) BOOL shouldApply = ASDisplayNodeShouldApplyBridgedWriteToView(self); \ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNodeGetPendingState(self).layerProperty = (layerValueExpr); } @@ -304,7 +302,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo struct ASDisplayNodeFlags flags = _flags; BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandling(checkFlag(Synchronous), flags.layerBacked); - BOOL nodeLoaded = __loaded(self); + BOOL nodeLoaded = _loaded(self); BOOL isMainThread = ASDisplayNodeThreadIsMain(); if (!specialPropertiesHandling) { BOOL canReadProperties = isMainThread || !nodeLoaded; @@ -416,7 +414,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo { _bridge_prologue_write; shouldApply = ASDisplayNodeShouldApplyBridgedWriteToView(self); - loaded = __loaded(self); + loaded = _loaded(self); viewOrLayer = _view ?: _layer; if (shouldApply == NO && loaded) { // The node is loaded but we're not on main. @@ -447,7 +445,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo { _bridge_prologue_write; shouldApply = ASDisplayNodeShouldApplyBridgedWriteToView(self); - loaded = __loaded(self); + loaded = _loaded(self); viewOrLayer = _view ?: _layer; if (shouldApply == NO && loaded) { // The node is loaded but we're not on main. @@ -658,7 +656,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo - (UIViewContentMode)contentMode { _bridge_prologue_read; - if (__loaded(self)) { + if (_loaded(self)) { if (_flags.layerBacked) { return ASDisplayNodeUIContentModeFromCAContentsGravity(_layer.contentsGravity); } else { @@ -909,7 +907,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo _bridge_prologue_read; if (AS_AVAILABLE_IOS(11.0)) { - if (!_flags.layerBacked && __loaded(self)) { + if (!_flags.layerBacked && _loaded(self)) { return self.view.safeAreaInsets; } } @@ -938,7 +936,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo } } - shouldNotifyAboutUpdate = __loaded(self) && (!AS_AT_LEAST_IOS11 || _flags.layerBacked); + shouldNotifyAboutUpdate = _loaded(self) && (!AS_AT_LEAST_IOS11 || _flags.layerBacked); } if (shouldNotifyAboutUpdate) { @@ -975,6 +973,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo - (BOOL)_locked_insetsLayoutMarginsFromSafeArea { + ASAssertLocked(__instanceLock__); if (AS_AVAILABLE_IOS(11.0)) { if (!_flags.layerBacked) { return _getFromViewOnly(insetsLayoutMarginsFromSafeArea); @@ -996,7 +995,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo // - In case the node is loaded // - Check if the node has a view and get the value from the view if loaded or from the pending state // - If view is not available, e.g. the node is layer backed return the property value -#define _getAccessibilityFromViewOrProperty(nodeProperty, viewAndPendingViewStateProperty) __loaded(self) ? \ +#define _getAccessibilityFromViewOrProperty(nodeProperty, viewAndPendingViewStateProperty) _loaded(self) ? \ (_view ? _view.viewAndPendingViewStateProperty : nodeProperty )\ : ASDisplayNodeGetPendingState(self).viewAndPendingViewStateProperty diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 252202d512..4c668a3f3c 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -65,6 +65,9 @@ typedef NS_OPTIONS(uint_least32_t, ASDisplayNodeAtomicFlags) YogaLayoutInProgress = 1 << 1, }; +// Can be called without the node's lock. Client is responsible for thread safety. +#define _loaded(node) (node->_layer != nil) + #define checkFlag(flag) ((_atomicFlags.load() & flag) != 0) // Returns the old value of the flag as a BOOL. #define setFlag(flag, x) (((x ? _atomicFlags.fetch_or(flag) \ From 5cad23b925ef284e69cf895b0b5f7f111d13e786 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sat, 14 Jul 2018 11:10:19 -0700 Subject: [PATCH 25/97] Split framework dependencies into separate subspecs to reduce binary size and dynamic linking time when they're not needed (#1028) --- AsyncDisplayKit.xcodeproj/project.pbxproj | 3 + CHANGELOG.md | 1 + Source/ASMapNode.h | 5 +- Source/ASMapNode.mm | 7 +- Source/ASMultiplexImageNode.mm | 24 +++++-- Source/Base/ASAvailability.h | 12 ++++ .../Details/ASPhotosFrameworkImageRequest.h | 6 ++ .../Details/ASPhotosFrameworkImageRequest.m | 5 ++ Texture.podspec | 70 ++++++++++++------- 9 files changed, 96 insertions(+), 37 deletions(-) diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 4ce8706e62..5aad7bb9ed 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -2609,6 +2609,9 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", + "AS_USE_ASSETS_LIBRARY=1", + "AS_USE_MAPKIT=1", + "AS_USE_PHOTOS=1", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d9115752..9cc17d1c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) - Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) - Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024) +- Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASMapNode.h b/Source/ASMapNode.h index 10a913e8a2..c8820a18a1 100644 --- a/Source/ASMapNode.h +++ b/Source/ASMapNode.h @@ -15,8 +15,11 @@ // http://www.apache.org/licenses/LICENSE-2.0 // +#import +#import + +#if TARGET_OS_IOS && AS_USE_MAPKIT #import -#if TARGET_OS_IOS #import NS_ASSUME_NONNULL_BEGIN diff --git a/Source/ASMapNode.mm b/Source/ASMapNode.mm index 43d037f617..8dc9215795 100644 --- a/Source/ASMapNode.mm +++ b/Source/ASMapNode.mm @@ -15,11 +15,10 @@ // http://www.apache.org/licenses/LICENSE-2.0 // -#import - -#if TARGET_OS_IOS #import +#if TARGET_OS_IOS && AS_USE_MAPKIT + #import #import @@ -448,4 +447,4 @@ } @end -#endif +#endif // TARGET_OS_IOS && AS_USE_MAPKIT diff --git a/Source/ASMultiplexImageNode.mm b/Source/ASMultiplexImageNode.mm index aa335e793d..1bddadb7d5 100644 --- a/Source/ASMultiplexImageNode.mm +++ b/Source/ASMultiplexImageNode.mm @@ -17,7 +17,7 @@ #import -#if TARGET_OS_IOS +#if TARGET_OS_IOS && AS_USE_ASSETS_LIBRARY #import #endif @@ -25,12 +25,15 @@ #import #import #import -#import #import #import #import #import +#if AS_USE_PHOTOS +#import +#endif + #if AS_PIN_REMOTE_IMAGE #import #else @@ -39,7 +42,9 @@ NSString *const ASMultiplexImageNodeErrorDomain = @"ASMultiplexImageNodeErrorDomain"; +#if AS_USE_ASSETS_LIBRARY static NSString *const kAssetsLibraryURLScheme = @"assets-library"; +#endif static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; @@ -133,7 +138,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent */ - (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock; -#if TARGET_OS_IOS +#if TARGET_OS_IOS && AS_USE_ASSETS_LIBRARY /** @abstract Loads the image corresponding to the given assetURL from the device's Assets Library. @param imageIdentifier The identifier for the image to be loaded. May not be nil. @@ -143,6 +148,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent - (void)_loadALAssetWithIdentifier:(id)imageIdentifier URL:(NSURL *)assetURL completion:(void (^)(UIImage *image, NSError *error))completionBlock; #endif +#if AS_USE_PHOTOS /** @abstract Loads the image corresponding to the given image request from the Photos framework. @param imageIdentifier The identifier for the image to be loaded. May not be nil. @@ -150,6 +156,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent @param completionBlock The block to be performed when the image has been loaded, if possible. May not be nil. */ - (void)_loadPHAssetWithRequest:(ASPhotosFrameworkImageRequest *)request identifier:(id)imageIdentifier completion:(void (^)(UIImage *image, NSError *error))completionBlock API_AVAILABLE(ios(8.0), tvos(10.0)); +#endif /** @abstract Downloads the image corresponding to the given imageIdentifier from the given URL. @@ -620,7 +627,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent return; } -#if TARGET_OS_IOS +#if TARGET_OS_IOS && AS_USE_ASSETS_LIBRARY // If it's an assets-library URL, we need to fetch it from the assets library. if ([[nextImageURL scheme] isEqualToString:kAssetsLibraryURLScheme]) { // Load the asset. @@ -633,6 +640,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } #endif +#if AS_USE_PHOTOS if (AS_AVAILABLE_IOS_TVOS(9, 10)) { // Likewise, if it's a Photos asset, we need to fetch it accordingly. if (ASPhotosFrameworkImageRequest *request = [ASPhotosFrameworkImageRequest requestWithURL:nextImageURL]) { @@ -644,6 +652,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent return; } } +#endif // Otherwise, it's a web URL that we can download. // First, check the cache. @@ -677,7 +686,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent }]; }]; } -#if TARGET_OS_IOS +#if TARGET_OS_IOS && AS_USE_ASSETS_LIBRARY - (void)_loadALAssetWithIdentifier:(id)imageIdentifier URL:(NSURL *)assetURL completion:(void (^)(UIImage *image, NSError *error))completionBlock { ASDisplayNodeAssertNotNil(imageIdentifier, @"imageIdentifier is required"); @@ -702,6 +711,8 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent #pragma clang diagnostic pop } #endif + +#if AS_USE_PHOTOS - (void)_loadPHAssetWithRequest:(ASPhotosFrameworkImageRequest *)request identifier:(id)imageIdentifier completion:(void (^)(UIImage *image, NSError *error))completionBlock { ASDisplayNodeAssertNotNil(imageIdentifier, @"imageIdentifier is required"); @@ -789,6 +800,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent _phImageRequestOperation = newImageRequestOp; [phImageRequestQueue addOperation:newImageRequestOp]; } +#endif - (void)_fetchImageWithIdentifierFromCache:(id)imageIdentifier URL:(NSURL *)imageURL completion:(void (^)(UIImage *image))completionBlock { @@ -892,6 +904,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent @end +#if AS_USE_PHOTOS @implementation NSURL (ASPhotosFrameworkURLs) + (NSURL *)URLWithAssetLocalIdentifier:(NSString *)assetLocalIdentifier targetSize:(CGSize)targetSize contentMode:(PHImageContentMode)contentMode options:(PHImageRequestOptions *)options NS_RETURNS_RETAINED @@ -904,3 +917,4 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent } @end +#endif diff --git a/Source/Base/ASAvailability.h b/Source/Base/ASAvailability.h index 3cb4862f9c..32efcbc0bf 100644 --- a/Source/Base/ASAvailability.h +++ b/Source/Base/ASAvailability.h @@ -25,6 +25,18 @@ #define AS_TLS_AVAILABLE 1 #endif +#ifndef AS_USE_PHOTOS +# define AS_USE_PHOTOS 0 +#endif + +#ifndef AS_USE_MAPKIT +# define AS_USE_MAPKIT 0 +#endif + +#ifndef AS_USE_ASSETS_LIBRARY +# define AS_USE_ASSETS_LIBRARY 0 +#endif + #ifndef kCFCoreFoundationVersionNumber_iOS_10_0 #define kCFCoreFoundationVersionNumber_iOS_10_0 1348.00 #endif diff --git a/Source/Details/ASPhotosFrameworkImageRequest.h b/Source/Details/ASPhotosFrameworkImageRequest.h index d119922337..869f5e8102 100644 --- a/Source/Details/ASPhotosFrameworkImageRequest.h +++ b/Source/Details/ASPhotosFrameworkImageRequest.h @@ -15,6 +15,10 @@ // http://www.apache.org/licenses/LICENSE-2.0 // +#import + +#if AS_USE_PHOTOS + #import #import #import @@ -73,3 +77,5 @@ API_AVAILABLE(ios(8.0), tvos(10.0)) @end NS_ASSUME_NONNULL_END + +#endif // AS_USE_PHOTOS diff --git a/Source/Details/ASPhotosFrameworkImageRequest.m b/Source/Details/ASPhotosFrameworkImageRequest.m index 14028ccb66..35487d535e 100644 --- a/Source/Details/ASPhotosFrameworkImageRequest.m +++ b/Source/Details/ASPhotosFrameworkImageRequest.m @@ -16,6 +16,9 @@ // #import + +#if AS_USE_PHOTOS + #import NSString *const ASPhotosURLScheme = @"ph"; @@ -160,3 +163,5 @@ static NSString *const _ASPhotosURLQueryKeyCropHeight = @"crop_h"; } @end + +#endif // AS_USE_PHOTOS diff --git a/Texture.podspec b/Texture.podspec index 6b87ba1465..c8a5f2be30 100644 --- a/Texture.podspec +++ b/Texture.podspec @@ -11,55 +11,71 @@ Pod::Spec.new do |spec| spec.documentation_url = 'http://texturegroup.org/appledoc/' - spec.ios.weak_frameworks = 'AssetsLibrary' - spec.weak_frameworks = 'Photos','MapKit' - spec.ios.deployment_target = '9.0' spec.tvos.deployment_target = '9.0' # Subspecs spec.subspec 'Core' do |core| core.public_header_files = [ - 'Source/*.h', - 'Source/Details/**/*.h', - 'Source/Layout/**/*.h', - 'Source/Base/*.h', - 'Source/Debug/**/*.h', - 'Source/TextKit/ASTextNodeTypes.h', - 'Source/TextKit/ASTextKitComponents.h' + 'Source/*.h', + 'Source/Details/**/*.h', + 'Source/Layout/**/*.h', + 'Source/Base/*.h', + 'Source/Debug/**/*.h', + 'Source/TextKit/ASTextNodeTypes.h', + 'Source/TextKit/ASTextKitComponents.h' ] core.source_files = [ - 'Source/**/*.{h,m,mm}', - 'Base/*.{h,m}', + 'Source/**/*.{h,m,mm}', + 'Base/*.{h,m}', - # Most TextKit components are not public because the C++ content - # in the headers will cause build errors when using - # `use_frameworks!` on 0.39.0 & Swift 2.1. - # See https://github.com/facebook/AsyncDisplayKit/issues/1153 - 'Source/TextKit/*.h', + # Most TextKit components are not public because the C++ content + # in the headers will cause build errors when using + # `use_frameworks!` on 0.39.0 & Swift 2.1. + # See https://github.com/facebook/AsyncDisplayKit/issues/1153 + 'Source/TextKit/*.h', ] end spec.subspec 'PINRemoteImage' do |pin| - pin.dependency 'PINRemoteImage/iOS', '= 3.0.0-beta.13' - pin.dependency 'PINRemoteImage/PINCache' - pin.dependency 'Texture/Core' + pin.dependency 'PINRemoteImage/iOS', '= 3.0.0-beta.13' + pin.dependency 'PINRemoteImage/PINCache' + pin.dependency 'Texture/Core' end spec.subspec 'IGListKit' do |igl| - igl.dependency 'IGListKit', '~> 3.0' - igl.dependency 'Texture/Core' + igl.dependency 'IGListKit', '~> 3.0' + igl.dependency 'Texture/Core' end spec.subspec 'Yoga' do |yoga| - yoga.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) YOGA=1' } - yoga.dependency 'Yoga', '1.6.0' - yoga.dependency 'Texture/Core' + yoga.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) YOGA=1' } + yoga.dependency 'Yoga', '1.6.0' + yoga.dependency 'Texture/Core' end - # Include optional PINRemoteImage module - spec.default_subspec = 'PINRemoteImage' + spec.subspec 'MapKit' do |map| + map.frameworks = 'MapKit' + map.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_MAPKIT=1' } + map.dependency 'Texture/Core' + end + + spec.subspec 'Photos' do |photos| + photos.frameworks = 'Photos' + photos.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_PHOTOS=1' } + photos.dependency 'Texture/Core' + end + + spec.subspec 'AssetsLibrary' do |assetslib| + assetslib.frameworks = 'AssetsLibrary' + assetslib.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_ASSETS_LIBRARY=1' } + assetslib.dependency 'Texture/Core' + end + + # Include these by default for backwards compatibility. + # This will change in 3.0. + spec.default_subspecs = 'PINRemoteImage', 'MapKit', 'AssetsLibrary', 'Photos' spec.social_media_url = 'https://twitter.com/TextureiOS' spec.library = 'c++' From 0b9f12716e47447ea8b39190aca81ec490ff86e5 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sun, 15 Jul 2018 18:41:23 -0700 Subject: [PATCH 26/97] Remove NSMutableArray for retaining sublayout elements (#1030) * Remove NSMutableArray for retaining sublayout elements * Kick the CI * Kick the CI again * Smash that CI button * Murder the CI --- CHANGELOG.md | 1 + Source/Layout/ASLayout.h | 10 ++---- Source/Layout/ASLayout.mm | 73 +++++++++++++++++---------------------- 3 files changed, 34 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cc17d1c4b..07365f00eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) - Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024) - Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler) +- Optimization: Removed an NSMutableArray in flattened layouts. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/Layout/ASLayout.h b/Source/Layout/ASLayout.h index 6e0841b3a2..5e8fe24cc9 100644 --- a/Source/Layout/ASLayout.h +++ b/Source/Layout/ASLayout.h @@ -149,15 +149,9 @@ AS_EXTERN ASLayout *ASCalculateLayout(idlayoutElement, const AS /** * Set to YES to tell all ASLayout instances to retain their sublayout elements. Defaults to NO. - * Can be overridden at instance level. + * See `-retainSublayoutElements` to control this per-instance. */ -+ (void)setShouldRetainSublayoutLayoutElements:(BOOL)shouldRetain; - -/** - * Whether or not ASLayout instances should retain their sublayout elements. - * Can be overridden at instance level. - */ -+ (BOOL)shouldRetainSublayoutLayoutElements; +@property (class) BOOL shouldRetainSublayoutElements; /** * Recrusively output the description of the layout tree. diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 4245159fbd..7ab43728aa 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -17,6 +17,7 @@ #import +#import #import #import @@ -59,17 +60,11 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsDisplayNodeType(ASLayo @interface ASLayout () { ASLayoutElementType _layoutElementType; + std::atomic_bool _retainSublayoutElements; } -/* - * Caches all sublayouts if set to YES or destroys the sublayout cache if set to NO. Defaults to NO - */ -@property (nonatomic) BOOL retainSublayoutLayoutElements; - -/** - * Array for explicitly retain sublayout layout elements in case they are created and references in layoutSpecThatFits: and no one else will hold a strong reference on it - */ -@property (nonatomic) NSMutableArray> *sublayoutLayoutElements; +/// Call this to keep sublayout elements alive. Multiple calls have no effect. +- (void)retainSublayoutElements; @property (nonatomic, readonly) ASRectMap *elementToRectMap; @@ -100,7 +95,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( self = [super init]; if (self) { -#if DEBUG +#if ASDISPLAYNODE_ASSERTIONS_ENABLED for (ASLayout *sublayout in sublayouts) { ASDisplayNodeAssert(ASPointIsNull(sublayout.position) == NO, @"Invalid position is not allowed in sublayout."); } @@ -112,7 +107,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( _layoutElementType = layoutElement.layoutElementType; if (!ASIsCGSizeValidForSize(size)) { - ASDisplayNodeAssert(NO, @"layoutSize is invalid and unsafe to provide to Core Animation! Release configurations will force to 0, 0. Size = %@, node = %@", NSStringFromCGSize(size), layoutElement); + ASDisplayNodeFailAssert(@"layoutSize is invalid and unsafe to provide to Core Animation! Release configurations will force to 0, 0. Size = %@, node = %@", NSStringFromCGSize(size), layoutElement); size = CGSizeZero; } else { size = CGSizeMake(ASCeilPixelValue(size.width), ASCeilPixelValue(size.height)); @@ -125,7 +120,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( _position = position; } - _sublayouts = sublayouts != nil ? [sublayouts copy] : @[]; + _sublayouts = [sublayouts copy] ?: @[]; if (_sublayouts.count > 0) { _elementToRectMap = [ASRectMap rectMapForWeakObjectPointers]; @@ -134,18 +129,14 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( } } - self.retainSublayoutLayoutElements = [ASLayout shouldRetainSublayoutLayoutElements]; + if ([ASLayout shouldRetainSublayoutLayoutElements]) { + [self retainSublayoutElements]; + } } return self; } -- (instancetype)init -{ - ASDisplayNodeAssert(NO, @"Use the designated initializer"); - return [self init]; -} - #pragma mark - Class Constructors + (instancetype)layoutWithLayoutElement:(id)layoutElement @@ -177,25 +168,25 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( sublayouts:nil]; } +- (void)dealloc +{ + if (_retainSublayoutElements.load()) { + for (ASLayout *sublayout in _sublayouts) { + CFRelease((__bridge CFTypeRef)sublayout); + } + } +} + #pragma mark - Sublayout Elements Caching -- (void)setRetainSublayoutLayoutElements:(BOOL)retainSublayoutLayoutElements +- (void)retainSublayoutElements { - if (_retainSublayoutLayoutElements != retainSublayoutLayoutElements) { - _retainSublayoutLayoutElements = retainSublayoutLayoutElements; - - if (retainSublayoutLayoutElements == NO) { - _sublayoutLayoutElements = nil; - } else { - // Add sublayouts layout elements to an internal array to retain it while the layout lives - NSUInteger sublayoutCount = _sublayouts.count; - if (sublayoutCount > 0) { - _sublayoutLayoutElements = [NSMutableArray arrayWithCapacity:sublayoutCount]; - for (ASLayout *sublayout in _sublayouts) { - [_sublayoutLayoutElements addObject:sublayout.layoutElement]; - } - } - } + if (_retainSublayoutElements.exchange(true)) { + return; + } + + for (ASLayout *sublayout in _sublayouts) { + CFRetain((__bridge CFTypeRef)sublayout->_layoutElement); } } @@ -220,9 +211,8 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( - (ASLayout *)filteredNodeLayoutTree NS_RETURNS_RETAINED { if ([self isFlattened]) { - // All flattened layouts must have this flag enabled - // to ensure sublayout elements are retained until the layouts are applied. - self.retainSublayoutLayoutElements = YES; + // All flattened layouts must retain sublayout elements until they are applied. + [self retainSublayoutElements]; return self; } @@ -273,9 +263,8 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( // flattenedSublayouts is now all nils. ASLayout *layout = [ASLayout layoutWithLayoutElement:_layoutElement size:_size sublayouts:array]; - // All flattened layouts must have this flag enabled - // to ensure sublayout elements are retained until the layouts are applied. - layout.retainSublayoutLayoutElements = YES; + // All flattened layouts must retain sublayout elements until they are applied. + [layout retainSublayoutElements]; return layout; } @@ -387,7 +376,7 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( ASLayout *ASCalculateLayout(id layoutElement, const ASSizeRange sizeRange, const CGSize parentSize) { - ASDisplayNodeCAssertNotNil(layoutElement, @"Not valid layoutElement passed in."); + NSCParameterAssert(layoutElement != nil); return [layoutElement layoutThatFits:sizeRange parentSize:parentSize]; } From f2912ecb4805d77359c73c5be418736ae76f6ffd Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sun, 15 Jul 2018 19:57:12 -0700 Subject: [PATCH 27/97] Update lock-checking flag logic (#1032) --- Source/Details/ASThread.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index 362f96c5bc..3ebf40654b 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -106,7 +106,7 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) #define TIME_LOCKER 0 /** * Enable this flag to collect information on the owning thread and ownership level of a mutex. - * These properties are useful to determine if a mutext has been acquired and in case of a recursive mutex, how many times that happened. + * These properties are useful to determine if a mutex has been acquired and in case of a recursive mutex, how many times that happened. * * This flag also enable locking assertions (e.g ASAssertUnlocked(node)). * The assertions are useful when you want to indicate and enforce the locking policy/expectation of methods. @@ -114,7 +114,11 @@ ASDISPLAYNODE_INLINE void _ASUnlockScopeCleanup(id __strong *lockPtr) * put breakpoints at some assertions. When the breakpoints hit, walk through stack trace frames * and check ownership count of the mutex. */ +#if ASDISPLAYNODE_ASSERTIONS_ENABLED #define CHECK_LOCKING_SAFETY 1 +#else +#define CHECK_LOCKING_SAFETY 0 +#endif #if TIME_LOCKER #import From 6ed5ba29f8d1600a632ddd5a9d901b72888b1c93 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Mon, 16 Jul 2018 09:38:12 -0700 Subject: [PATCH 28/97] Turn off exceptions to reduce binary size (-600KB for arm64) (#1033) * Turn off exceptions to reduce binary size * Changelog --- AsyncDisplayKit.xcodeproj/project.pbxproj | 18 +++++++++++++++--- BUCK | 2 ++ CHANGELOG.md | 1 + Source/ASDisplayNodeExtras.h | 2 +- Texture.podspec | 1 + 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 5aad7bb9ed..bcc1796536 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -2738,7 +2738,11 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_CFLAGS = "-Wundef"; + OTHER_CFLAGS = ( + "-Wundef", + "-fno-exceptions", + "-fno-objc-arc-exceptions", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; SKIP_INSTALL = YES; @@ -2767,7 +2771,11 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "-Wundef"; + OTHER_CFLAGS = ( + "-Wundef", + "-fno-exceptions", + "-fno-objc-arc-exceptions", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; SKIP_INSTALL = YES; @@ -2881,7 +2889,11 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = Source/AsyncDisplayKit.modulemap; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_CFLAGS = "-Wundef"; + OTHER_CFLAGS = ( + "-Wundef", + "-fno-exceptions", + "-fno-objc-arc-exceptions", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; SKIP_INSTALL = YES; diff --git a/BUCK b/BUCK index 2527c2f053..9a3ad37a7b 100755 --- a/BUCK +++ b/BUCK @@ -4,6 +4,8 @@ COMMON_PREPROCESSOR_FLAGS = [ '-fobjc-arc', '-DDEBUG=1', + '-fno-exceptions', + '-fno-objc-arc-exceptions' ] COMMON_LANG_PREPROCESSOR_FLAGS = { diff --git a/CHANGELOG.md b/CHANGELOG.md index 07365f00eb..6c132eba59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024) - Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler) - Optimization: Removed an NSMutableArray in flattened layouts. [Adlai Holler](https://github.com/Adlai-Holler) +- Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNodeExtras.h b/Source/ASDisplayNodeExtras.h index 9a8c2cd0c0..aa3fcbe57a 100644 --- a/Source/ASDisplayNodeExtras.h +++ b/Source/ASDisplayNodeExtras.h @@ -30,7 +30,7 @@ #define ASSetDebugName(node, format, ...) node.debugName = [NSString stringWithFormat:format, __VA_ARGS__] #define ASSetDebugNames(...) _ASSetDebugNames(self.class, @"" # __VA_ARGS__, __VA_ARGS__, nil) #else - #define ASSetDebugName(node, name) + #define ASSetDebugName(node, format, ...) #define ASSetDebugNames(...) #endif diff --git a/Texture.podspec b/Texture.podspec index c8a5f2be30..455cb080a5 100644 --- a/Texture.podspec +++ b/Texture.podspec @@ -16,6 +16,7 @@ Pod::Spec.new do |spec| # Subspecs spec.subspec 'Core' do |core| + core.compiler_flags = '-fno-exceptions -fno-objc-arc-exceptions' core.public_header_files = [ 'Source/*.h', 'Source/Details/**/*.h', From cf810acaa3e2f9adb8babac29645ae8ac3ed14f3 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Mon, 16 Jul 2018 20:43:58 -0700 Subject: [PATCH 29/97] Fix the bug I introduced in #1030 (#1035) --- Source/Layout/ASLayout.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 7ab43728aa..38b7fa3784 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -172,7 +172,10 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( { if (_retainSublayoutElements.load()) { for (ASLayout *sublayout in _sublayouts) { - CFRelease((__bridge CFTypeRef)sublayout); + // We retained this, so there's no risk of it deallocating on us. + if (let cfElement = (__bridge CFTypeRef)sublayout->_layoutElement) { + CFRelease(cfElement); + } } } } @@ -186,7 +189,8 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( } for (ASLayout *sublayout in _sublayouts) { - CFRetain((__bridge CFTypeRef)sublayout->_layoutElement); + // CFBridgingRetain atomically casts and retains. We need the atomicity. + CFBridgingRetain(sublayout->_layoutElement); } } From cf78dc6d8487b32881f6272cfb3b2160eaf34370 Mon Sep 17 00:00:00 2001 From: Andrew Yates Date: Tue, 17 Jul 2018 19:03:51 -0700 Subject: [PATCH 30/97] Fix & update ASCollectionNode constrained size doc. (#1037) --- docs/_docs/containers-ascollectionnode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/containers-ascollectionnode.md b/docs/_docs/containers-ascollectionnode.md index e59771e61a..780e5c3ad9 100755 --- a/docs/_docs/containers-ascollectionnode.md +++ b/docs/_docs/containers-ascollectionnode.md @@ -204,7 +204,7 @@ As discussed in the previous section Right now, cells will grow to fit their constrained size and will be laid out by whatever `UICollectionViewLayout` you provide. -Soon, there will be a method such as `ASTableNode`'s `-constrainedSizeForRow:` but at the moment, if you'd like to constrain the size of a cell used in a collection node, you need to wrap your layoutSpec object in an `ASStaticLayoutSpec` and provide it with a +You can also constrain cells used in a collection node using `ASCollectionNode`'s `-constrainedSizeForItemAtIndexPath:`. ### Examples @@ -225,4 +225,4 @@ The most detailed example of laying out the cells of an `ASCollectionNode` is th Note that these UIKit cells will **not** have the performance benefits of `ASCellNodes` (like preloading, async layout, and async drawing), even when mixed within the same `ASCollectionNode`. -However, this interoperability allows developers the flexibility to test out the framework without needing to convert all of their cells at once. Read more here. \ No newline at end of file +However, this interoperability allows developers the flexibility to test out the framework without needing to convert all of their cells at once. Read more here. From 9958aac5de65ad0d009a305798aff7a9a3a4963a Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 17 Jul 2018 19:51:05 -0700 Subject: [PATCH 31/97] Pin OCMock version to 3.4.1 because 3.4.2 has issues (#1038) --- .gitignore | 2 -- Podfile | 2 +- Podfile.lock | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 Podfile.lock diff --git a/.gitignore b/.gitignore index adb7e5eecc..d30811860a 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,6 @@ build *.swp -*.lock - *.gcov *.gcno *.gcda diff --git a/Podfile b/Podfile index 21e72482c1..dfb2350e8f 100644 --- a/Podfile +++ b/Podfile @@ -3,7 +3,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.0' target :'AsyncDisplayKitTests' do - pod 'OCMock', '~> 3.4' + pod 'OCMock', '=3.4.1' # 3.4.2 currently has issues. pod 'FBSnapshotTestCase/Core', '~> 2.1' pod 'JGMethodSwizzler', :git => 'https://github.com/JonasGessner/JGMethodSwizzler', :branch => 'master' diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000000..a0caeb263e --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,62 @@ +PODS: + - FBSnapshotTestCase/Core (2.1.4) + - FLAnimatedImage (1.0.12) + - JGMethodSwizzler (2.0.1) + - OCMock (3.4.1) + - PINCache (3.0.1-beta.6): + - PINCache/Arc-exception-safe (= 3.0.1-beta.6) + - PINCache/Core (= 3.0.1-beta.6) + - PINCache/Arc-exception-safe (3.0.1-beta.6): + - PINCache/Core + - PINCache/Core (3.0.1-beta.6): + - PINOperation (~> 1.1.0) + - PINOperation (1.1.1) + - PINRemoteImage (3.0.0-beta.13): + - PINRemoteImage/FLAnimatedImage (= 3.0.0-beta.13) + - PINRemoteImage/PINCache (= 3.0.0-beta.13) + - PINRemoteImage/Core (3.0.0-beta.13): + - PINOperation + - PINRemoteImage/FLAnimatedImage (3.0.0-beta.13): + - FLAnimatedImage (>= 1.0) + - PINRemoteImage/Core + - PINRemoteImage/PINCache (3.0.0-beta.13): + - PINCache (= 3.0.1-beta.6) + - PINRemoteImage/Core + +DEPENDENCIES: + - FBSnapshotTestCase/Core (~> 2.1) + - JGMethodSwizzler (from `https://github.com/JonasGessner/JGMethodSwizzler`, branch `master`) + - OCMock (= 3.4.1) + - PINRemoteImage (= 3.0.0-beta.13) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - FBSnapshotTestCase + - FLAnimatedImage + - OCMock + - PINCache + - PINOperation + - PINRemoteImage + +EXTERNAL SOURCES: + JGMethodSwizzler: + :branch: master + :git: https://github.com/JonasGessner/JGMethodSwizzler + +CHECKOUT OPTIONS: + JGMethodSwizzler: + :commit: 8791eccc5342224bd293b5867348657e3a240c7f + :git: https://github.com/JonasGessner/JGMethodSwizzler + +SPEC CHECKSUMS: + FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a + FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31 + JGMethodSwizzler: 7328146117fffa8a4038c42eb7cd3d4c75006f97 + OCMock: 2cd0716969bab32a2283ff3a46fd26a8c8b4c5e3 + PINCache: d195fdba255283f7e9900a55e3cced377f431f9b + PINOperation: a6219e6fc9db9c269eb7a7b871ac193bcf400aac + PINRemoteImage: d6d51c5d2adda55f1ce30c96e850b6c4ebd2856a + +PODFILE CHECKSUM: 42715d61f73cc22cc116bf80d7b268cb1f9e4742 + +COCOAPODS: 1.5.3 From db0f51581234343910fec5dc603e83a89a4429fc Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 17 Jul 2018 21:08:29 -0700 Subject: [PATCH 32/97] Revert unreleased layout debug method name change from #1030 #trivial (#1039) * Revert unreleased layout debugging method name change from #1030 #trivial * Eh make less changes --- Source/Layout/ASLayout.h | 6 ++++-- Source/Layout/ASLayout.mm | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Layout/ASLayout.h b/Source/Layout/ASLayout.h index 5e8fe24cc9..1a867c7330 100644 --- a/Source/Layout/ASLayout.h +++ b/Source/Layout/ASLayout.h @@ -149,9 +149,11 @@ AS_EXTERN ASLayout *ASCalculateLayout(idlayoutElement, const AS /** * Set to YES to tell all ASLayout instances to retain their sublayout elements. Defaults to NO. - * See `-retainSublayoutElements` to control this per-instance. + * See `-retainSublayoutLayoutElements` to control this per-instance. + * + * Note: Weaver relies on this API. */ -@property (class) BOOL shouldRetainSublayoutElements; +@property (class) BOOL shouldRetainSublayoutLayoutElements; /** * Recrusively output the description of the layout tree. diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 38b7fa3784..21c94fb114 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -63,9 +63,6 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsDisplayNodeType(ASLayo std::atomic_bool _retainSublayoutElements; } -/// Call this to keep sublayout elements alive. Multiple calls have no effect. -- (void)retainSublayoutElements; - @property (nonatomic, readonly) ASRectMap *elementToRectMap; @end From b1f6030e86eac252b0b61a6a8560daa60aefe820 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 18 Jul 2018 02:56:37 -0700 Subject: [PATCH 33/97] Create and set delegate for clip corner layers within ASDisplayNode (#1029) * Create and use ASDisplayNodeCornerLayerDelegate * Return kCFNull for actionForLayer:forKey: --- AsyncDisplayKit.xcodeproj/project.pbxproj | 8 +++ CHANGELOG.md | 10 +-- Source/ASDisplayNode.h | 72 +++++++++---------- Source/ASDisplayNode.mm | 16 +++-- .../ASDisplayNodeCornerLayerDelegate.h | 21 ++++++ .../ASDisplayNodeCornerLayerDelegate.m | 27 +++++++ Source/Private/ASDisplayNodeInternal.h | 4 +- Tests/ASDisplayNodeTests.mm | 18 +++++ 8 files changed, 130 insertions(+), 46 deletions(-) create mode 100644 Source/Private/ASDisplayNodeCornerLayerDelegate.h create mode 100644 Source/Private/ASDisplayNodeCornerLayerDelegate.m diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index bcc1796536..3c66687060 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -134,6 +134,8 @@ 6900C5F41E8072DA00BCD75C /* ASImageNode+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 6900C5F31E8072DA00BCD75C /* ASImageNode+Private.h */; }; 6907C2581DC4ECFE00374C66 /* ASObjectDescriptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = 6907C2561DC4ECFE00374C66 /* ASObjectDescriptionHelpers.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6907C25A1DC4ECFE00374C66 /* ASObjectDescriptionHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 6907C2571DC4ECFE00374C66 /* ASObjectDescriptionHelpers.m */; }; + 690BC8C120F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 690BC8BF20F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 690BC8C220F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 690BC8C020F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m */; }; 690C35621E055C5D00069B91 /* ASDimensionInternal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 690C35601E055C5D00069B91 /* ASDimensionInternal.mm */; }; 690C35641E055C7B00069B91 /* ASDimensionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 690C35631E055C7B00069B91 /* ASDimensionInternal.h */; settings = {ATTRIBUTES = (Public, ); }; }; 690ED58E1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 690ED58D1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -691,6 +693,8 @@ 6900C5F31E8072DA00BCD75C /* ASImageNode+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASImageNode+Private.h"; sourceTree = ""; }; 6907C2561DC4ECFE00374C66 /* ASObjectDescriptionHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASObjectDescriptionHelpers.h; sourceTree = ""; }; 6907C2571DC4ECFE00374C66 /* ASObjectDescriptionHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASObjectDescriptionHelpers.m; sourceTree = ""; }; + 690BC8BF20F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASDisplayNodeCornerLayerDelegate.h; sourceTree = ""; }; + 690BC8C020F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASDisplayNodeCornerLayerDelegate.m; sourceTree = ""; }; 690C35601E055C5D00069B91 /* ASDimensionInternal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDimensionInternal.mm; sourceTree = ""; }; 690C35631E055C7B00069B91 /* ASDimensionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDimensionInternal.h; sourceTree = ""; }; 690ED58D1E36BCA6000627C0 /* ASLayoutElementStylePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutElementStylePrivate.h; sourceTree = ""; }; @@ -1483,6 +1487,8 @@ 058D0A0A195D050800B7D73C /* ASDisplayNode+DebugTiming.mm */, DE6EA3211C14000600183B10 /* ASDisplayNode+FrameworkPrivate.h */, 058D0A0B195D050800B7D73C /* ASDisplayNode+UIViewBridge.mm */, + 690BC8BF20F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.h */, + 690BC8C020F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m */, 058D0A0C195D050800B7D73C /* ASDisplayNodeInternal.h */, 6959433D1D70815300B0EE1F /* ASDisplayNodeLayout.h */, 6959433C1D70815300B0EE1F /* ASDisplayNodeLayout.mm */, @@ -1929,6 +1935,7 @@ 254C6B7E1BF94DF4003EC431 /* ASTextKitTailTruncater.h in Headers */, B35062491B010EFD0018CF92 /* _ASCoreAnimationExtras.h in Headers */, 683F563720E409D700CEB7A3 /* ASDisplayNode+InterfaceState.h in Headers */, + 690BC8C120F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.h in Headers */, 68EE0DBE1C1B4ED300BA1B99 /* ASMainSerialQueue.h in Headers */, CCCCCCE11EC3EF060087FE10 /* ASTextUtilities.h in Headers */, B350624B1B010EFD0018CF92 /* _ASPendingState.h in Headers */, @@ -2434,6 +2441,7 @@ 68355B401CB57A69001D4E68 /* ASImageContainerProtocolCategories.m in Sources */, E5855DEF1EBB4D83003639AE /* ASCollectionLayoutDefines.m in Sources */, B35062031B010EFD0018CF92 /* ASImageNode.mm in Sources */, + 690BC8C220F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m in Sources */, 254C6B821BF94F8A003EC431 /* ASTextKitComponents.mm in Sources */, 34EFC7601B701C8B00AD841F /* ASInsetLayoutSpec.mm in Sources */, AC6145441D8AFD4F003D62A2 /* ASSection.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c132eba59..c952ef8698 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,20 +15,21 @@ - Optimize layout flattening, particularly reducing retain/release operations. [Adlai Holler](https://github.com/Adlai-Holler) - Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) - Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) -- Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) -- [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) +- Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) +- [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) - Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) - Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) - Enable locking assertions (and add some more) to improve and enforce locking safety within the framework [Huy Nguyen](https://github.com/nguyenhuy) [#1024](https://github.com/TextureGroup/Texture/pull/1024) - Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler) - Optimization: Removed an NSMutableArray in flattened layouts. [Adlai Holler](https://github.com/Adlai-Holler) - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) +- Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1024](https://github.com/TextureGroup/Texture/pull/1029) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) - [ASTextNode2] Upgrade lock safety by protecting all ivars (including rarely-changed ones). - User FLT_EPSILON in ASCeilPixelValue and ASFloorPixelValue to help with floating point precision errors when computing layouts for 3x devices. [Ricky Cancro](https://github.com/rcancro) [#838](https://github.com/TextureGroup/Texture/pull/864) -- Disable interface colescing and match to pre-colescing interface update behavior [Max Wang](https://github.com/wsdwsd0829) [#862](https://github.com/TextureGroup/Texture/pull/862) +- Disable interface colescing and match to pre-colescing interface update behavior [Max Wang](https://github.com/wsdwsd0829) [#862](https://github.com/TextureGroup/Texture/pull/862) - [ASDisplayNode] Add safeAreaInsets, layoutMargins and related properties to ASDisplayNode, with full support for older OS versions [Yevgen Pogribnyi](https://github.com/ypogribnyi) [#685](https://github.com/TextureGroup/Texture/pull/685) - [ASPINRemoteImageDownloader] Allow cache to provide animated image. [Max Wang](https://github.com/wsdwsd0829) [#850](https://github.com/TextureGroup/Texture/pull/850) - [tvOS] Fixes errors when building against tvOS SDK [Alex Hill](https://github.com/alexhillc) [#728](https://github.com/TextureGroup/Texture/pull/728) @@ -63,7 +64,8 @@ - Optimized ASNetworkImageNode loading and resolved edge cases where the image provided to the delegate was not the image that was loaded. [Adlai Holler](https://github.com/Adlai-Holler) [#778](https://github.com/TextureGroup/Texture/pull/778/) - Make `ASCellNode` tint color apply to table view cell accessories. [Vladyslav Chapaev](https://github.com/ShogunPhyched) [#764](https://github.com/TextureGroup/Texture/pull/764) - Fix ASTextNode2 is accessing backgroundColor off main while sizing / layout is happening. [Michael Schneider](https://github.com/maicki) [#794](https://github.com/TextureGroup/Texture/pull/778/) -- Pass scrollViewWillEndDragging delegation through in ASIGListAdapterDataSource for IGListKit integration. [#796](https://github.com/TextureGroup/Texture/pull/796) +- Pass scrollViewWillEndDragging delegation through in ASIGListAdapterDataSource for IGListKit integration. [#796](https://github.com/TextureGro +- up/Texture/pull/796) - Fix UIResponder handling with view backing ASDisplayNode. [Michael Schneider](https://github.com/maicki) [#789](https://github.com/TextureGroup/Texture/pull/789/) - Optimized thread-local storage by replacing pthread_specific with C11 thread-local variables. [Adlai Holler](https://github.com/Adlai-Holler) [#811](https://github.com/TextureGroup/Texture/pull/811/) - Fixed a thread-sanitizer warning in ASTextNode. [Adlai Holler](https://github.com/Adlai-Holler) [#830](https://github.com/TextureGroup/Texture/pull/830/) diff --git a/Source/ASDisplayNode.h b/Source/ASDisplayNode.h index dbe641e9b5..9eb64cbb84 100644 --- a/Source/ASDisplayNode.h +++ b/Source/ASDisplayNode.h @@ -624,10 +624,10 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; */ - (void)layoutIfNeeded; -@property CGRect frame; // default=CGRectZero -@property CGRect bounds; // default=CGRectZero -@property CGPoint position; // default=CGPointZero -@property CGFloat alpha; // default=1.0f +@property CGRect frame; // default=CGRectZero +@property CGRect bounds; // default=CGRectZero +@property CGPoint position; // default=CGPointZero +@property CGFloat alpha; // default=1.0f /* @abstract Sets the corner rounding method to use on the ASDisplayNode. * There are three types of corner rounding provided by Texture: CALayer, Precomposited, and Clipping. @@ -651,7 +651,7 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; * * @default ASCornerRoundingTypeDefaultSlowCALayer */ -@property ASCornerRoundingType cornerRoundingType; // default=Slow CALayer .cornerRadius (offscreen rendering) +@property ASCornerRoundingType cornerRoundingType; // default=ASCornerRoundingTypeDefaultSlowCALayer .cornerRadius (offscreen rendering) /** @abstract The radius to use when rounding corners of the ASDisplayNode. * @@ -660,24 +660,24 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; */ @property CGFloat cornerRadius; // default=0.0 -@property BOOL clipsToBounds; // default==NO -@property (getter=isHidden) BOOL hidden; // default==NO -@property (getter=isOpaque) BOOL opaque; // default==YES +@property BOOL clipsToBounds; // default==NO +@property (getter=isHidden) BOOL hidden; // default==NO +@property (getter=isOpaque) BOOL opaque; // default==YES -@property (nullable) id contents; // default=nil -@property CGRect contentsRect; // default={0,0,1,1}. @see CALayer.h for details. -@property CGRect contentsCenter; // default={0,0,1,1}. @see CALayer.h for details. -@property CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for details. -@property CGFloat rasterizationScale; // default=1.0f. +@property (nullable) id contents; // default=nil +@property CGRect contentsRect; // default={0,0,1,1}. @see CALayer.h for details. +@property CGRect contentsCenter; // default={0,0,1,1}. @see CALayer.h for details. +@property CGFloat contentsScale; // default=1.0f. See @contentsScaleForDisplay for details. +@property CGFloat rasterizationScale; // default=1.0f. -@property CGPoint anchorPoint; // default={0.5, 0.5} -@property CGFloat zPosition; // default=0.0 -@property CATransform3D transform; // default=CATransform3DIdentity -@property CATransform3D subnodeTransform; // default=CATransform3DIdentity +@property CGPoint anchorPoint; // default={0.5, 0.5} +@property CGFloat zPosition; // default=0.0 +@property CATransform3D transform; // default=CATransform3DIdentity +@property CATransform3D subnodeTransform; // default=CATransform3DIdentity @property (getter=isUserInteractionEnabled) BOOL userInteractionEnabled; // default=YES (NO for layer-backed nodes) #if TARGET_OS_IOS -@property (getter=isExclusiveTouch) BOOL exclusiveTouch; // default=NO +@property (getter=isExclusiveTouch) BOOL exclusiveTouch; // default=NO #endif /** @@ -686,10 +686,10 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; * @discussion In contrast to UIView, setting a transparent color will not set opaque = NO. * This only affects nodes that implement +drawRect like ASTextNode. */ -@property (nullable, copy) UIColor *backgroundColor; // default=nil +@property (nullable, copy) UIColor *backgroundColor; // default=nil -@property (null_resettable, copy) UIColor *tintColor; // default=Blue -- (void)tintColorDidChange; // Notifies the node when the tintColor has changed. +@property (null_resettable, copy) UIColor *tintColor; // default=Blue +- (void)tintColorDidChange; // Notifies the node when the tintColor has changed. /** * @abstract A flag used to determine how a node lays out its content when its bounds change. @@ -699,24 +699,24 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; * Thus, UIViewContentModeRedraw is not allowed; use needsDisplayOnBoundsChange = YES instead, and pick an appropriate * contentMode for your content while it's being re-rendered. */ -@property UIViewContentMode contentMode; // default=UIViewContentModeScaleToFill -@property (copy) NSString *contentsGravity; // Use .contentMode in preference when possible. -@property UISemanticContentAttribute semanticContentAttribute; +@property UIViewContentMode contentMode; // default=UIViewContentModeScaleToFill +@property (copy) NSString *contentsGravity; // Use .contentMode in preference when possible. +@property UISemanticContentAttribute semanticContentAttribute; -@property (nullable) CGColorRef shadowColor; // default=opaque rgb black -@property CGFloat shadowOpacity; // default=0.0 -@property CGSize shadowOffset; // default=(0, -3) -@property CGFloat shadowRadius; // default=3 -@property CGFloat borderWidth; // default=0 -@property (nullable) CGColorRef borderColor; // default=opaque rgb black +@property (nullable) CGColorRef shadowColor; // default=opaque rgb black +@property CGFloat shadowOpacity; // default=0.0 +@property CGSize shadowOffset; // default=(0, -3) +@property CGFloat shadowRadius; // default=3 +@property CGFloat borderWidth; // default=0 +@property (nullable) CGColorRef borderColor; // default=opaque rgb black -@property BOOL allowsGroupOpacity; -@property BOOL allowsEdgeAntialiasing; -@property unsigned int edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask +@property BOOL allowsGroupOpacity; +@property BOOL allowsEdgeAntialiasing; +@property unsigned int edgeAntialiasingMask; // default==all values from CAEdgeAntialiasingMask -@property BOOL needsDisplayOnBoundsChange; // default==NO -@property BOOL autoresizesSubviews; // default==YES (undefined for layer-backed nodes) -@property UIViewAutoresizing autoresizingMask; // default==UIViewAutoresizingNone (undefined for layer-backed nodes) +@property BOOL needsDisplayOnBoundsChange; // default==NO +@property BOOL autoresizesSubviews; // default==YES (undefined for layer-backed nodes) +@property UIViewAutoresizing autoresizingMask; // default==UIViewAutoresizingNone (undefined for layer-backed nodes) /** * @abstract Content margins diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 6272fa018f..347d41c42c 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -35,6 +35,7 @@ #import #import #import +#import #import #import #import @@ -1642,7 +1643,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) } CGSize boundsSize = self.bounds.size; - for (int idx = 0; idx < 4; idx++) { + for (int idx = 0; idx < NUM_CLIP_CORNER_LAYERS; idx++) { BOOL isTop = (idx == 0 || idx == 1); BOOL isRight = (idx == 1 || idx == 2); if (_clipCornerLayers[idx]) { @@ -1656,7 +1657,7 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) - (void)_updateClipCornerLayerContentsWithRadius:(CGFloat)radius backgroundColor:(UIColor *)backgroundColor { ASPerformBlockOnMainThread(^{ - for (int idx = 0; idx < 4; idx++) { + for (int idx = 0; idx < NUM_CLIP_CORNER_LAYERS; idx++) { // Layers are, in order: Top Left, Top Right, Bottom Right, Bottom Left. // anchorPoint is Bottom Left at 0,0 and Top Right at 1,1. BOOL isTop = (idx == 0 || idx == 1); @@ -1693,16 +1694,21 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) ASPerformBlockOnMainThread(^{ ASDisplayNodeAssertMainThread(); if (visible) { - for (int idx = 0; idx < 4; idx++) { + for (int idx = 0; idx < NUM_CLIP_CORNER_LAYERS; idx++) { if (_clipCornerLayers[idx] == nil) { + static ASDisplayNodeCornerLayerDelegate *clipCornerLayers; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + clipCornerLayers = [[ASDisplayNodeCornerLayerDelegate alloc] init]; + }); _clipCornerLayers[idx] = [[CALayer alloc] init]; _clipCornerLayers[idx].zPosition = 99999; - _clipCornerLayers[idx].delegate = self; + _clipCornerLayers[idx].delegate = clipCornerLayers; } } [self _updateClipCornerLayerContentsWithRadius:_cornerRadius backgroundColor:self.backgroundColor]; } else { - for (int idx = 0; idx < 4; idx++) { + for (int idx = 0; idx < NUM_CLIP_CORNER_LAYERS; idx++) { [_clipCornerLayers[idx] removeFromSuperlayer]; _clipCornerLayers[idx] = nil; } diff --git a/Source/Private/ASDisplayNodeCornerLayerDelegate.h b/Source/Private/ASDisplayNodeCornerLayerDelegate.h new file mode 100644 index 0000000000..f1f0fb9b35 --- /dev/null +++ b/Source/Private/ASDisplayNodeCornerLayerDelegate.h @@ -0,0 +1,21 @@ +// +// ASDisplayNodeCornerLayerDelegate.h +// 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 /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 + +@interface ASDisplayNodeCornerLayerDelegate : NSObject +@end diff --git a/Source/Private/ASDisplayNodeCornerLayerDelegate.m b/Source/Private/ASDisplayNodeCornerLayerDelegate.m new file mode 100644 index 0000000000..b01723dd47 --- /dev/null +++ b/Source/Private/ASDisplayNodeCornerLayerDelegate.m @@ -0,0 +1,27 @@ +// +// ASDisplayNodeCornerLayerDelegate.m +// 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 /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 "ASDisplayNodeCornerLayerDelegate.h" + +@implementation ASDisplayNodeCornerLayerDelegate + +- (id)actionForLayer:(CALayer *)layer forKey:(NSString *)event +{ + return (id)kCFNull; +} + +@end diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 4c668a3f3c..3c7c2e8875 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -81,6 +81,8 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest #define TIME_DISPLAYNODE_OPS 0 // If you're using this information frequently, try: (DEBUG || PROFILE) +#define NUM_CLIP_CORNER_LAYERS 4 + @interface ASDisplayNode () <_ASTransitionContextCompletionDelegate> { @package @@ -186,7 +188,7 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest CGFloat _cornerRadius; ASCornerRoundingType _cornerRoundingType; - CALayer *_clipCornerLayers[4]; + CALayer *_clipCornerLayers[NUM_CLIP_CORNER_LAYERS]; ASDisplayNodeContextModifier _willDisplayNodeContentWithRenderingContext; ASDisplayNodeContextModifier _didDisplayNodeContentWithRenderingContext; diff --git a/Tests/ASDisplayNodeTests.mm b/Tests/ASDisplayNodeTests.mm index ba7ee7b53e..55585eec91 100644 --- a/Tests/ASDisplayNodeTests.mm +++ b/Tests/ASDisplayNodeTests.mm @@ -26,6 +26,7 @@ #import #import #import +#import #import "ASDisplayNodeTestsHelper.h" #import #import @@ -184,6 +185,11 @@ for (ASDisplayNode *n in @[ nodes ]) {\ _displayWillStartCount++; } +- (CALayer *__strong (*)[NUM_CLIP_CORNER_LAYERS])clipCornerLayers +{ + return &self->_clipCornerLayers; +} + @end @interface ASSynchronousTestDisplayNodeViaViewClass : ASDisplayNode @@ -2688,4 +2694,16 @@ static bool stringContainsPointer(NSString *description, id p) { XCTAssertTrue([node isSynchronous], @"Node should be synchronous if viewClass is ovewritten and not a subclass of _ASDisplayView"); } +- (void)testCornerRoundingTypeClippingRoundedCornersIsUsingASDisplayNodeCornerLayerDelegate +{ + ASTestDisplayNode *node = [[ASTestDisplayNode alloc] init]; + node.cornerRoundingType = ASCornerRoundingTypeClipping; + node.cornerRadius = 10.0; + auto l = node.clipCornerLayers; + for (int i = 0; i < NUM_CLIP_CORNER_LAYERS; i++) { + CALayer *cornerLayer = (*l)[i]; + XCTAssertTrue([cornerLayer.delegate isKindOfClass:[ASDisplayNodeCornerLayerDelegate class]], @""); + } +} + @end From 736e2004077ddc12b32acb37e1b368fb42baa6aa Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 18 Jul 2018 02:57:35 -0700 Subject: [PATCH 34/97] Fix warning for ASLayout method override for the designated initializer of the superclass '-init' not found #trivial (#1036) * Fix warning for ASLayout method override for the designated initializer of the superclass '-init' not found * Move unavailable init into header --- Source/Layout/ASLayout.h | 6 ++---- Source/Private/ASLayoutTransition.h | 7 ++----- Source/Private/ASLayoutTransition.mm | 6 ------ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/Source/Layout/ASLayout.h b/Source/Layout/ASLayout.h index 1a867c7330..886756bb43 100644 --- a/Source/Layout/ASLayout.h +++ b/Source/Layout/ASLayout.h @@ -130,16 +130,14 @@ AS_EXTERN ASLayout *ASCalculateLayout(idlayoutElement, const AS */ + (instancetype)layoutWithLayoutElement:(id)layoutElement size:(CGSize)size NS_RETURNS_RETAINED AS_WARN_UNUSED_RESULT; + /** * Traverses the existing layout tree and generates a new tree that represents only ASDisplayNode layouts */ - (ASLayout *)filteredNodeLayoutTree NS_RETURNS_RETAINED AS_WARN_UNUSED_RESULT; -@end - -@interface ASLayout (Unavailable) - - (instancetype)init NS_UNAVAILABLE; +- (instancetype)new NS_UNAVAILABLE; @end diff --git a/Source/Private/ASLayoutTransition.h b/Source/Private/ASLayoutTransition.h index 1060a57d81..91007800d4 100644 --- a/Source/Private/ASLayoutTransition.h +++ b/Source/Private/ASLayoutTransition.h @@ -95,11 +95,8 @@ AS_SUBCLASSING_RESTRICTED */ - (void)applySubnodeRemovals; -@end - -@interface ASLayoutTransition (Unavailable) - -- (instancetype)init __unavailable; +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)new NS_UNAVAILABLE; @end diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index 77a8fdd7c1..4dcfb3757e 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -85,12 +85,6 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { return self; } -- (instancetype)init -{ - ASDisplayNodeAssert(NO, @"Use the designated initializer"); - return [self init]; -} - - (BOOL)isSynchronous { ASDN::MutexSharedLocker l(__instanceLock__); From 4b5b90f7a062bfe8fe8997c1c1859140f364816e Mon Sep 17 00:00:00 2001 From: Flatout73 Date: Sat, 21 Jul 2018 01:15:50 +0300 Subject: [PATCH 35/97] [ASTextNode] One more check variables before calling delegate method #trivial (#922) --- Source/ASTextNode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 3ffcfe569e..5d51adbffd 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -657,7 +657,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; } // Ask our delegate if a long-press on an attribute is relevant - if ([_delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:atPoint:)]) { + if ([self _pendingLinkTap] && [_delegate respondsToSelector:@selector(textNode:shouldLongPressLinkAttribute:value:atPoint:)]) { return [_delegate textNode:self shouldLongPressLinkAttribute:_highlightedLinkAttributeName value:_highlightedLinkAttributeValue From 5fef6a17a6c44d84865cc76e0ea7a863114cb026 Mon Sep 17 00:00:00 2001 From: Rasul Tataev <39275251+tataevr@users.noreply.github.com> Date: Sat, 21 Jul 2018 01:19:23 +0300 Subject: [PATCH 36/97] Changed lost images to existing one. (#981) New images taken from http://texturegroup.org/docs/automatic-layout-containers.html. --- docs/_docs/automatic-layout-containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_docs/automatic-layout-containers.md b/docs/_docs/automatic-layout-containers.md index 436d9c6efb..8bd56d205b 100755 --- a/docs/_docs/automatic-layout-containers.md +++ b/docs/_docs/automatic-layout-containers.md @@ -10,7 +10,7 @@ Texture includes a library of `layoutSpec` components that can be composed to de The **child(ren) of a layoutSpec may be a node, a layoutSpec or a combination of the two types.** In the below image, an `ASStackLayoutSpec` (vertical) containing a text node and an image node, is wrapped in another `ASStackLayoutSpec` (horizontal) with another text node. - + Both nodes and layoutSpecs conform to the `` protocol. Any `ASLayoutable` object may be the child of a layoutSpec. ASLayoutable properties may be applied to `ASLayoutable` objects to create complex UI designs. @@ -184,7 +184,7 @@ An overlay spec requires the underlay object (object to which the overlay item w An inset spec requires its object to have an intrinsic size. It adds the inset padding to this size to calculate the final size of the inset spec. - + ### Best Practices - Texture layout is called on a background thread. Do not access the device screen bounds, or any other UIKit methods in `layoutSpecThatFits:`. From d9d5b12475965b49232c899bbfc768a41f724e71 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Fri, 20 Jul 2018 15:27:28 -0700 Subject: [PATCH 37/97] Improve locking situation in ASVideoPlayerNode (#1042) * Improve locking in ASVideoPlayerNode * Address comments --- CHANGELOG.md | 4 +- Source/ASVideoPlayerNode.mm | 86 ++++++++++++++++++++++++++----------- 2 files changed, 63 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c952ef8698..e33d75febf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,9 @@ - Split MapKit, Photos, and AssetsLibrary dependent code into separate subspecs to improve binary size and start time when they're not needed. The default subspec includes all three for backwards compatibility, but this **will change in 3.0**. When using non-Cocoapods build environments, define `AS_USE_PHOTOS, AS_USE_MAPKIT, AS_USE_ASSETS_LIBRARY` to 1 respectively to signal their use. [Adlai Holler](https://github.com/Adlai-Holler) - Optimization: Removed an NSMutableArray in flattened layouts. [Adlai Holler](https://github.com/Adlai-Holler) - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) -- Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1024](https://github.com/TextureGroup/Texture/pull/1029) +- Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) +- Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) + ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASVideoPlayerNode.mm b/Source/ASVideoPlayerNode.mm index c864c10a94..0097f3d718 100644 --- a/Source/ASVideoPlayerNode.mm +++ b/Source/ASVideoPlayerNode.mm @@ -209,10 +209,8 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)didLoad { [super didLoad]; - { - ASLockScopeSelf(); - [self createControls]; - } + + [self createControls]; } - (void)didEnterPreloadState @@ -284,15 +282,23 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; if (_delegateFlags.delegateCustomControls && _delegateFlags.delegateLayoutSpecForControls) { NSDictionary *customControls = [_delegate videoPlayerNodeCustomControls:self]; + std::vector subnodes; for (id key in customControls) { id node = customControls[key]; if (![node isKindOfClass:[ASDisplayNode class]]) { continue; } - [self addSubnode:node]; + subnodes.push_back(node); [_cachedControls setObject:node forKey:key]; } + + { + ASUnlockScope(self); + for (var subnode : subnodes) { + [self addSubnode:subnode]; + } + } } } @@ -315,14 +321,21 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; - (void)removeControls { - for (ASDisplayNode *node in [_cachedControls objectEnumerator]) { - [node removeFromSupernode]; + NSMutableDictionary *cachedControls = nil; + { + ASLockScope(self); + + // Grab the cached controls for removing it + cachedControls = [_cachedControls copy]; + [self _locked_cleanCachedControls]; } - [self cleanCachedControls]; + for (ASDisplayNode *node in [cachedControls objectEnumerator]) { + [node removeFromSupernode]; + } } -- (void)cleanCachedControls +- (void)_locked_cleanCachedControls { [_cachedControls removeAllObjects]; @@ -355,7 +368,10 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; [_cachedControls setObject:_playbackButtonNode forKey:@(ASVideoPlayerNodeControlTypePlaybackButton)]; } - [self addSubnode:_playbackButtonNode]; + { + ASUnlockScope(self); + [self addSubnode:_playbackButtonNode]; + } } - (void)_locked_createFullScreenButton @@ -374,7 +390,10 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; [_cachedControls setObject:_fullScreenButtonNode forKey:@(ASVideoPlayerNodeControlTypeFullScreenButton)]; } - [self addSubnode:_fullScreenButtonNode]; + { + ASUnlockScope(self); + [self addSubnode:_fullScreenButtonNode]; + } } - (void)_locked_createElapsedTextField @@ -389,7 +408,10 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; [_cachedControls setObject:_elapsedTextNode forKey:@(ASVideoPlayerNodeControlTypeElapsedText)]; } - [self addSubnode:_elapsedTextNode]; + { + ASUnlockScope(self); + [self addSubnode:_elapsedTextNode]; + } } - (void)_locked_createDurationTextField @@ -405,7 +427,10 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; [_cachedControls setObject:_durationTextNode forKey:@(ASVideoPlayerNodeControlTypeDurationText)]; } [self updateDurationTimeLabel]; - [self addSubnode:_durationTextNode]; + { + ASUnlockScope(self); + [self addSubnode:_durationTextNode]; + } } - (void)_locked_createScrubber @@ -450,8 +475,10 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; [_cachedControls setObject:_scrubberNode forKey:@(ASVideoPlayerNodeControlTypeScrubber)]; } - - [self addSubnode:_scrubberNode]; + { + ASUnlockScope(self); + [self addSubnode:_scrubberNode]; + } } - (void)_locked_createControlFlexGrowSpacer @@ -623,7 +650,6 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; ASLockScopeSelf(); if (!_spinnerNode) { - __weak __typeof__(self) weakSelf = self; _spinnerNode = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{ __typeof__(self) strongSelf = weakSelf; @@ -642,24 +668,32 @@ static void *ASVideoPlayerNodeContext = &ASVideoPlayerNodeContext; return spinnnerView; }]; - _spinnerNode.style.preferredSize = CGSizeMake(44.0, 44.0); - - [self addSubnode:_spinnerNode]; - [self setNeedsLayout]; + + let spinnerNode = _spinnerNode; + { + ASUnlockScope(self); + [self addSubnode:spinnerNode]; + [self setNeedsLayout]; + } } [(UIActivityIndicatorView *)_spinnerNode.view startAnimating]; } - (void)removeSpinner { - ASLockScopeSelf(); - - if (!_spinnerNode) { - return; + ASDisplayNode *spinnerNode = nil; + { + ASLockScopeSelf(); + if (!_spinnerNode) { + return; + } + + spinnerNode = _spinnerNode; + _spinnerNode = nil; } - [_spinnerNode removeFromSupernode]; - _spinnerNode = nil; + + [spinnerNode removeFromSupernode]; } - (void)didTapPlaybackButton:(ASControlNode*)node From 1beeb9c5e6cc8e0044cf88586f5652a37b53a859 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 24 Jul 2018 09:13:23 -0700 Subject: [PATCH 38/97] Add a comment about tiling mode and issue #1046 (#1047) --- Source/Private/_ASCoreAnimationExtras.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Private/_ASCoreAnimationExtras.mm b/Source/Private/_ASCoreAnimationExtras.mm index e31d386692..48d3ee05e2 100644 --- a/Source/Private/_ASCoreAnimationExtras.mm +++ b/Source/Private/_ASCoreAnimationExtras.mm @@ -26,6 +26,11 @@ void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage * void ASDisplayNodeSetResizableContents(id obj, UIImage *image) { + // FIXME (https://github.com/TextureGroup/Texture/issues/1046): This method does not currently handle UIImageResizingModeTile, which is the default. + // See also https://developer.apple.com/documentation/uikit/uiimage/1624157-resizingmode?language=objc + // I'm not sure of a way to use CALayer directly to perform such tiling on the GPU, though the stretch is handled by the GPU, + // and CALayer.h documents the fact that contentsCenter is used to stretch the pixels. + if (image) { ASDisplayNodeCAssert(image.resizingMode == UIImageResizingModeStretch || UIEdgeInsetsEqualToEdgeInsets(image.capInsets, UIEdgeInsetsZero), @"Image insets must be all-zero or resizingMode has to be UIImageResizingModeStretch. XCode assets default value is UIImageResizingModeTile which is not supported by Texture because of GPU-accelerated CALayer features."); From b2eb58e9f2f277756873922eed8c7b7d972dd152 Mon Sep 17 00:00:00 2001 From: Kevin Date: Tue, 24 Jul 2018 09:15:31 -0700 Subject: [PATCH 39/97] Remove misleading comment and add assertion #trivial (#1027) --- Source/Private/ASLayoutTransition.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index 4dcfb3757e..a50e9eda8a 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -268,6 +268,7 @@ static inline std::vector findNodesInLayoutAtIndexes(ASLayout *layou /** * @abstract Stores the nodes at the given indexes in the `storedNodes` array, storing indexes in a `storedPositions` c++ vector. + * Call only with a flattened layout. * @discussion If the node exists in the `filteredNodes` array, the node is not added to `storedNodes`. */ static inline std::vector findNodesInLayoutAtIndexesWithFilteredNodes(ASLayout *layout, @@ -285,9 +286,9 @@ static inline std::vector findNodesInLayoutAtIndexesWithFilteredNode for (ASLayout *sublayout in layout.sublayouts) { if (idx > lastIndex) { break; } if (idx >= firstIndex && [indexes containsIndex:idx]) { - ASDisplayNode *node = (ASDisplayNode *) sublayout.layoutElement; + ASDisplayNode *node = (ASDisplayNode *)(sublayout.layoutElement); ASDisplayNodeCAssert(node, @"ASDisplayNode was deallocated before it was added to a subnode. It's likely the case that you use automatically manages subnodes and allocate a ASDisplayNode in layoutSpecThatFits: and don't have any strong reference to it."); - // Ignore the odd case in which a non-node sublayout is accessed and the type cast fails + ASDisplayNodeCAssert([node isKindOfClass:[ASDisplayNode class]], @"sublayout is an ASLayout, but not an ASDisplayNode - only call findNodesInLayoutAtIndexesWithFilteredNodes with a flattened layout (all sublayouts are ASDisplayNodes)."); if (node != nil) { BOOL notFiltered = (filteredNodes == nil || [filteredNodes indexOfObjectIdenticalTo:node] == NSNotFound); if (notFiltered) { From 95de2ab12614302de94c9aee569452f287d00cbd Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Tue, 24 Jul 2018 15:03:47 -0700 Subject: [PATCH 40/97] Avoid setting frame on the backing store while holding a node's lock (#1048) Doing so may trigger `-layer:didChangeBoundsWithOldValue:newValue:` on the layer's delegate (i.e `ASCALayerExtendedDelegate`) which then runs other operations that require the lock to be free. --- Source/Private/ASDisplayNode+UIViewBridge.mm | 118 ++++++++++--------- 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/Source/Private/ASDisplayNode+UIViewBridge.mm b/Source/Private/ASDisplayNode+UIViewBridge.mm index 55d9704677..4a597b0dce 100644 --- a/Source/Private/ASDisplayNode+UIViewBridge.mm +++ b/Source/Private/ASDisplayNode+UIViewBridge.mm @@ -296,70 +296,78 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo - (void)setFrame:(CGRect)rect { - _bridge_prologue_write; - - // For classes like ASTableNode, ASCollectionNode, ASScrollNode and similar - make sure UIView gets setFrame: - struct ASDisplayNodeFlags flags = _flags; - BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandling(checkFlag(Synchronous), flags.layerBacked); - - BOOL nodeLoaded = _loaded(self); + BOOL setToView = NO; + BOOL setToLayer = NO; + CGRect newBounds = CGRectZero; + CGPoint newPosition = CGPointZero; + BOOL nodeLoaded = NO; BOOL isMainThread = ASDisplayNodeThreadIsMain(); - if (!specialPropertiesHandling) { - BOOL canReadProperties = isMainThread || !nodeLoaded; - if (canReadProperties) { - // We don't have to set frame directly, and we can read current properties. - // Compute a new bounds and position and set them on self. - CALayer *layer = _layer; - BOOL useLayer = (layer != nil); - CGPoint origin = (useLayer ? layer.bounds.origin : self.bounds.origin); - CGPoint anchorPoint = (useLayer ? layer.anchorPoint : self.anchorPoint); + { + _bridge_prologue_write; - CGRect newBounds = CGRectZero; - CGPoint newPosition = CGPointZero; - ASBoundsAndPositionForFrame(rect, origin, anchorPoint, &newBounds, &newPosition); + // For classes like ASTableNode, ASCollectionNode, ASScrollNode and similar - make sure UIView gets setFrame: + struct ASDisplayNodeFlags flags = _flags; + BOOL specialPropertiesHandling = ASDisplayNodeNeedsSpecialPropertiesHandling(checkFlag(Synchronous), flags.layerBacked); - if (ASIsCGRectValidForLayout(newBounds) == NO || ASIsCGPositionValidForLayout(newPosition) == NO) { - ASDisplayNodeAssertNonFatal(NO, @"-[ASDisplayNode setFrame:] - The new frame (%@) is invalid and unsafe to be set.", NSStringFromCGRect(rect)); - return; - } - - if (useLayer) { - layer.bounds = newBounds; - layer.position = newPosition; + nodeLoaded = _loaded(self); + if (!specialPropertiesHandling) { + BOOL canReadProperties = isMainThread || !nodeLoaded; + if (canReadProperties) { + // We don't have to set frame directly, and we can read current properties. + // Compute a new bounds and position and set them on self. + CALayer *layer = _layer; + CGPoint origin = (nodeLoaded ? layer.bounds.origin : self.bounds.origin); + CGPoint anchorPoint = (nodeLoaded ? layer.anchorPoint : self.anchorPoint); + + ASBoundsAndPositionForFrame(rect, origin, anchorPoint, &newBounds, &newPosition); + + if (ASIsCGRectValidForLayout(newBounds) == NO || ASIsCGPositionValidForLayout(newPosition) == NO) { + ASDisplayNodeAssertNonFatal(NO, @"-[ASDisplayNode setFrame:] - The new frame (%@) is invalid and unsafe to be set.", NSStringFromCGRect(rect)); + return; + } + + if (nodeLoaded) { + setToLayer = YES; + } else { + self.bounds = newBounds; + self.position = newPosition; + } } else { - self.bounds = newBounds; - self.position = newPosition; + // We don't have to set frame directly, but we can't read properties. + // Store the frame in our pending state, and it'll get decomposed into + // bounds and position when the pending state is applied. + _ASPendingState *pendingState = ASDisplayNodeGetPendingState(self); + if (nodeLoaded && !pendingState.hasChanges) { + [[ASPendingStateController sharedInstance] registerNode:self]; + } + pendingState.frame = rect; } } else { - // We don't have to set frame directly, but we can't read properties. - // Store the frame in our pending state, and it'll get decomposed into - // bounds and position when the pending state is applied. - _ASPendingState *pendingState = ASDisplayNodeGetPendingState(self); - if (nodeLoaded && !pendingState.hasChanges) { - [[ASPendingStateController sharedInstance] registerNode:self]; + if (nodeLoaded && isMainThread) { + // We do have to set frame directly, and we're on main thread with a loaded node. + // Just set the frame on the view. + // NOTE: Frame is only defined when transform is identity because we explicitly diverge from CALayer behavior and define frame without transform. + setToView = YES; + } else { + // We do have to set frame directly, but either the node isn't loaded or we're on a non-main thread. + // Set the frame on the pending state, and it'll call setFrame: when applied. + _ASPendingState *pendingState = ASDisplayNodeGetPendingState(self); + if (nodeLoaded && !pendingState.hasChanges) { + [[ASPendingStateController sharedInstance] registerNode:self]; + } + pendingState.frame = rect; } - pendingState.frame = rect; - } - } else { - if (nodeLoaded && isMainThread) { - // We do have to set frame directly, and we're on main thread with a loaded node. - // Just set the frame on the view. - // NOTE: Frame is only defined when transform is identity because we explicitly diverge from CALayer behavior and define frame without transform. -//#if DEBUG -// // Checking if the transform is identity is expensive, so disable when unnecessary. We have assertions on in Release, so DEBUG is the only way I know of. -// ASDisplayNodeAssert(CATransform3DIsIdentity(self.transform), @"-[ASDisplayNode setFrame:] - self.transform must be identity in order to set the frame property. (From Apple's UIView documentation: If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.)"); -//#endif - _view.frame = rect; - } else { - // We do have to set frame directly, but either the node isn't loaded or we're on a non-main thread. - // Set the frame on the pending state, and it'll call setFrame: when applied. - _ASPendingState *pendingState = ASDisplayNodeGetPendingState(self); - if (nodeLoaded && !pendingState.hasChanges) { - [[ASPendingStateController sharedInstance] registerNode:self]; - } - pendingState.frame = rect; } } + + if (setToView) { + ASDisplayNodeAssertTrue(nodeLoaded && isMainThread); + _view.frame = rect; + } else if (setToLayer) { + ASDisplayNodeAssertTrue(nodeLoaded && isMainThread); + _layer.bounds = newBounds; + _layer.position = newPosition; + } } - (void)setNeedsDisplay From 905c582497b2e85736c4af672238f6e34a2a100d Mon Sep 17 00:00:00 2001 From: Max Wang Date: Tue, 24 Jul 2018 15:57:59 -0700 Subject: [PATCH 41/97] Background image load api (#1007) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * add api to allow delegated calls in background. * fix typo * 1. Add class property to decide whether to send delegate callbacks on main or background. 2. remove non-info api. * Refactor. * add ivar for class property. * Donot use extra api. * Refactor * refactor * revert to use let * refactor * make class property atomic. * kick of new ci test. * kick off new ci --- CHANGELOG.md | 1 + Source/ASNetworkImageNode.h | 11 ++++++++--- Source/ASNetworkImageNode.mm | 26 +++++++++++++++++++++----- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e33d75febf..90f87a2899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASNetworkImageNode] Allow delegate methods to be called on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1007](https://github.com/TextureGroup/Texture/pull/1007) - [ASLayoutTransition] Add support for preserving order after node moves during transitions. (This order defines the z-order as well.) [Kevin Smith](https://github.com/wiseoldduck) [#1006] - [ASDisplayNode] Adds support for multiple interface state delegates. [Garrett Moon](https://github.com/garrettmoon) [#979](https://github.com/TextureGroup/Texture/pull/979) - [ASDataController] Add capability to renew supplementary views (update map) when size change from zero to non-zero.[Max Wang](https://github.com/wsdwsd0829) [#842](https://github.com/TextureGroup/Texture/pull/842) diff --git a/Source/ASNetworkImageNode.h b/Source/ASNetworkImageNode.h index 494925b893..4722c88d20 100644 --- a/Source/ASNetworkImageNode.h +++ b/Source/ASNetworkImageNode.h @@ -56,6 +56,11 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nullable, weak) id delegate; +/** + * The delegate will receive callbacks on main thread. Default to YES. + */ +@property (class) BOOL useMainThreadDelegateCallbacks; + /** * The image to display. * @@ -156,7 +161,7 @@ NS_ASSUME_NONNULL_BEGIN * @param image The newly-loaded image. * @param info Additional information about the image load. * - * @discussion Called on a background queue. + * @discussion Called on the main thread if useMainThreadDelegateCallbacks=YES (the default), otherwise on a background thread. */ - (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image info:(ASNetworkImageLoadInfo *)info; @@ -166,7 +171,7 @@ NS_ASSUME_NONNULL_BEGIN * @param imageNode The sender. * @param image The newly-loaded image. * - * @discussion Called on a background queue. + * @discussion Called on the main thread if useMainThreadDelegateCallbacks=YES (the default), otherwise on a background thread. */ - (void)imageNode:(ASNetworkImageNode *)imageNode didLoadImage:(UIImage *)image; @@ -185,7 +190,7 @@ NS_ASSUME_NONNULL_BEGIN * @param imageNode The sender. * @param error The error with details. * - * @discussion Called on a background queue. + * @discussion Called on the main thread if useMainThreadDelegateCallbacks=YES (the default), otherwise on a background thread. */ - (void)imageNode:(ASNetworkImageNode *)imageNode didFailWithError:(NSError *)error; diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index cace5498e6..635d8ee87a 100755 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -86,6 +86,8 @@ @implementation ASNetworkImageNode +static std::atomic_bool _useMainThreadDelegateCallbacks(true); + @dynamic image; - (instancetype)initWithCache:(id)cache downloader:(id)downloader @@ -430,6 +432,16 @@ [self _lazilyLoadImageIfNecessary]; } ++ (void)setUseMainThreadDelegateCallbacks:(BOOL)useMainThreadDelegateCallbacks +{ + _useMainThreadDelegateCallbacks = useMainThreadDelegateCallbacks; +} + ++ (BOOL)useMainThreadDelegateCallbacks +{ + return _useMainThreadDelegateCallbacks; +} + #pragma mark - Progress - (void)handleProgressImage:(UIImage *)progressImage progress:(CGFloat)progress downloadIdentifier:(nullable id)downloadIdentifier @@ -743,11 +755,15 @@ } if (calloutBlock) { - ASPerformBlockOnMainThread(^{ - if (let strongSelf = weakSelf) { - calloutBlock(strongSelf); - } - }); + if (ASNetworkImageNode.useMainThreadDelegateCallbacks) { + ASPerformBlockOnMainThread(^{ + if (auto strongSelf = weakSelf) { + calloutBlock(strongSelf); + } + }); + } else { + calloutBlock(self); + } } }); }; From 4880b54db0139b7965e171df514b0ea3f121dfd0 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 25 Jul 2018 14:08:48 -0700 Subject: [PATCH 42/97] Add documentation for rounding corners within Texture (#1044) --- docs/_docs/corner-rounding.md | 127 ++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) diff --git a/docs/_docs/corner-rounding.md b/docs/_docs/corner-rounding.md index a69f8fa6a2..1163ed3fe9 100755 --- a/docs/_docs/corner-rounding.md +++ b/docs/_docs/corner-rounding.md @@ -97,3 +97,130 @@ CALayer's `.shouldRasterize` is unrelated to Texture `node.shouldRasterizeDescen Use this flowchart to select the most performant strategy to round a set of corners. corner rounding strategy flowchart + +## Texture Support + +The following code exemplifies different ways how to archive corner rounding within Texture: + +### Use `.cornerRadius` + +
    +SwiftObjective-C +
    +
    +CGFloat cornerRadius = 20.0;
    +    
    +_photoImageNode.cornerRoundingType = ASCornerRoundingTypeDefaultSlowCALayer;
    +_photoImageNode.cornerRadius = cornerRadius;
    +
    + +
    +
    + + +### Use precomposition for rounding corners + +
    +SwiftObjective-C +
    +
    +CGFloat cornerRadius = 20.0;
    +    
    +_photoImageNode.cornerRoundingType = ASCornerRoundingTypePrecomposited;
    +_photoImageNode.cornerRadius = cornerRadius;
    +
    + +
    +
    + + +### Use clipping for rounding corners + +
    +SwiftObjective-C +
    +
    +CGFloat cornerRadius = 20.0;
    +
    +_photoImageNode.cornerRoundingType = ASCornerRoundingTypeClipping;
    +_photoImageNode.backgroundColor = [UIColor whiteColor];
    +_photoImageNode.cornerRadius = cornerRadius;
    +
    + +
    +
    + + +### Use `willDisplayNodeContentWithRenderingContext` to set a clipping path for the content for rounding corners + +
    +SwiftObjective-C +
    +
    +CGFloat cornerRadius = 20.0;
    +    
    +// Use the screen scale for corner radius to respect content scale
    +CGFloat screenScale = UIScreen.mainScreen.scale;
    +_photoImageNode.willDisplayNodeContentWithRenderingContext = ^(CGContextRef context, id drawParameters) {
    +    CGRect bounds = CGContextGetClipBoundingBox(context);
    +    CGFloat radius = cornerRadius * screenScale; 
    +    UIImage *overlay = [UIImage as_resizableRoundedImageWithCornerRadius:radius
    +                                                             cornerColor:[UIColor clearColor]
    +                                                               fillColor:[UIColor clearColor]];
    +    [overlay drawInRect:bounds];
    +    [[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:radius] addClip];
    +};
    +
    +
    + +
    +
    + +### Use `ASImageNode` extras to round the image and add a border. + +This is great for example to round avatar images. + +
    +SwiftObjective-C +
    +
    +CGFloat cornerRadius = 20.0;
    +
    +_photoImageNode.imageModificationBlock = ASImageNodeRoundBorderModificationBlock(5.0, [UIColor orangeColor]);
    +
    + +
    +
    From eb4c21c54540d2c1c0b63a6b0665a77fea810e6c Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 26 Jul 2018 09:44:10 -0700 Subject: [PATCH 43/97] Optimize drawing code + add examples how to round corners (#996) * Use CoreGraphics for drawing and cropping of node content * Smaller fixes --- AsyncDisplayKit.xcodeproj/project.pbxproj | 16 ++-- CHANGELOG.md | 2 +- Source/ASDisplayNode.mm | 55 ++++++------ Source/ASImageNode.mm | 38 +++++++-- Source/Base/ASBaseDefines.h | 2 +- Source/Details/CoreGraphics+ASConvenience.h | 9 +- Source/Details/CoreGraphics+ASConvenience.m | 19 ----- Source/Details/CoreGraphics+ASConvenience.mm | 64 ++++++++++++++ Source/Layout/ASDimension.h | 10 +-- Source/Layout/ASDimension.mm | 2 +- Source/Private/ASDisplayNode+AsyncDisplay.mm | 78 +++++++++++++----- ...Convenience.m => UIImage+ASConvenience.mm} | 48 +++++++---- Source/tvOS/ASControlNode+tvOS.m | 8 +- Source/tvOS/ASImageNode+tvOS.m | 4 +- .../testRoundedCornerBlock@2x.png | Bin 0 -> 11609 bytes examples/ASDKgram/Sample/PhotoCellNode.m | 4 +- 16 files changed, 250 insertions(+), 109 deletions(-) delete mode 100644 Source/Details/CoreGraphics+ASConvenience.m create mode 100644 Source/Details/CoreGraphics+ASConvenience.mm rename Source/{UIImage+ASConvenience.m => UIImage+ASConvenience.mm} (86%) create mode 100644 Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 3c66687060..d3e26159d1 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -109,7 +109,7 @@ 509E68631B3AEDB4009B9150 /* ASCollectionViewLayoutController.h in Headers */ = {isa = PBXBuildFile; fileRef = 205F0E1B1B373A2C007741D0 /* ASCollectionViewLayoutController.h */; }; 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E1C1B373A2C007741D0 /* ASCollectionViewLayoutController.m */; }; 509E68651B3AEDC5009B9150 /* CoreGraphics+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */; }; + 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.mm in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */; }; 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.mm in Sources */ = {isa = PBXBuildFile; fileRef = DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */; }; 636EA1A51C7FF4EF00EE152F /* ASDefaultPlayButton.m in Sources */ = {isa = PBXBuildFile; fileRef = AEB7B0191C5962EA00662EF4 /* ASDefaultPlayButton.m */; }; 680346941CE4052A0009FEB4 /* ASNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -176,7 +176,7 @@ 7AB338671C55B3460055FDE8 /* ASRelativeLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A06A7391C35F08800FE8DAA /* ASRelativeLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7AB338691C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */; }; 8021EC1D1D2B00B100799119 /* UIImage+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */; }; + 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */; }; 81E95C141D62639600336598 /* ASTextNodeSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.m */; }; 83A7D95B1D44547700BF333E /* ASWeakMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A7D9591D44542100BF333E /* ASWeakMap.m */; }; 83A7D95C1D44548100BF333E /* ASWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A7D9581D44542100BF333E /* ASWeakMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -621,7 +621,7 @@ 205F0E1B1B373A2C007741D0 /* ASCollectionViewLayoutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewLayoutController.h; sourceTree = ""; }; 205F0E1C1B373A2C007741D0 /* ASCollectionViewLayoutController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCollectionViewLayoutController.m; sourceTree = ""; }; 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CoreGraphics+ASConvenience.h"; sourceTree = ""; }; - 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CoreGraphics+ASConvenience.m"; sourceTree = ""; }; + 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "CoreGraphics+ASConvenience.mm"; sourceTree = ""; }; 242995D21B29743C00090100 /* ASBasicImageDownloaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASBasicImageDownloaderTests.m; sourceTree = ""; }; 2538B6F21BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASCollectionViewFlowLayoutInspectorTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 254C6B511BF8FE6D003EC431 /* ASTextKitTruncationTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTextKitTruncationTests.mm; sourceTree = ""; }; @@ -734,7 +734,7 @@ 7A06A7391C35F08800FE8DAA /* ASRelativeLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRelativeLayoutSpec.h; sourceTree = ""; }; 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRelativeLayoutSpecSnapshotTests.mm; sourceTree = ""; }; 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ASConvenience.h"; sourceTree = ""; }; - 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ASConvenience.m"; sourceTree = ""; }; + 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIImage+ASConvenience.mm"; sourceTree = ""; }; 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTextNodeSnapshotTests.m; sourceTree = ""; }; 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRunLoopQueue.h; path = ../ASRunLoopQueue.h; sourceTree = ""; }; 81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRunLoopQueue.mm; path = ../ASRunLoopQueue.mm; sourceTree = ""; }; @@ -1234,7 +1234,7 @@ 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */, 6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */, 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */, - 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */, + 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */, CC55A70B1E529FA200594372 /* UIResponder+AsyncDisplayKit.h */, CC55A70C1E529FA200594372 /* UIResponder+AsyncDisplayKit.m */, ); @@ -1422,7 +1422,7 @@ CC3B20871C3F7A5400798563 /* ASWeakSet.h */, CC3B20881C3F7A5400798563 /* ASWeakSet.m */, 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */, - 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */, + 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */, DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */, DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */, CC4981BA1D1C7F65004E13CC /* NSIndexSet+ASHelpers.h */, @@ -2405,7 +2405,7 @@ CCA282C51E9EAE630037E8B7 /* ASLayerBackingTipProvider.m in Sources */, 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.m in Sources */, B35061F91B010EFD0018CF92 /* ASControlNode.mm in Sources */, - 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.m in Sources */, + 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.mm in Sources */, CCAA0B80206ADBF30057B336 /* ASRecursiveUnfairLock.m in Sources */, CCBDDD0620C62A2D00CBA922 /* ASMainThreadDeallocation.mm in Sources */, B35062181B010EFD0018CF92 /* ASDataController.mm in Sources */, @@ -2504,7 +2504,7 @@ 6959433F1D70815300B0EE1F /* ASDisplayNodeLayout.mm in Sources */, 68355B3E1CB57A60001D4E68 /* ASPINRemoteImageDownloader.m in Sources */, CC034A141E649F1300626263 /* AsyncDisplayKit+IGListKitMethods.m in Sources */, - 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */, + 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.mm in Sources */, 254C6B871BF94F8A003EC431 /* ASTextKitEntityAttribute.m in Sources */, 34566CB31BC1213700715E6B /* ASPhotosFrameworkImageRequest.m in Sources */, 254C6B831BF94F8A003EC431 /* ASTextKitCoreTextAdditions.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f87a2899..5be5334b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) - Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) - Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) - +- Optimize drawing code + add examples how to round corners. [Michael Schneider](https://github.com/maicki) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 347d41c42c..0fa7a9eb60 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -53,6 +53,7 @@ #import #import #import +#import // Conditionally time these scopes to our debug ivars (only exist in debug/profile builds) #if TIME_DISPLAYNODE_OPS @@ -1508,7 +1509,7 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS __instanceLock__.lock(); if (_placeholderLayer.superlayer && !placeholderShouldPersist) { void (^cleanupBlock)() = ^{ - [_placeholderLayer removeFromSuperlayer]; + [self->_placeholderLayer removeFromSuperlayer]; }; if (_placeholderFadeDuration > 0.0 && ASInterfaceStateIncludesVisible(self.interfaceState)) { @@ -1666,24 +1667,29 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) CGSize size = CGSizeMake(radius + 1, radius + 1); ASGraphicsBeginImageContextWithOptions(size, NO, self.contentsScaleForDisplay); - CGContextRef ctx = UIGraphicsGetCurrentContext(); + CGContextRef context = UIGraphicsGetCurrentContext(); if (isRight == YES) { - CGContextTranslateCTM(ctx, -radius + 1, 0); + CGContextTranslateCTM(context, -radius + 1, 0); } if (isTop == YES) { - CGContextTranslateCTM(ctx, 0, -radius + 1); + CGContextTranslateCTM(context, 0, -radius + 1); } - UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, radius * 2, radius * 2) cornerRadius:radius]; - [roundedRect setUsesEvenOddFillRule:YES]; - [roundedRect appendPath:[UIBezierPath bezierPathWithRect:CGRectMake(-1, -1, radius * 2 + 1, radius * 2 + 1)]]; - [backgroundColor setFill]; - [roundedRect fill]; - + + CGMutablePathRef roundedPath = CGPathCreateMutable(); + CGPathRef addedPath = ASCGRoundedPathCreate(CGRectMake(0, 0, radius * 2, radius * 2), radius); + CGPathAddPath(roundedPath, NULL, addedPath); + CGPathAddRect(roundedPath, NULL, CGRectMake(-1, -1, radius * 2 + 1, radius * 2 + 1)); + CGContextAddPath(context, roundedPath); + CGContextSetFillColorWithColor(context, backgroundColor.CGColor); + CGContextEOFillPath(context); + // No lock needed, as _clipCornerLayers is only modified on the main thread. - CALayer *clipCornerLayer = _clipCornerLayers[idx]; - clipCornerLayer.contents = (id)(ASGraphicsGetImageAndEndCurrentContext().CGImage); - clipCornerLayer.bounds = CGRectMake(0.0, 0.0, size.width, size.height); - clipCornerLayer.anchorPoint = CGPointMake(isRight ? 1.0 : 0.0, isTop ? 1.0 : 0.0); + _clipCornerLayers[idx].contents = (id)(ASGraphicsGetImageAndEndCurrentContext().CGImage); + _clipCornerLayers[idx].bounds = CGRectMake(0.0, 0.0, size.width, size.height); + _clipCornerLayers[idx].anchorPoint = CGPointMake(isRight ? 1.0 : 0.0, isTop ? 1.0 : 0.0); + + CGPathRelease(addedPath); + CGPathRelease(roundedPath); } [self _layoutClipCornersIfNeeded]; }); @@ -1868,7 +1874,10 @@ static void _recursivelySetDisplaySuspended(ASDisplayNode *node, CALayer *layer, [self displayDidFinish]; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)displayWillStart {} +#pragma clang diagnostic pop - (void)displayWillStartAsynchronously:(BOOL)asynchronously { ASDisplayNodeAssertMainThread(); @@ -2979,11 +2988,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (ASInterfaceStateIncludesVisible(self.pendingInterfaceState)) { void(^exitVisibleInterfaceState)(void) = ^{ // This block intentionally retains self. - __instanceLock__.lock(); - unsigned isStillInHierarchy = _flags.isInHierarchy; - BOOL isVisible = ASInterfaceStateIncludesVisible(_pendingInterfaceState); - ASInterfaceState newState = (_pendingInterfaceState & ~ASInterfaceStateVisible); - __instanceLock__.unlock(); + self->__instanceLock__.lock(); + unsigned isStillInHierarchy = self->_flags.isInHierarchy; + BOOL isVisible = ASInterfaceStateIncludesVisible(self->_pendingInterfaceState); + ASInterfaceState newState = (self->_pendingInterfaceState & ~ASInterfaceStateVisible); + self->__instanceLock__.unlock(); if (!isStillInHierarchy && isVisible) { #if ENABLE_NEW_EXIT_HIERARCHY_BEHAVIOR if (![self supportsRangeManagedInterfaceState]) { @@ -3142,8 +3151,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [self setDisplaySuspended:YES]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(__instanceLock__); - if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { + ASDN::MutexLocker l(self->__instanceLock__); + if (ASInterfaceStateIncludesDisplay(self->_interfaceState) == NO) { [self clearContents]; } }); @@ -3160,8 +3169,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [[self asyncLayer] cancelAsyncDisplay]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(__instanceLock__); - if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { + ASDN::MutexLocker l(self->__instanceLock__); + if (ASInterfaceStateIncludesDisplay(self->_interfaceState) == NO) { [self clearContents]; } }); diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index d060d8993e..3740991360 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -737,19 +737,43 @@ asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat { return ^(UIImage *originalImage) { ASGraphicsBeginImageContextWithOptions(originalImage.size, NO, originalImage.scale); - UIBezierPath *roundOutline = [UIBezierPath bezierPathWithOvalInRect:(CGRect){CGPointZero, originalImage.size}]; + + CGContextRef context = UIGraphicsGetCurrentContext(); + CGRect rect = (CGRect){CGPointZero, originalImage.size}; + CGMutablePathRef path = CGPathCreateMutable(); + + CGPathAddEllipseInRect(path, NULL, rect); + CGContextAddPath(context, path); + // Make the image round - [roundOutline addClip]; + CGContextClip(context); + + // Although drawAtPoint:blendMode: would consider the CTM already, we are using CGContext* functions for drawing + // the image instead calling drawAtPoint:blendMode. This will save use 50% of retain calls for the image + CGContextSetBlendMode(context, kCGBlendModeCopy); + CGContextTranslateCTM(context, 0, CGRectGetMaxY(rect) + CGRectGetMinY(rect)); + CGContextScaleCTM(context, originalImage.scale, -originalImage.scale); + CGContextSetAlpha(context, 1.0); + CGContextDrawImage(context, rect, originalImage.CGImage); - // Draw the original image - [originalImage drawAtPoint:CGPointZero blendMode:kCGBlendModeCopy alpha:1]; + CGPathRelease(path); // Draw a border on top. if (borderWidth > 0.0) { - [borderColor setStroke]; - [roundOutline setLineWidth:borderWidth]; - [roundOutline stroke]; + // Begin a new path for the border + CGContextBeginPath(context); + + CGFloat strokeThickness = borderWidth; + CGFloat strokeInset = floor((strokeThickness + 1.0f) / 2.0f) - 1.0f; + CGPathRef path = CGPathCreateWithEllipseInRect(CGRectInset(rect, strokeInset, strokeInset), NULL); + CGContextAddPath(context, path); + + CGContextSetStrokeColorWithColor(context, borderColor.CGColor); + CGContextSetLineWidth(context, borderWidth); + CGContextStrokePath(context); + + CGPathRelease(path); } return ASGraphicsGetImageAndEndCurrentContext(); diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index 2fabc0dde5..b3543ced68 100755 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -130,7 +130,7 @@ #endif #endif -#define ASOVERLOADABLE __attribute__((overloadable)) +#define AS_OVERLOADABLE __attribute__((overloadable)) #if __has_attribute(noescape) diff --git a/Source/Details/CoreGraphics+ASConvenience.h b/Source/Details/CoreGraphics+ASConvenience.h index 9eeef3192f..6229d4ad2d 100644 --- a/Source/Details/CoreGraphics+ASConvenience.h +++ b/Source/Details/CoreGraphics+ASConvenience.h @@ -17,8 +17,8 @@ #import -#import #import +#import #import @@ -56,4 +56,11 @@ ASDISPLAYNODE_INLINE BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CG return fabs(size1.width - size2.width) < delta && fabs(size1.height - size2.height) < delta; }; +AS_OVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN CGPathRef ASCGRoundedPathCreate(CGRect rect, UIRectCorner corners, CGSize cornerRadii); + +AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT CGPathRef ASCGRoundedPathCreate(CGRect rect, CGFloat cornerRadius) { + return ASCGRoundedPathCreate(rect, UIRectCornerAllCorners, CGSizeMake(cornerRadius, cornerRadius)); +} + + NS_ASSUME_NONNULL_END diff --git a/Source/Details/CoreGraphics+ASConvenience.m b/Source/Details/CoreGraphics+ASConvenience.m deleted file mode 100644 index 92169ffe4e..0000000000 --- a/Source/Details/CoreGraphics+ASConvenience.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// CoreGraphics+ASConvenience.m -// 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 /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/Source/Details/CoreGraphics+ASConvenience.mm b/Source/Details/CoreGraphics+ASConvenience.mm new file mode 100644 index 0000000000..2a3b6b84ec --- /dev/null +++ b/Source/Details/CoreGraphics+ASConvenience.mm @@ -0,0 +1,64 @@ +// +// CoreGraphics+ASConvenience.m +// 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 /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 + +AS_OVERLOADABLE CGPathRef ASCGRoundedPathCreate(CGRect rect, UIRectCorner corners, CGSize cornerRadii) { + CGMutablePathRef path = CGPathCreateMutable(); + + const CGPoint topLeft = rect.origin; + const CGPoint topRight = CGPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect)); + const CGPoint bottomRight = CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect)); + const CGPoint bottomLeft = CGPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect)); + + if (corners & UIRectCornerTopLeft) { + CGPathMoveToPoint(path, NULL, topLeft.x+cornerRadii.width, topLeft.y); + } else { + CGPathMoveToPoint(path, NULL, topLeft.x, topLeft.y); + } + + if (corners & UIRectCornerTopRight) { + CGPathAddLineToPoint(path, NULL, topRight.x-cornerRadii.width, topRight.y); + CGPathAddCurveToPoint(path, NULL, topRight.x, topRight.y, topRight.x, topRight.y+cornerRadii.height, topRight.x, topRight.y+cornerRadii.height); + } else { + CGPathAddLineToPoint(path, NULL, topRight.x, topRight.y); + } + + if (corners & UIRectCornerBottomRight) { + CGPathAddLineToPoint(path, NULL, bottomRight.x, bottomRight.y-cornerRadii.height); + CGPathAddCurveToPoint(path, NULL, bottomRight.x, bottomRight.y, bottomRight.x-cornerRadii.width, bottomRight.y, bottomRight.x-cornerRadii.width, bottomRight.y); + } else { + CGPathAddLineToPoint(path, NULL, bottomRight.x, bottomRight.y); + } + + if (corners & UIRectCornerBottomLeft) { + CGPathAddLineToPoint(path, NULL, bottomLeft.x+cornerRadii.width, bottomLeft.y); + CGPathAddCurveToPoint(path, NULL, bottomLeft.x, bottomLeft.y, bottomLeft.x, bottomLeft.y-cornerRadii.height, bottomLeft.x, bottomLeft.y-cornerRadii.height); + } else { + CGPathAddLineToPoint(path, NULL, bottomLeft.x, bottomLeft.y); + } + + if (corners & UIRectCornerTopLeft) { + CGPathAddLineToPoint(path, NULL, topLeft.x, topLeft.y+cornerRadii.height); + CGPathAddCurveToPoint(path, NULL, topLeft.x, topLeft.y, topLeft.x+cornerRadii.width, topLeft.y, topLeft.x+cornerRadii.width, topLeft.y); + } else { + CGPathAddLineToPoint(path, NULL, topLeft.x, topLeft.y); + } + + CGPathCloseSubpath(path); + return path; +} diff --git a/Source/Layout/ASDimension.h b/Source/Layout/ASDimension.h index 462406eedb..ffe6138b5f 100644 --- a/Source/Layout/ASDimension.h +++ b/Source/Layout/ASDimension.h @@ -94,7 +94,7 @@ AS_EXTERN ASDimension const ASDimensionAuto; /** * Returns a dimension with the specified type and value. */ -ASOVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit unit, CGFloat value) +AS_OVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit unit, CGFloat value) { if (unit == ASDimensionUnitAuto ) { ASDisplayNodeCAssert(value == 0, @"ASDimension auto value must be 0."); @@ -112,7 +112,7 @@ ASOVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit /** * Returns a dimension with the specified points value. */ -ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensionMake(CGFloat points) +AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensionMake(CGFloat points) { return ASDimensionMake(ASDimensionUnitPoints, points); } @@ -122,7 +122,7 @@ ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensio * Examples: ASDimensionMake(@"50%") = ASDimensionMake(ASDimensionUnitFraction, 0.5) * ASDimensionMake(@"0.5pt") = ASDimensionMake(ASDimensionUnitPoints, 0.5) */ -ASOVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN ASDimension ASDimensionMake(NSString *dimension); +AS_OVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN ASDimension ASDimensionMake(NSString *dimension); /** * Returns a dimension with the specified points value. @@ -244,7 +244,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASSizeRangeHasSignificantArea(AS /** * Creates an ASSizeRange with provided min and max size. */ -ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize min, CGSize max) +AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize min, CGSize max) { ASDisplayNodeCAssertPositiveReal(@"Range min width", min.width); ASDisplayNodeCAssertPositiveReal(@"Range min height", min.height); @@ -263,7 +263,7 @@ ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRang /** * Creates an ASSizeRange with provided size as both min and max. */ -ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize exactSize) +AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize exactSize) { return ASSizeRangeMake(exactSize, exactSize); } diff --git a/Source/Layout/ASDimension.mm b/Source/Layout/ASDimension.mm index 4fd0e18001..a27226dda1 100644 --- a/Source/Layout/ASDimension.mm +++ b/Source/Layout/ASDimension.mm @@ -25,7 +25,7 @@ ASDimension const ASDimensionAuto = {ASDimensionUnitAuto, 0}; -ASOVERLOADABLE ASDimension ASDimensionMake(NSString *dimension) +AS_OVERLOADABLE ASDimension ASDimensionMake(NSString *dimension) { if (dimension.length > 0) { diff --git a/Source/Private/ASDisplayNode+AsyncDisplay.mm b/Source/Private/ASDisplayNode+AsyncDisplay.mm index 2cf772aecf..16cf9b39e6 100644 --- a/Source/Private/ASDisplayNode+AsyncDisplay.mm +++ b/Source/Private/ASDisplayNode+AsyncDisplay.mm @@ -25,6 +25,7 @@ #import #import #import +#import @interface ASDisplayNode () <_ASDisplayLayerDelegate> @@ -111,10 +112,13 @@ CGContextTranslateCTM(context, frame.origin.x, frame.origin.y); - //support cornerRadius + // Support cornerRadius if (rasterizingFromAscendent && clipsToBounds) { if (cornerRadius) { - [[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:cornerRadius] addClip]; + CGPathRef cornerRadiusPath = ASCGRoundedPathCreate(bounds, cornerRadius); + CGContextAddPath(context, cornerRadiusPath); + CGContextClip(context); + CGPathRelease(cornerRadiusPath); } else { CGContextClipToRect(context, bounds); } @@ -127,13 +131,18 @@ CGContextFillRect(context, bounds); } - // If there is a display block, call it to get the image, then copy the image into the current context (which is the rasterized container's backing store). + // If there is a display block, call it to get the image, then copy the image into the current context (which + // is the rasterized container's backing store). if (displayBlock) { UIImage *image = (UIImage *)displayBlock(); if (image) { BOOL opaque = ASImageAlphaInfoIsOpaque(CGImageGetAlphaInfo(image.CGImage)); CGBlendMode blendMode = opaque ? kCGBlendModeCopy : kCGBlendModeNormal; - [image drawInRect:bounds blendMode:blendMode alpha:1]; + CGContextSetBlendMode(context, blendMode); + CGContextTranslateCTM(context, 0, CGRectGetMaxY(bounds) + CGRectGetMinY(bounds)); + CGContextScaleCTM(context, 1, -1); + CGContextSetAlpha(context, 1.0); + CGContextDrawImage(context, bounds, image.CGImage); } } }; @@ -295,7 +304,10 @@ ASDisplayNodeAssert(context == UIGraphicsGetCurrentContext(), @"context is expected to be pushed on UIGraphics stack %@", self); // TODO: This clip path should be removed if we are rasterizing. CGRect boundingBox = CGContextGetClipBoundingBox(context); - [[UIBezierPath bezierPathWithRoundedRect:boundingBox cornerRadius:cornerRadius] addClip]; + CGPathRef cornerRadiusPath = ASCGRoundedPathCreate(boundingBox, cornerRadius); + CGContextAddPath(context, cornerRadiusPath); + CGContextClip(context); + CGPathRelease(cornerRadiusPath); } if (willDisplayNodeContentWithRenderingContext) { @@ -332,34 +344,58 @@ CGFloat white = 0.0f, alpha = 0.0f; [backgroundColor getWhite:&white alpha:&alpha]; ASGraphicsBeginImageContextWithOptions(bounds.size, (alpha == 1.0f), contentsScale); + context = UIGraphicsGetCurrentContext(); [*image drawInRect:bounds]; } else { bounds = CGContextGetClipBoundingBox(context); } ASDisplayNodeAssert(UIGraphicsGetCurrentContext(), @"context is expected to be pushed on UIGraphics stack %@", self); + + CGContextSaveGState(context); - UIBezierPath *roundedHole = [UIBezierPath bezierPathWithRect:bounds]; - [roundedHole appendPath:[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:cornerRadius * contentsScale]]; - roundedHole.usesEvenOddFillRule = YES; - - UIBezierPath *roundedPath = nil; - if (borderWidth > 0.0f) { // Don't create roundedPath and stroke if borderWidth is 0.0 - CGFloat strokeThickness = borderWidth * contentsScale; - CGFloat strokeInset = ((strokeThickness + 1.0f) / 2.0f) - 1.0f; - roundedPath = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(bounds, strokeInset, strokeInset) - cornerRadius:_cornerRadius * contentsScale]; - roundedPath.lineWidth = strokeThickness; - [[UIColor colorWithCGColor:borderColor] setStroke]; - } + CGMutablePathRef roundedHole = CGPathCreateMutable(); + CGPathAddRect(roundedHole, NULL, bounds); + + CGPathRef additionalPath = ASCGRoundedPathCreate(bounds, cornerRadius * contentsScale); + CGPathAddPath(roundedHole, NULL, additionalPath); + + CGContextAddPath(context, roundedHole); // Punch out the corners by copying the backgroundColor over them. // This works for everything from clearColor to opaque colors. - [backgroundColor setFill]; - [roundedHole fillWithBlendMode:kCGBlendModeCopy alpha:1.0f]; + CGContextSetFillColorWithColor(context, backgroundColor.CGColor); - [roundedPath stroke]; // Won't do anything if borderWidth is 0 and roundedPath is nil. + CGContextSetAlpha(context, 1.0); + CGContextSetBlendMode(context, kCGBlendModeCopy); + CGContextEOFillPath(context); + + CGPathRelease(additionalPath); + CGPathRelease(roundedHole); + CGContextRestoreGState(context); + + // Drawing borders with ASCornerRoundingTypePrecomposited set has some problems at the moment. If the borderWidth is + // set, besides we are drawing the border with the given corner radius, the CALayer also picks up the borderWidth + // value and draws the border without the cornerRadius. + if (borderWidth > 0.0f) { // Don't create roundedPath and stroke if borderWidth is 0.0 + CGContextSaveGState(context); + + CGFloat strokeThickness = borderWidth * contentsScale; + CGFloat strokeInset = ((strokeThickness + 1.0f) / 2.0f) - 1.0f; + CGPathRef roundedPath = ASCGRoundedPathCreate(CGRectInset(bounds, strokeInset, strokeInset), _cornerRadius * contentsScale); + CGContextAddPath(context, roundedPath); + + CGContextSetLineWidth(context, strokeThickness); + CGContextSetStrokeColorWithColor(context, borderColor); + + CGContextStrokePath(context); + + CGPathRelease(roundedPath); + + CGContextRestoreGState(context); + } + if (*image) { *image = ASGraphicsGetImageAndEndCurrentContext(); } diff --git a/Source/UIImage+ASConvenience.m b/Source/UIImage+ASConvenience.mm similarity index 86% rename from Source/UIImage+ASConvenience.m rename to Source/UIImage+ASConvenience.mm index c1d0751e39..84e87b0fc0 100644 --- a/Source/UIImage+ASConvenience.m +++ b/Source/UIImage+ASConvenience.mm @@ -19,6 +19,7 @@ #import #import #import +#import #pragma mark - ASDKFastImageNamed @@ -114,9 +115,9 @@ UIImage *cachedImageNamed(NSString *imageName, UITraitCollection *traitCollectio // UIBezierPath objects are fairly small and these are equally sized. 20 should be plenty for many different parameters. __pathCache.countLimit = 20; }); - + // Treat clear background color as no background color - if ([cornerColor isEqual:[UIColor clearColor]]) { + if (CGColorGetAlpha(cornerColor.CGColor) == 0) { cornerColor = nil; } @@ -140,33 +141,46 @@ UIImage *cachedImageNamed(NSString *imageName, UITraitCollection *traitCollectio // We should probably check if the background color has any alpha component but that // might be expensive due to needing to check mulitple color spaces. ASGraphicsBeginImageContextWithOptions(bounds.size, cornerColor != nil, scale); - + + CGContextRef context = UIGraphicsGetCurrentContext(); + + // Draw Corners BOOL contextIsClean = YES; if (cornerColor) { contextIsClean = NO; - [cornerColor setFill]; + + CGContextSetFillColorWithColor(context, cornerColor.CGColor); // Copy "blend" mode is extra fast because it disregards any value currently in the buffer and overrides directly. - UIRectFillUsingBlendMode(bounds, kCGBlendModeCopy); + CGContextSetBlendMode(context, kCGBlendModeCopy); + CGContextFillRect(context, bounds); } - + + // Draw fill BOOL canUseCopy = contextIsClean || (CGColorGetAlpha(fillColor.CGColor) == 1); - [fillColor setFill]; - [path fillWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1]; - + CGContextSetFillColorWithColor(context, fillColor.CGColor); + CGContextSetBlendMode(context, canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal); + CGContextSetAlpha(context, 1.0); + CGContextAddPath(context, path.CGPath); + CGContextFillPath(context); + + // Add a border if (borderColor) { - [borderColor setStroke]; - // Inset border fully inside filled path (not halfway on each side of path) CGRect strokeRect = CGRectInset(bounds, borderWidth / 2.0, borderWidth / 2.0); - + // It is rarer to have a stroke path, and our cache key only handles rounded rects for the exact-stretchable // size calculated by cornerRadius, so we won't bother caching this path. Profiling validates this decision. - UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect:strokeRect - byRoundingCorners:roundedCorners - cornerRadii:cornerRadii]; - [strokePath setLineWidth:borderWidth]; + CGPathRef strokePath = ASCGRoundedPathCreate(strokeRect, roundedCorners, cornerRadii); + + CGContextSetStrokeColorWithColor(context, borderColor.CGColor); + CGContextSetLineWidth(context, borderWidth); + CGContextSetAlpha(context, 1.0); BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1); - [strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1]; + CGContextSetBlendMode(context, (canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal)); + CGContextAddPath(context, strokePath); + CGContextStrokePath(context); + + CGPathRelease(strokePath); } UIImage *result = ASGraphicsGetImageAndEndCurrentContext(); diff --git a/Source/tvOS/ASControlNode+tvOS.m b/Source/tvOS/ASControlNode+tvOS.m index 77e5418629..c18b67eec8 100644 --- a/Source/tvOS/ASControlNode+tvOS.m +++ b/Source/tvOS/ASControlNode+tvOS.m @@ -83,7 +83,9 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 12.0; layer.shadowOpacity = 0.45; - layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; + CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); + layer.shadowPath = shadowPath; + CGPathRelease(shadowPath); } - (void)setDefaultFocusAppearance @@ -93,7 +95,9 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 0; layer.shadowOpacity = 0; - layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; + CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); + layer.shadowPath = shadowPath; + CGPathRelease(shadowPath); self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); } @end diff --git a/Source/tvOS/ASImageNode+tvOS.m b/Source/tvOS/ASImageNode+tvOS.m index 9482fdc8c1..8f8486b941 100644 --- a/Source/tvOS/ASImageNode+tvOS.m +++ b/Source/tvOS/ASImageNode+tvOS.m @@ -169,7 +169,9 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 12.0; layer.shadowOpacity = 0.45; - layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; + CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); + layer.shadowPath = shadowPath; + CGPathRelease(shadowPath); view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.25, 1.25); } diff --git a/Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png b/Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c4686232a23cb980c70b44339427ddfa81412562 GIT binary patch literal 11609 zcmZv?1yqz>_dbk(ASDP=QcBkdBA|4)G(!!I^nfBI-5@R9EzQ8tFqDKKNY?;Er!a&_ z_kZy5dEVdp);DY2b0*H-``UY-bME_G`-G{f$PwT^!9_zuBT$f+)U0y@mRM^Il%h2@Q>m>F&CxpuzYH^&_>7w5k@WMMqtCueYd+^>2&% zOcpz+JaU9;4Hcv%v_9V3$;AGs1-uCLWes0}{p_S?{iLPd9S~gnY5FHl0Ol4H_JHj1 zk6H1ksCEsVn{C_*4W>``p9RR1Yr_=d>1Ei)4735vFYH{o{wri=bNsJ1vWr;kuPA@iw;Lz=_cNGUT?aK{w zU9G}_RtImg28BM7@2|~&@vr^NJSO{uP$+Ou*2>?DQ_b2BMz&Qn5szI83^TRW=aGVE z^BKDImuqf)u+yp?Ej>}iR}Wo~nl#`x?bq{# zzUI?{+-s6AVYRWcV~S}Cm(~S0Gh_N0!m+P@_~v?nm)cy(z9Y~L336^cT6)mteOHOD z*S|T}QS!>XdUKgvkyRtHu5GWrRfo_r8)wdJaxbiyc_DG^L-9o=)fe9C2}3rOx0krN z%C)86`?wbpSE@Wrl(1WqqAwQ{L zyA!dB0_J(!iAD|ud+3>-dlYqz?zQ@hsBgu~wwDLGe1<|2QT)Sj3%zV)T&wXZ_ z4;M6F4!50pY`@sY5m|MavNOUaICx^);+D_s$#;~hW2ofyC}9$7-`RVgbUbE3;bMj( zkFyeb;?c_i|6h^=KYjeaVO7Aed8Yg&iZ@Ps?9FUw$zb<0+hmoj?^N!Lm20Uj<``hp zLPx$ITwaVP?PJbz>Ky9Ghhv8J3+gqGNG43Ko&b$bqWU2-Io0VpCBN$%CfE;wE;CNq z7yGS-w*!!T8zbex<9@qL!gp-;2SX#;m5n#vXg6ZEMLJr|t?_le*f-J^my+UWy=+Uq zxNJWUVq1*8CE-%-tF)rR7ze-ZhN2|>%H2qO%8D9^3LG}fySHk|^9+-=9VWxK_jJQHNub)$xW%QAL1NTNx;6a5AyE zd_G%5N9W@d+2~WfQL>x#;dY_HdtYc0GBHg|(M!G+zdPc}xN#rC(w% zFXaA|Yb~rrz4^1w?>7ro_v*hgPh(M;a)3j2Gvrs4ID!XqS&p@vHNg`_3Eut6W6C-) zIv?U2CN2!AMpOCZbgo~k>R1j!i6_%2eLy!3tviOL!A2I|>s_P|+jQHb-+yOtXBs{- zhyG7-{je*+4^t&@xIFl{F1_tpjZ!zQ{N#wjhk*N1pWl5 zVymAQ)1of>#ApDsUoaDo^`Gi^t7TdGM60&m1@CfBNOq9St9Y%leMClJDw4Z*aa{z$ z(rU-o6{1eg5=8NvMCqrebf7YnfWK3F8XsXQ1rAfL0`T`tO;aP9pD=~<$=OVS2q(P^ zeeHSlURe%kLEMopCq0R!)z?h(>Bo&88wLfw?&Q;R==mbGy;2Nsp1q!1^v<`*jpYFc zL71H5sB&159-i=Q&0f!M-(pywA8#a~7DWKoCzWZ()+t%Y<$P>W1{P8PL zUxQnc?R|Tm!OJqE)1fJkectOO!YaWRS02^^86p(6J(klCsm$(zTJ@s7XJgu@oltRw z#EZnDkx~0YdHhEM)niVF0=PRR%>Dc0$;?^_izx)f?Ma&lH`4TY7Stt}lUO^Oot=|8 zIKuLf5Ie9rtHJsY%z*|IO>jh16(4`^$r+mQ5{Xw}3~@w1>v#J!=Q$G>A^Vis#Ec3- za#i)#3v=f~XQXh&)f>KQdp((7k6M@N;A-veUx}=Y;vH4+-6NifHJd1b702DsxjK~ z@^;VZ$ysw+c`f|xDoYK@R!=a=ipt37Uf_@BbVIc5S?{-O%qH^?W1J>U31se$>gAk8AXJ88Z-~w->N`;19^Cbx%lZ zI@=IAyhC;NkPdb~?mj2IU2oR3YK&IHHf%wdNm(!FM>1ffU=i`NucH15S$SF5&6&vR zS+0x9a>iDLob2mQn268~4e(?YdFlf$;ks~6n}4bPa^jR_d(HQh>nhC7*2{J~CND`j zS~}q5hkc2|)WP_*X=}K)SD5MnK=k=j1LBPr^*)Nhsc>lOY-xSEFOc2dD1?S4>mkFO*#LMZJ+xk7pN?;8_VC{zW6&oqYCq zamCy#YWS23*hd)KeU-I@z7wBSG`n6j6OM4S5f7v!C;zk|Wo-g81@L&GNsz&9(DGpry~GoFg<9>W!dRpx#IZnU|Hl%{9?n| zn=M7*9sHTl** z(M`EreJsdwI*IX0*Rv)N0@u4L7+U-t>9OWITITcl9{fwV@ryO!NN}0~W{TfEU8tWs zh%*arM&VDIq7by9{S1+L66$XYnk^l9NLIEL_N}ySzSDYR!6wAUtOMic*L4eNH^7Zd z;JzsunI#nonVE}Fl`ZTO6!p0M6EvL}M3K_qzK zum5x=;(TN;wy~)oc}TrKn{omd^u)=04hlG8x;N={!kWz&QeKDBVR^4|L)OZfY|@5qY|Z(@o7rj!5xMMP5_D7Ows7SevA z56l|wCNxLjFTRjmzMxil>W=elu1+l*)79ibk_m3T3Fp+51F4zJhBe6fqzY1|mxuSt z$Cl&6yl^Oq%M3U~eRr%awRZ^-M8iz&U*hH@v4TXERXAnj-y#LWldVD1lD z;-pBWjN0>={h#RuuuTWN&<$)VUQ~@M6bxR}Oy|)Ap0b15t`ajPsxBQx=$!4!GPr-E z-@LC3o^t3Qi|lwZ&_RnYyDPnNSqd8CZ^y4!$h4{NSxhQ-JJMN))d5wWhH`|o?4i`N zX?t~1lt*dyYnksWQ$z~-f7y)@?YuFII1)+y>5=p+gZvmOCY`LqJkQ6H#$e&MY)lbY zcVJt)VvgsD8^|w4Y&fbRPxOc#Z0x9-J}_e|<#?kajviK(y(&+zyys@tA8`+b-Zit6 zdZ)ugOGe3*=W}Axe(|@L(xoZ+U$T4HX2d$D`5@HO?*4{qa7krA^p6mM=|BnHpg!}q znf?u-t52bHKa)a`_L&3phG+TrUp|DgWshQ!-;CpY$>}EA6X3?OqmHnbGXu%z;`s*2 zqzG?3qQ=(Gn0y3->|qu-(?3mNdo8X@PQEpQ!$3U}+ejOpgzm}xAc7kwo!etTaMxA- zI<*Gqw5^55rZCZhJ=q)MEgisM`rz~pOUrxwuhfnW4>+gg2sgemf;)ezlRwDU&NvtE z-aChZDIIliu=@q(sQIX$lkCATgyZnP(mtYwtc?iJw8;B+;p1uS-x?_hd&G; zA>l|SimzB)mL^hobhS`pN{D6ph}o1xHfH;rF+=FpfLY0G2WzXqrD?dsv_;sj7`pdW zA2MJ25H95((BOYa;Cs`_9NEb}AbT|+O;z`M7<0`UAT(o>O7pq81`>k(I>3(BrmZvw(<+ z?;9V}H;d2f9c-!;th~+5f9OeXxY|Le8$&VnMqwE=j$s6Iv&5QKZbb zG;G&kqJM@ZZ~`Yl3i?w6rU^Gia!rkOgY~9^O?5-I(CuuMC-@3j${a#=4|T`n2;Vxr zzsj!d8gy@Llbd)|`3UEabKIO=&Jqv0hw$DA*_3Ys(+c#Rb{oqF2}^V;0P@bG@XXhF zM%20bp){Yk@tV2ue{d5ZnB%(kBSut^Wufs4n%fX6E!V)oHycFXBYqM)XpHbxN}|bL z{)fY6S~Rcids|y?=G3Y6f=fXuIJ?9yfI772psoB{jB8ipk-(!aw11%-QNa$sU(l~k zLKA{LyoP(C$!`o#EnFJpiEB4AUQ>Up(mwl&$_O_nf;b^~HPW6!ti0`0-7qd)- zqpV*%wWCs9@NB->dY2T#x7v6lDA9!`WME2>1X;TENE>$T`T)HV3k#yk(mbuE+v?E= z0d42a3=_NyM34Jz0}C}miIe9bK!UKyy@bP>=GQH`v8!%K99A9v!M2U3UEj&7t+D^u^)Nk zMz~!?HxCB)z$dbQyH<r#%x_pZ)uM7G@Co6T@P-&L7@hV`?&ix=GW zy1eV^8Q$9{_9Vj+r{w9QD-|IzZZ%MLBg2@%IJ<*BAvR4Bk)NY(=(*G*`CNZRj*HZ| zAy65v@t~%Lwzu~h5KcUN-|Rip`(n)K<94W5E}16*Z^ualqeX|{Kv!EB3x`UFDBnFMLVZCN|v{br?0B)WTrzgR0%>b z1#azkNG;=N`K`a%y?jCEX#ARI4fXdxm*^95yi1wtN}jEvOVxTj{uV@MUaiiIAutw0+UOy!g zYFpyOI}#eq8;0x_-gwTxz^Zr)_!K9goz+o=a~C8uKu#D2dTK?Qg(wgrKr&%{xa%PT z5BYd4(oz*Ck*vbQsxh)e{liq-9py3V%1C|~RJ4LHj@z546TJiF!o6BQ=8+JO61nxhQe&&;o0cs+ z!<}K@#+pGx0C5CgN9-5Mjnqpi4C{N!IRr1*cvO_BKqiZW^{Q~4vDlXH^T=+}GJK+u zdjvVb2Z|1n{Ji3B^X98g7dp3J*4rC|Ki=R32k>_cE^l`AiB=gN!-2Z z{gU1miS2|i6!5Xh{+m(LF{N!-ul?unJ>sEB@z`TkYYb9-aT04O^8_9-Ljbu8yk;iz zI1LZ5Z5tC*F2d^dKso#_DdJSsXU!1+{*eztLeGlwv6`L4GQ^3spJp%w{QcXaEuHgf zB`MnDWkYUHGZVAQQydPWq>P+@qQ?1tia%oE#?UV6!CVd-Z78(4-r+3*Hqm8wW`4jXc6lqCW+S;7Oj1|VeNzW>4wY6cJ`TdgV zvEw6D{%UhkjAnhX@jyjEssl|@nFKKm3kT9Gc^5$I{Qfo0+CYMMUIfkORm`|w=%ylM ze_UQf9(_gejXCb$q{D2{YJ)2Crg_~sjDne) z(xmR~U;ie?8pWDcXsj=xXh6aP7zvnR{{gnA^DM;)<+jY7T~;NTfU;d*cDqEn@X`Mx zE!FzR+4b$SoNo*S+7nOQ0wBmQEY2*MlAmHZ|9Fco_`FeNJut}l?Yjz&5_)3|0V=u5 zs8O^#)T?4BzWMgHef*&XX6O2~9nPg2$|-HSq+Q4Ag8Gv(gTRJ~oP&`9o2|F|KSrGyH~70!4@JF2 z;{~jS+!r^`Z`<2XXKsdX)#ZDG;Kg2z0otCu?1*^b(^W8$F4o8&KvFY;{4M&VouqaB z9OWYZe372qjo1wMfAh|x#oMBh*p*l}$5D!3`MFbtvEn`sBgQ{7U7TtbvfA}ySB4aD zs50WfLc|g+9v(P_;r~~-zU-rQSZQ#nP3)9kr_90LI*N z@oK*c$t()_HVSW#^*3VO5%_ zCpX^uTYnXE1(VqNU%O<;xy*4bHyws3yz$z{>Xs%1YdudpXaoOCeeTerC{X9txpl0I zk9RnG<3kQ6RYJ~1Hk%QzAK3`z>WZN!IY>-q7qsasNvg7MxuD{co zWODv@LHFeQ{t_kjO0H$)Y9VQ2-FccmBr(GMMt&m zYQ)m3je^ag=n+BIcgtRF?lVP7etCPjW1Y*)`J+a+(ik6M*?U366uD5sKlkrH zlegQ~POEfIKM^D!N&r2<< zDP6<%1J~Br%$(8ZYu$BE{oTch&Cvhem!`Qs_rVH}7$>uT=Q`-l>$RTFX>)Dudeaf*b?Rx}9Ba zTq1Cgw;FQ8E0wPJ6A&AWgx~0CC|pJ!OF_vlzJbfI^XPR!&xqi2kAk`ml$ob@W=v^M zYPrid<49f&_GuEnr&76S&p zCH(K%>X8WbuYGQ&tQ&uaCp-py8>wrfm6G_{85 zmdADQI!V4wzIY8_e)H1v{@?BoiDaW+;T~(+Rt*D@)Kul=(4z>-D88v-{>?(KKn&Fu zF;;rY$9K=qC>)Em@0WIf5B<;DD>S}U|Io6?Wg42zDmTq7;~f+-5^L7(cBxwlxJTUG z!3!RqSVy2_@?GAKz&){%fDnC$9984-c`-3akpVb~M9$z-;8g51M@oo2#jQ9XhFGOJoZTufkM+IO1L~1dSR!w$C z0IpXEkXjocL=lzfu*$rEo>(J>tAUb+35dA+UKdnYm9G;CyZ}*zx}=B|Kh3-STsqN7 zb^|&wHw0PLC|2m@;JxI6?3?dlvs7d4%nny0_iqD1d zLWh6mZC>4r7Gj@`lEIzT#k8c%aGR`2(m!g8JdN5K?ctA<`#5~uKJS7Id$+yUP3WRo zWFhE@bT+ivEUEl;S|$|xI`;A7*stuDL#E_^w=+(F$nWG2E_X}hY+Eb8q{B;g1gXlc z9MK7D(7q_Lv0{B#$FEN@CAIu3;Aw2_iFs~t3;KRx)f=Ocub5prwBrbK$j{9DoS7%F zNB!s(85=jD{Lr=EKf6wwX?_`MkM%3HYRV!GC1tIyBWI@PJGs~|=_c`fe1{+rn3sJ9 zMEaH#7CZOucFR!w@z9kU=xv)D=h#9IJwOnmRsbOjAQsgzKKGQ#kk61e1F}NzKqf=%!K$5ciMu(y{mdfCBs79#qNI zDuPAUYSk5~-%?T(wL;eBxsak_BA*dlD=@vPslfn+vGZw1+Xe2rS%N#MQG?AHq)*cB z1;M;y^e&>+p^m-c@(o`Nm2HcTa)d~Oad#M_wlw-5js>^uZZn->74WI;vvLH@xbnP8 zW+@iAUU zXPnVK^txq%@?r`=3p@C(?kiu-`VX1&$B;XFNTA_BTFJ_kflIyQQGH^cJslFJ1_Zc_ zx2Zgp13rzlG1LuGm=03c4W0=+$k^O3QtZW7+l*%^?K^jJ?lV&&ZNHW{#&0qw37D@F zm^B1Nzp#enE=X-Z3ivA}Ox~IM+}i1f)qs|=kkaxtkiQ|r;{Kt^IN2)`H$dN`cM23K zT?<{?4jdbV79Dr2QSR%ZhW1lU$*No!WLcM~-ngPa9pG*LebBZ^driK9QNRjfLPTat z%x}uOi21%44-qLIYvgfs6$`8Cd&OSk-1huzG@w)Rn6FPrU11Nw*wRQh5dyny5acBCzm$6VOqCykA9+N*# z#o%6rdTL6BiA~m#woL?UT9r;ci71>q46=}7%RjyW2U6Ac`oNjAo0Fkkk))g*kN+5( zYvVrYk~uE+u2AD*%H)>pbLlB_L<~;_7pG(vh*eRG%_2_!&qL}y3 zshEz!`4uzV_dzK3k~^7>a}&Y0U)y-;qsT7$20$`4*|=k$;Hkz&bAs0Wq!tNo7?L*8@-O*muqwoic*HW%v0m=uN|;4UH?9 z93=%()J!mBO@gsGb~t%M+W7ByYBS3hzivt61{DyBo*%-NVFK$6d_H4jPHpKWv$>d2 zze(Jic3~<{u}L0)KkpD|n_#(elJ3QKxhUbj>6p6xVe!VhGMV;uZV_#HcHtLSBtXS7 zb_n5`d=WwnSrMk0OF>QlB6)iAhtqzKbp0u(??~*Dlz=Njvci!EWg`#jIBWoY*GVm9 zn`S_SWmCAM!<&`vSWW7yET@702>Q3eWRa9*a}Rn?A~Vjo=6&;lwTD=VhSge|(OWLlBqT|Z(6+fX6BJq41;@E&vw*4=fXYH^sbjaix0wleXjAH)fZ?hzelS{Wpjg4ffv3zKID$ zmhd>tBBl=bSqA9`3cveF_opbSxQS!Tqpg*t+fRBK=~&mbsGOO2iUvD}@hAJX&9E~X zry)z90=0RFLBV%*m$AuW^E7?NPWicLfjr=&Yr$$2GiB>eMPQm8k`WnJS(Q-e^O(Da zqWh{DbLN1B!YlmU!3*`KGwQ`IG|sQm2IWrDQrQT&CtM*eJZ3^!C%UfjiO{t7pmW3s zbx!><`BAZsk)1)KSB4C_98BwsjBeG=EBel`?z5P5m*}~0`isNZX#n!w)VT(^a?P*x zM6%WPakJ~|%rNTAZ)igWuK;HN98_7)%C0Hfh32n#j(Cr@j8rDPGOXws{o%_=fS3$H zg$V{eWfS0p`G>Zu2(d&X_1F8Lr?EQ>XT;enpua^qe{?EPB0TR5f_yao?lSyGA!3hP z=(*h(F>qcO#Me+{ZIY58xh86+wrSaf8?F0az4fk2dcY^j#d;~=6M zZ`NlgO*$BK8WZ{6*Q;6?zu8!@y7EOM8di;q$k} z?To4qXL zg(^+j3|P?hsiqvR&X!zO7fg#+tjY7)@n|a}RI3u=)(n{hstA5w@t!(>i9zULk$kTM z(CC&qyh8SWJ!|VO5=J|4^nsET+s$$&XLmS49qf-%ZI#o?l*osHQTr_0vo!X+(>=_q zR|%)oP3u$2(b2l}$R}rhtJuGA+B*J%pdg_nTve9fWG~dun&fi+M)`Kf2L$oZTXYGc z`TU!q=s~MlZ-=8LeJKCfrb|SGoC@polXP=WFF&sTqeOSMlS zr9UF^E|=#8`~3m9{2lz$pGe<>Lw2Fh>bnc4$*BIEm@xD+1(y{NE#vZk;xX{K7Jwn2AQ4zs2-jSRh4GAo0h6Y% z6RXY0DU#k|1%*qtR~>n>yKK|oPqQsn%MY`MH0(igO~U4B+aC4g9iAG)A5XV|Vss>? zC%tSO4la+`k0n9g@xMx9^T~H z)5;ON{DxytKHKYoCq>D|VNtj<;SW<|*_Nd#;czM3n??hfkbncDprrg=uG7C7z{rIN z61=6QyS)%aE^&Us#|vTLYp0~rY;*Ol-QCvbU6Z!3V+i^1)Vk2d*4V%dY@p^Pt1wdW z<8WyiUE-|P)=daq9Der)=@%CHkzkd)0qF@1>}|=+V#I==QCpy(rW@D~0R4NWNx-o? z?7;_6l$NjGxp>zNtmwGe_QeE@(pnHqhEqWkfba69`HjLc-B0;8MQNKH~W!UO0%qzxD z+A^h)|8&V{F5a`|qnsWq2>{dLOL;1FIdS@x3iX2mx1&l({hW3MY#K4bf)H2$GcCQ4L&lor9< zj~`=Yb0%`x3|Ef1^ge&+k!c>*%KT)NPTjyT`|_m}Y3;1B>Zebi?(uwOK+8J2`X#h~ z(D2}@T;i9ZWpX1~FRhdPUPmj1*!y?=;wYe~I3^_WXu58T8y1te5(kp5ImtjRmT_ZDmgLW>$^TYoiK&Kit_bx@XN;4#TW_Yz~8h9npzE0E-o{&}Q zVKFtW2}l3UuB^6NCR^q{?r(cJ0lEOiNZ1P5LN%E6O9##woX5wUnZVV0+52Fz?r0mB zZL&<0rGC5EkGL10`rl4c_5Q3al8Ie*S~ogkExn6p_}S}1UdeXv0Tq39P1vU^S##+; zYGnP=Gpr021p^70f@ Date: Tue, 31 Jul 2018 04:40:18 -0700 Subject: [PATCH 44/97] Revert "Optimize drawing code + add examples how to round corners (#996)" (#1055) This reverts commit eb4c21c54540d2c1c0b63a6b0665a77fea810e6c. --- AsyncDisplayKit.xcodeproj/project.pbxproj | 16 ++-- CHANGELOG.md | 2 +- Source/ASDisplayNode.mm | 55 ++++++------ Source/ASImageNode.mm | 38 ++------- Source/Base/ASBaseDefines.h | 2 +- Source/Details/CoreGraphics+ASConvenience.h | 9 +- Source/Details/CoreGraphics+ASConvenience.m | 19 +++++ Source/Details/CoreGraphics+ASConvenience.mm | 64 -------------- Source/Layout/ASDimension.h | 10 +-- Source/Layout/ASDimension.mm | 2 +- Source/Private/ASDisplayNode+AsyncDisplay.mm | 78 +++++------------- ...Convenience.mm => UIImage+ASConvenience.m} | 48 ++++------- Source/tvOS/ASControlNode+tvOS.m | 8 +- Source/tvOS/ASImageNode+tvOS.m | 4 +- .../testRoundedCornerBlock@2x.png | Bin 11609 -> 0 bytes examples/ASDKgram/Sample/PhotoCellNode.m | 4 +- 16 files changed, 109 insertions(+), 250 deletions(-) create mode 100644 Source/Details/CoreGraphics+ASConvenience.m delete mode 100644 Source/Details/CoreGraphics+ASConvenience.mm rename Source/{UIImage+ASConvenience.mm => UIImage+ASConvenience.m} (86%) delete mode 100644 Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index d3e26159d1..3c66687060 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -109,7 +109,7 @@ 509E68631B3AEDB4009B9150 /* ASCollectionViewLayoutController.h in Headers */ = {isa = PBXBuildFile; fileRef = 205F0E1B1B373A2C007741D0 /* ASCollectionViewLayoutController.h */; }; 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E1C1B373A2C007741D0 /* ASCollectionViewLayoutController.m */; }; 509E68651B3AEDC5009B9150 /* CoreGraphics+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.mm in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */; }; + 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */; }; 636EA1A41C7FF4EC00EE152F /* NSArray+Diffing.mm in Sources */ = {isa = PBXBuildFile; fileRef = DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */; }; 636EA1A51C7FF4EF00EE152F /* ASDefaultPlayButton.m in Sources */ = {isa = PBXBuildFile; fileRef = AEB7B0191C5962EA00662EF4 /* ASDefaultPlayButton.m */; }; 680346941CE4052A0009FEB4 /* ASNavigationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 68FC85DC1CE29AB700EDD713 /* ASNavigationController.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -176,7 +176,7 @@ 7AB338671C55B3460055FDE8 /* ASRelativeLayoutSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A06A7391C35F08800FE8DAA /* ASRelativeLayoutSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; 7AB338691C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */; }; 8021EC1D1D2B00B100799119 /* UIImage+ASConvenience.h in Headers */ = {isa = PBXBuildFile; fileRef = 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */; }; + 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.m in Sources */ = {isa = PBXBuildFile; fileRef = 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */; }; 81E95C141D62639600336598 /* ASTextNodeSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.m */; }; 83A7D95B1D44547700BF333E /* ASWeakMap.m in Sources */ = {isa = PBXBuildFile; fileRef = 83A7D9591D44542100BF333E /* ASWeakMap.m */; }; 83A7D95C1D44548100BF333E /* ASWeakMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A7D9581D44542100BF333E /* ASWeakMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -621,7 +621,7 @@ 205F0E1B1B373A2C007741D0 /* ASCollectionViewLayoutController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionViewLayoutController.h; sourceTree = ""; }; 205F0E1C1B373A2C007741D0 /* ASCollectionViewLayoutController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASCollectionViewLayoutController.m; sourceTree = ""; }; 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CoreGraphics+ASConvenience.h"; sourceTree = ""; }; - 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "CoreGraphics+ASConvenience.mm"; sourceTree = ""; }; + 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CoreGraphics+ASConvenience.m"; sourceTree = ""; }; 242995D21B29743C00090100 /* ASBasicImageDownloaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASBasicImageDownloaderTests.m; sourceTree = ""; }; 2538B6F21BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ASCollectionViewFlowLayoutInspectorTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 254C6B511BF8FE6D003EC431 /* ASTextKitTruncationTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTextKitTruncationTests.mm; sourceTree = ""; }; @@ -734,7 +734,7 @@ 7A06A7391C35F08800FE8DAA /* ASRelativeLayoutSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRelativeLayoutSpec.h; sourceTree = ""; }; 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRelativeLayoutSpecSnapshotTests.mm; sourceTree = ""; }; 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ASConvenience.h"; sourceTree = ""; }; - 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "UIImage+ASConvenience.mm"; sourceTree = ""; }; + 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ASConvenience.m"; sourceTree = ""; }; 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASTextNodeSnapshotTests.m; sourceTree = ""; }; 81EE384D1C8E94F000456208 /* ASRunLoopQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASRunLoopQueue.h; path = ../ASRunLoopQueue.h; sourceTree = ""; }; 81EE384E1C8E94F000456208 /* ASRunLoopQueue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ASRunLoopQueue.mm; path = ../ASRunLoopQueue.mm; sourceTree = ""; }; @@ -1234,7 +1234,7 @@ 68FC85E81CE29C7D00EDD713 /* ASVisibilityProtocols.m */, 6BDC61F51978FEA400E50D21 /* AsyncDisplayKit.h */, 8021EC1A1D2B00B100799119 /* UIImage+ASConvenience.h */, - 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.mm */, + 8021EC1B1D2B00B100799119 /* UIImage+ASConvenience.m */, CC55A70B1E529FA200594372 /* UIResponder+AsyncDisplayKit.h */, CC55A70C1E529FA200594372 /* UIResponder+AsyncDisplayKit.m */, ); @@ -1422,7 +1422,7 @@ CC3B20871C3F7A5400798563 /* ASWeakSet.h */, CC3B20881C3F7A5400798563 /* ASWeakSet.m */, 205F0E1F1B376416007741D0 /* CoreGraphics+ASConvenience.h */, - 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.mm */, + 205F0E201B376416007741D0 /* CoreGraphics+ASConvenience.m */, DBC452D91C5BF64600B16017 /* NSArray+Diffing.h */, DBC452DA1C5BF64600B16017 /* NSArray+Diffing.mm */, CC4981BA1D1C7F65004E13CC /* NSIndexSet+ASHelpers.h */, @@ -2405,7 +2405,7 @@ CCA282C51E9EAE630037E8B7 /* ASLayerBackingTipProvider.m in Sources */, 509E68641B3AEDB7009B9150 /* ASCollectionViewLayoutController.m in Sources */, B35061F91B010EFD0018CF92 /* ASControlNode.mm in Sources */, - 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.mm in Sources */, + 8021EC1F1D2B00B100799119 /* UIImage+ASConvenience.m in Sources */, CCAA0B80206ADBF30057B336 /* ASRecursiveUnfairLock.m in Sources */, CCBDDD0620C62A2D00CBA922 /* ASMainThreadDeallocation.mm in Sources */, B35062181B010EFD0018CF92 /* ASDataController.mm in Sources */, @@ -2504,7 +2504,7 @@ 6959433F1D70815300B0EE1F /* ASDisplayNodeLayout.mm in Sources */, 68355B3E1CB57A60001D4E68 /* ASPINRemoteImageDownloader.m in Sources */, CC034A141E649F1300626263 /* AsyncDisplayKit+IGListKitMethods.m in Sources */, - 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.mm in Sources */, + 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */, 254C6B871BF94F8A003EC431 /* ASTextKitEntityAttribute.m in Sources */, 34566CB31BC1213700715E6B /* ASPhotosFrameworkImageRequest.m in Sources */, 254C6B831BF94F8A003EC431 /* ASTextKitCoreTextAdditions.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be5334b2d..90f87a2899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) - Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) - Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) -- Optimize drawing code + add examples how to round corners. [Michael Schneider](https://github.com/maicki) + ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 0fa7a9eb60..347d41c42c 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -53,7 +53,6 @@ #import #import #import -#import // Conditionally time these scopes to our debug ivars (only exist in debug/profile builds) #if TIME_DISPLAYNODE_OPS @@ -1509,7 +1508,7 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS __instanceLock__.lock(); if (_placeholderLayer.superlayer && !placeholderShouldPersist) { void (^cleanupBlock)() = ^{ - [self->_placeholderLayer removeFromSuperlayer]; + [_placeholderLayer removeFromSuperlayer]; }; if (_placeholderFadeDuration > 0.0 && ASInterfaceStateIncludesVisible(self.interfaceState)) { @@ -1667,29 +1666,24 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock) CGSize size = CGSizeMake(radius + 1, radius + 1); ASGraphicsBeginImageContextWithOptions(size, NO, self.contentsScaleForDisplay); - CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextRef ctx = UIGraphicsGetCurrentContext(); if (isRight == YES) { - CGContextTranslateCTM(context, -radius + 1, 0); + CGContextTranslateCTM(ctx, -radius + 1, 0); } if (isTop == YES) { - CGContextTranslateCTM(context, 0, -radius + 1); + CGContextTranslateCTM(ctx, 0, -radius + 1); } - - CGMutablePathRef roundedPath = CGPathCreateMutable(); - CGPathRef addedPath = ASCGRoundedPathCreate(CGRectMake(0, 0, radius * 2, radius * 2), radius); - CGPathAddPath(roundedPath, NULL, addedPath); - CGPathAddRect(roundedPath, NULL, CGRectMake(-1, -1, radius * 2 + 1, radius * 2 + 1)); - CGContextAddPath(context, roundedPath); - CGContextSetFillColorWithColor(context, backgroundColor.CGColor); - CGContextEOFillPath(context); - - // No lock needed, as _clipCornerLayers is only modified on the main thread. - _clipCornerLayers[idx].contents = (id)(ASGraphicsGetImageAndEndCurrentContext().CGImage); - _clipCornerLayers[idx].bounds = CGRectMake(0.0, 0.0, size.width, size.height); - _clipCornerLayers[idx].anchorPoint = CGPointMake(isRight ? 1.0 : 0.0, isTop ? 1.0 : 0.0); + UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, radius * 2, radius * 2) cornerRadius:radius]; + [roundedRect setUsesEvenOddFillRule:YES]; + [roundedRect appendPath:[UIBezierPath bezierPathWithRect:CGRectMake(-1, -1, radius * 2 + 1, radius * 2 + 1)]]; + [backgroundColor setFill]; + [roundedRect fill]; - CGPathRelease(addedPath); - CGPathRelease(roundedPath); + // No lock needed, as _clipCornerLayers is only modified on the main thread. + CALayer *clipCornerLayer = _clipCornerLayers[idx]; + clipCornerLayer.contents = (id)(ASGraphicsGetImageAndEndCurrentContext().CGImage); + clipCornerLayer.bounds = CGRectMake(0.0, 0.0, size.width, size.height); + clipCornerLayer.anchorPoint = CGPointMake(isRight ? 1.0 : 0.0, isTop ? 1.0 : 0.0); } [self _layoutClipCornersIfNeeded]; }); @@ -1874,10 +1868,7 @@ static void _recursivelySetDisplaySuspended(ASDisplayNode *node, CALayer *layer, [self displayDidFinish]; } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)displayWillStart {} -#pragma clang diagnostic pop - (void)displayWillStartAsynchronously:(BOOL)asynchronously { ASDisplayNodeAssertMainThread(); @@ -2988,11 +2979,11 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (ASInterfaceStateIncludesVisible(self.pendingInterfaceState)) { void(^exitVisibleInterfaceState)(void) = ^{ // This block intentionally retains self. - self->__instanceLock__.lock(); - unsigned isStillInHierarchy = self->_flags.isInHierarchy; - BOOL isVisible = ASInterfaceStateIncludesVisible(self->_pendingInterfaceState); - ASInterfaceState newState = (self->_pendingInterfaceState & ~ASInterfaceStateVisible); - self->__instanceLock__.unlock(); + __instanceLock__.lock(); + unsigned isStillInHierarchy = _flags.isInHierarchy; + BOOL isVisible = ASInterfaceStateIncludesVisible(_pendingInterfaceState); + ASInterfaceState newState = (_pendingInterfaceState & ~ASInterfaceStateVisible); + __instanceLock__.unlock(); if (!isStillInHierarchy && isVisible) { #if ENABLE_NEW_EXIT_HIERARCHY_BEHAVIOR if (![self supportsRangeManagedInterfaceState]) { @@ -3151,8 +3142,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [self setDisplaySuspended:YES]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(self->__instanceLock__); - if (ASInterfaceStateIncludesDisplay(self->_interfaceState) == NO) { + ASDN::MutexLocker l(__instanceLock__); + if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { [self clearContents]; } }); @@ -3169,8 +3160,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [[self asyncLayer] cancelAsyncDisplay]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(self->__instanceLock__); - if (ASInterfaceStateIncludesDisplay(self->_interfaceState) == NO) { + ASDN::MutexLocker l(__instanceLock__); + if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { [self clearContents]; } }); diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 3740991360..d060d8993e 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -737,43 +737,19 @@ asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat { return ^(UIImage *originalImage) { ASGraphicsBeginImageContextWithOptions(originalImage.size, NO, originalImage.scale); - - CGContextRef context = UIGraphicsGetCurrentContext(); + UIBezierPath *roundOutline = [UIBezierPath bezierPathWithOvalInRect:(CGRect){CGPointZero, originalImage.size}]; - CGRect rect = (CGRect){CGPointZero, originalImage.size}; - CGMutablePathRef path = CGPathCreateMutable(); - - CGPathAddEllipseInRect(path, NULL, rect); - CGContextAddPath(context, path); - // Make the image round - CGContextClip(context); - - // Although drawAtPoint:blendMode: would consider the CTM already, we are using CGContext* functions for drawing - // the image instead calling drawAtPoint:blendMode. This will save use 50% of retain calls for the image - CGContextSetBlendMode(context, kCGBlendModeCopy); - CGContextTranslateCTM(context, 0, CGRectGetMaxY(rect) + CGRectGetMinY(rect)); - CGContextScaleCTM(context, originalImage.scale, -originalImage.scale); - CGContextSetAlpha(context, 1.0); - CGContextDrawImage(context, rect, originalImage.CGImage); + [roundOutline addClip]; - CGPathRelease(path); + // Draw the original image + [originalImage drawAtPoint:CGPointZero blendMode:kCGBlendModeCopy alpha:1]; // Draw a border on top. if (borderWidth > 0.0) { - // Begin a new path for the border - CGContextBeginPath(context); - - CGFloat strokeThickness = borderWidth; - CGFloat strokeInset = floor((strokeThickness + 1.0f) / 2.0f) - 1.0f; - CGPathRef path = CGPathCreateWithEllipseInRect(CGRectInset(rect, strokeInset, strokeInset), NULL); - CGContextAddPath(context, path); - - CGContextSetStrokeColorWithColor(context, borderColor.CGColor); - CGContextSetLineWidth(context, borderWidth); - CGContextStrokePath(context); - - CGPathRelease(path); + [borderColor setStroke]; + [roundOutline setLineWidth:borderWidth]; + [roundOutline stroke]; } return ASGraphicsGetImageAndEndCurrentContext(); diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index b3543ced68..2fabc0dde5 100755 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -130,7 +130,7 @@ #endif #endif -#define AS_OVERLOADABLE __attribute__((overloadable)) +#define ASOVERLOADABLE __attribute__((overloadable)) #if __has_attribute(noescape) diff --git a/Source/Details/CoreGraphics+ASConvenience.h b/Source/Details/CoreGraphics+ASConvenience.h index 6229d4ad2d..9eeef3192f 100644 --- a/Source/Details/CoreGraphics+ASConvenience.h +++ b/Source/Details/CoreGraphics+ASConvenience.h @@ -17,8 +17,8 @@ #import +#import #import -#import #import @@ -56,11 +56,4 @@ ASDISPLAYNODE_INLINE BOOL CGSizeEqualToSizeWithIn(CGSize size1, CGSize size2, CG return fabs(size1.width - size2.width) < delta && fabs(size1.height - size2.height) < delta; }; -AS_OVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN CGPathRef ASCGRoundedPathCreate(CGRect rect, UIRectCorner corners, CGSize cornerRadii); - -AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT CGPathRef ASCGRoundedPathCreate(CGRect rect, CGFloat cornerRadius) { - return ASCGRoundedPathCreate(rect, UIRectCornerAllCorners, CGSizeMake(cornerRadius, cornerRadius)); -} - - NS_ASSUME_NONNULL_END diff --git a/Source/Details/CoreGraphics+ASConvenience.m b/Source/Details/CoreGraphics+ASConvenience.m new file mode 100644 index 0000000000..92169ffe4e --- /dev/null +++ b/Source/Details/CoreGraphics+ASConvenience.m @@ -0,0 +1,19 @@ +// +// CoreGraphics+ASConvenience.m +// 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 /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/Source/Details/CoreGraphics+ASConvenience.mm b/Source/Details/CoreGraphics+ASConvenience.mm deleted file mode 100644 index 2a3b6b84ec..0000000000 --- a/Source/Details/CoreGraphics+ASConvenience.mm +++ /dev/null @@ -1,64 +0,0 @@ -// -// CoreGraphics+ASConvenience.m -// 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 /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 - -AS_OVERLOADABLE CGPathRef ASCGRoundedPathCreate(CGRect rect, UIRectCorner corners, CGSize cornerRadii) { - CGMutablePathRef path = CGPathCreateMutable(); - - const CGPoint topLeft = rect.origin; - const CGPoint topRight = CGPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect)); - const CGPoint bottomRight = CGPointMake(CGRectGetMaxX(rect), CGRectGetMaxY(rect)); - const CGPoint bottomLeft = CGPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect)); - - if (corners & UIRectCornerTopLeft) { - CGPathMoveToPoint(path, NULL, topLeft.x+cornerRadii.width, topLeft.y); - } else { - CGPathMoveToPoint(path, NULL, topLeft.x, topLeft.y); - } - - if (corners & UIRectCornerTopRight) { - CGPathAddLineToPoint(path, NULL, topRight.x-cornerRadii.width, topRight.y); - CGPathAddCurveToPoint(path, NULL, topRight.x, topRight.y, topRight.x, topRight.y+cornerRadii.height, topRight.x, topRight.y+cornerRadii.height); - } else { - CGPathAddLineToPoint(path, NULL, topRight.x, topRight.y); - } - - if (corners & UIRectCornerBottomRight) { - CGPathAddLineToPoint(path, NULL, bottomRight.x, bottomRight.y-cornerRadii.height); - CGPathAddCurveToPoint(path, NULL, bottomRight.x, bottomRight.y, bottomRight.x-cornerRadii.width, bottomRight.y, bottomRight.x-cornerRadii.width, bottomRight.y); - } else { - CGPathAddLineToPoint(path, NULL, bottomRight.x, bottomRight.y); - } - - if (corners & UIRectCornerBottomLeft) { - CGPathAddLineToPoint(path, NULL, bottomLeft.x+cornerRadii.width, bottomLeft.y); - CGPathAddCurveToPoint(path, NULL, bottomLeft.x, bottomLeft.y, bottomLeft.x, bottomLeft.y-cornerRadii.height, bottomLeft.x, bottomLeft.y-cornerRadii.height); - } else { - CGPathAddLineToPoint(path, NULL, bottomLeft.x, bottomLeft.y); - } - - if (corners & UIRectCornerTopLeft) { - CGPathAddLineToPoint(path, NULL, topLeft.x, topLeft.y+cornerRadii.height); - CGPathAddCurveToPoint(path, NULL, topLeft.x, topLeft.y, topLeft.x+cornerRadii.width, topLeft.y, topLeft.x+cornerRadii.width, topLeft.y); - } else { - CGPathAddLineToPoint(path, NULL, topLeft.x, topLeft.y); - } - - CGPathCloseSubpath(path); - return path; -} diff --git a/Source/Layout/ASDimension.h b/Source/Layout/ASDimension.h index ffe6138b5f..462406eedb 100644 --- a/Source/Layout/ASDimension.h +++ b/Source/Layout/ASDimension.h @@ -94,7 +94,7 @@ AS_EXTERN ASDimension const ASDimensionAuto; /** * Returns a dimension with the specified type and value. */ -AS_OVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit unit, CGFloat value) +ASOVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit unit, CGFloat value) { if (unit == ASDimensionUnitAuto ) { ASDisplayNodeCAssert(value == 0, @"ASDimension auto value must be 0."); @@ -112,7 +112,7 @@ AS_OVERLOADABLE ASDISPLAYNODE_INLINE ASDimension ASDimensionMake(ASDimensionUnit /** * Returns a dimension with the specified points value. */ -AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensionMake(CGFloat points) +ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensionMake(CGFloat points) { return ASDimensionMake(ASDimensionUnitPoints, points); } @@ -122,7 +122,7 @@ AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASDimension ASDimensi * Examples: ASDimensionMake(@"50%") = ASDimensionMake(ASDimensionUnitFraction, 0.5) * ASDimensionMake(@"0.5pt") = ASDimensionMake(ASDimensionUnitPoints, 0.5) */ -AS_OVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN ASDimension ASDimensionMake(NSString *dimension); +ASOVERLOADABLE AS_WARN_UNUSED_RESULT AS_EXTERN ASDimension ASDimensionMake(NSString *dimension); /** * Returns a dimension with the specified points value. @@ -244,7 +244,7 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASSizeRangeHasSignificantArea(AS /** * Creates an ASSizeRange with provided min and max size. */ -AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize min, CGSize max) +ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize min, CGSize max) { ASDisplayNodeCAssertPositiveReal(@"Range min width", min.width); ASDisplayNodeCAssertPositiveReal(@"Range min height", min.height); @@ -263,7 +263,7 @@ AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRan /** * Creates an ASSizeRange with provided size as both min and max. */ -AS_OVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize exactSize) +ASOVERLOADABLE ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT ASSizeRange ASSizeRangeMake(CGSize exactSize) { return ASSizeRangeMake(exactSize, exactSize); } diff --git a/Source/Layout/ASDimension.mm b/Source/Layout/ASDimension.mm index a27226dda1..4fd0e18001 100644 --- a/Source/Layout/ASDimension.mm +++ b/Source/Layout/ASDimension.mm @@ -25,7 +25,7 @@ ASDimension const ASDimensionAuto = {ASDimensionUnitAuto, 0}; -AS_OVERLOADABLE ASDimension ASDimensionMake(NSString *dimension) +ASOVERLOADABLE ASDimension ASDimensionMake(NSString *dimension) { if (dimension.length > 0) { diff --git a/Source/Private/ASDisplayNode+AsyncDisplay.mm b/Source/Private/ASDisplayNode+AsyncDisplay.mm index 16cf9b39e6..2cf772aecf 100644 --- a/Source/Private/ASDisplayNode+AsyncDisplay.mm +++ b/Source/Private/ASDisplayNode+AsyncDisplay.mm @@ -25,7 +25,6 @@ #import #import #import -#import @interface ASDisplayNode () <_ASDisplayLayerDelegate> @@ -112,13 +111,10 @@ CGContextTranslateCTM(context, frame.origin.x, frame.origin.y); - // Support cornerRadius + //support cornerRadius if (rasterizingFromAscendent && clipsToBounds) { if (cornerRadius) { - CGPathRef cornerRadiusPath = ASCGRoundedPathCreate(bounds, cornerRadius); - CGContextAddPath(context, cornerRadiusPath); - CGContextClip(context); - CGPathRelease(cornerRadiusPath); + [[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:cornerRadius] addClip]; } else { CGContextClipToRect(context, bounds); } @@ -131,18 +127,13 @@ CGContextFillRect(context, bounds); } - // If there is a display block, call it to get the image, then copy the image into the current context (which - // is the rasterized container's backing store). + // If there is a display block, call it to get the image, then copy the image into the current context (which is the rasterized container's backing store). if (displayBlock) { UIImage *image = (UIImage *)displayBlock(); if (image) { BOOL opaque = ASImageAlphaInfoIsOpaque(CGImageGetAlphaInfo(image.CGImage)); CGBlendMode blendMode = opaque ? kCGBlendModeCopy : kCGBlendModeNormal; - CGContextSetBlendMode(context, blendMode); - CGContextTranslateCTM(context, 0, CGRectGetMaxY(bounds) + CGRectGetMinY(bounds)); - CGContextScaleCTM(context, 1, -1); - CGContextSetAlpha(context, 1.0); - CGContextDrawImage(context, bounds, image.CGImage); + [image drawInRect:bounds blendMode:blendMode alpha:1]; } } }; @@ -304,10 +295,7 @@ ASDisplayNodeAssert(context == UIGraphicsGetCurrentContext(), @"context is expected to be pushed on UIGraphics stack %@", self); // TODO: This clip path should be removed if we are rasterizing. CGRect boundingBox = CGContextGetClipBoundingBox(context); - CGPathRef cornerRadiusPath = ASCGRoundedPathCreate(boundingBox, cornerRadius); - CGContextAddPath(context, cornerRadiusPath); - CGContextClip(context); - CGPathRelease(cornerRadiusPath); + [[UIBezierPath bezierPathWithRoundedRect:boundingBox cornerRadius:cornerRadius] addClip]; } if (willDisplayNodeContentWithRenderingContext) { @@ -344,58 +332,34 @@ CGFloat white = 0.0f, alpha = 0.0f; [backgroundColor getWhite:&white alpha:&alpha]; ASGraphicsBeginImageContextWithOptions(bounds.size, (alpha == 1.0f), contentsScale); - context = UIGraphicsGetCurrentContext(); [*image drawInRect:bounds]; } else { bounds = CGContextGetClipBoundingBox(context); } ASDisplayNodeAssert(UIGraphicsGetCurrentContext(), @"context is expected to be pushed on UIGraphics stack %@", self); - - CGContextSaveGState(context); - CGMutablePathRef roundedHole = CGPathCreateMutable(); - CGPathAddRect(roundedHole, NULL, bounds); - - CGPathRef additionalPath = ASCGRoundedPathCreate(bounds, cornerRadius * contentsScale); - CGPathAddPath(roundedHole, NULL, additionalPath); - - CGContextAddPath(context, roundedHole); + UIBezierPath *roundedHole = [UIBezierPath bezierPathWithRect:bounds]; + [roundedHole appendPath:[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:cornerRadius * contentsScale]]; + roundedHole.usesEvenOddFillRule = YES; + + UIBezierPath *roundedPath = nil; + if (borderWidth > 0.0f) { // Don't create roundedPath and stroke if borderWidth is 0.0 + CGFloat strokeThickness = borderWidth * contentsScale; + CGFloat strokeInset = ((strokeThickness + 1.0f) / 2.0f) - 1.0f; + roundedPath = [UIBezierPath bezierPathWithRoundedRect:CGRectInset(bounds, strokeInset, strokeInset) + cornerRadius:_cornerRadius * contentsScale]; + roundedPath.lineWidth = strokeThickness; + [[UIColor colorWithCGColor:borderColor] setStroke]; + } // Punch out the corners by copying the backgroundColor over them. // This works for everything from clearColor to opaque colors. - CGContextSetFillColorWithColor(context, backgroundColor.CGColor); + [backgroundColor setFill]; + [roundedHole fillWithBlendMode:kCGBlendModeCopy alpha:1.0f]; - CGContextSetAlpha(context, 1.0); - CGContextSetBlendMode(context, kCGBlendModeCopy); - CGContextEOFillPath(context); - - CGPathRelease(additionalPath); - CGPathRelease(roundedHole); + [roundedPath stroke]; // Won't do anything if borderWidth is 0 and roundedPath is nil. - CGContextRestoreGState(context); - - // Drawing borders with ASCornerRoundingTypePrecomposited set has some problems at the moment. If the borderWidth is - // set, besides we are drawing the border with the given corner radius, the CALayer also picks up the borderWidth - // value and draws the border without the cornerRadius. - if (borderWidth > 0.0f) { // Don't create roundedPath and stroke if borderWidth is 0.0 - CGContextSaveGState(context); - - CGFloat strokeThickness = borderWidth * contentsScale; - CGFloat strokeInset = ((strokeThickness + 1.0f) / 2.0f) - 1.0f; - CGPathRef roundedPath = ASCGRoundedPathCreate(CGRectInset(bounds, strokeInset, strokeInset), _cornerRadius * contentsScale); - CGContextAddPath(context, roundedPath); - - CGContextSetLineWidth(context, strokeThickness); - CGContextSetStrokeColorWithColor(context, borderColor); - - CGContextStrokePath(context); - - CGPathRelease(roundedPath); - - CGContextRestoreGState(context); - } - if (*image) { *image = ASGraphicsGetImageAndEndCurrentContext(); } diff --git a/Source/UIImage+ASConvenience.mm b/Source/UIImage+ASConvenience.m similarity index 86% rename from Source/UIImage+ASConvenience.mm rename to Source/UIImage+ASConvenience.m index 84e87b0fc0..c1d0751e39 100644 --- a/Source/UIImage+ASConvenience.mm +++ b/Source/UIImage+ASConvenience.m @@ -19,7 +19,6 @@ #import #import #import -#import #pragma mark - ASDKFastImageNamed @@ -115,9 +114,9 @@ UIImage *cachedImageNamed(NSString *imageName, UITraitCollection *traitCollectio // UIBezierPath objects are fairly small and these are equally sized. 20 should be plenty for many different parameters. __pathCache.countLimit = 20; }); - + // Treat clear background color as no background color - if (CGColorGetAlpha(cornerColor.CGColor) == 0) { + if ([cornerColor isEqual:[UIColor clearColor]]) { cornerColor = nil; } @@ -141,46 +140,33 @@ UIImage *cachedImageNamed(NSString *imageName, UITraitCollection *traitCollectio // We should probably check if the background color has any alpha component but that // might be expensive due to needing to check mulitple color spaces. ASGraphicsBeginImageContextWithOptions(bounds.size, cornerColor != nil, scale); - - CGContextRef context = UIGraphicsGetCurrentContext(); - - // Draw Corners + BOOL contextIsClean = YES; if (cornerColor) { contextIsClean = NO; - - CGContextSetFillColorWithColor(context, cornerColor.CGColor); + [cornerColor setFill]; // Copy "blend" mode is extra fast because it disregards any value currently in the buffer and overrides directly. - CGContextSetBlendMode(context, kCGBlendModeCopy); - CGContextFillRect(context, bounds); + UIRectFillUsingBlendMode(bounds, kCGBlendModeCopy); } - - // Draw fill + BOOL canUseCopy = contextIsClean || (CGColorGetAlpha(fillColor.CGColor) == 1); - CGContextSetFillColorWithColor(context, fillColor.CGColor); - CGContextSetBlendMode(context, canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal); - CGContextSetAlpha(context, 1.0); - CGContextAddPath(context, path.CGPath); - CGContextFillPath(context); - - // Add a border + [fillColor setFill]; + [path fillWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1]; + if (borderColor) { + [borderColor setStroke]; + // Inset border fully inside filled path (not halfway on each side of path) CGRect strokeRect = CGRectInset(bounds, borderWidth / 2.0, borderWidth / 2.0); - + // It is rarer to have a stroke path, and our cache key only handles rounded rects for the exact-stretchable // size calculated by cornerRadius, so we won't bother caching this path. Profiling validates this decision. - CGPathRef strokePath = ASCGRoundedPathCreate(strokeRect, roundedCorners, cornerRadii); - - CGContextSetStrokeColorWithColor(context, borderColor.CGColor); - CGContextSetLineWidth(context, borderWidth); - CGContextSetAlpha(context, 1.0); + UIBezierPath *strokePath = [UIBezierPath bezierPathWithRoundedRect:strokeRect + byRoundingCorners:roundedCorners + cornerRadii:cornerRadii]; + [strokePath setLineWidth:borderWidth]; BOOL canUseCopy = (CGColorGetAlpha(borderColor.CGColor) == 1); - CGContextSetBlendMode(context, (canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal)); - CGContextAddPath(context, strokePath); - CGContextStrokePath(context); - - CGPathRelease(strokePath); + [strokePath strokeWithBlendMode:(canUseCopy ? kCGBlendModeCopy : kCGBlendModeNormal) alpha:1]; } UIImage *result = ASGraphicsGetImageAndEndCurrentContext(); diff --git a/Source/tvOS/ASControlNode+tvOS.m b/Source/tvOS/ASControlNode+tvOS.m index c18b67eec8..77e5418629 100644 --- a/Source/tvOS/ASControlNode+tvOS.m +++ b/Source/tvOS/ASControlNode+tvOS.m @@ -83,9 +83,7 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 12.0; layer.shadowOpacity = 0.45; - CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); - layer.shadowPath = shadowPath; - CGPathRelease(shadowPath); + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; } - (void)setDefaultFocusAppearance @@ -95,9 +93,7 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 0; layer.shadowOpacity = 0; - CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); - layer.shadowPath = shadowPath; - CGPathRelease(shadowPath); + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; self.view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); } @end diff --git a/Source/tvOS/ASImageNode+tvOS.m b/Source/tvOS/ASImageNode+tvOS.m index 8f8486b941..9482fdc8c1 100644 --- a/Source/tvOS/ASImageNode+tvOS.m +++ b/Source/tvOS/ASImageNode+tvOS.m @@ -169,9 +169,7 @@ layer.shadowColor = [UIColor blackColor].CGColor; layer.shadowRadius = 12.0; layer.shadowOpacity = 0.45; - CGPathRef shadowPath = CGPathCreateWithRect(self.layer.bounds, NULL); - layer.shadowPath = shadowPath; - CGPathRelease(shadowPath); + layer.shadowPath = [UIBezierPath bezierPathWithRect:self.layer.bounds].CGPath; view.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.25, 1.25); } diff --git a/Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png b/Tests/ReferenceImages_iOS_10/ASImageNodeSnapshotTests/testRoundedCornerBlock@2x.png deleted file mode 100644 index c4686232a23cb980c70b44339427ddfa81412562..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11609 zcmZv?1yqz>_dbk(ASDP=QcBkdBA|4)G(!!I^nfBI-5@R9EzQ8tFqDKKNY?;Er!a&_ z_kZy5dEVdp);DY2b0*H-``UY-bME_G`-G{f$PwT^!9_zuBT$f+)U0y@mRM^Il%h2@Q>m>F&CxpuzYH^&_>7w5k@WMMqtCueYd+^>2&% zOcpz+JaU9;4Hcv%v_9V3$;AGs1-uCLWes0}{p_S?{iLPd9S~gnY5FHl0Ol4H_JHj1 zk6H1ksCEsVn{C_*4W>``p9RR1Yr_=d>1Ei)4735vFYH{o{wri=bNsJ1vWr;kuPA@iw;Lz=_cNGUT?aK{w zU9G}_RtImg28BM7@2|~&@vr^NJSO{uP$+Ou*2>?DQ_b2BMz&Qn5szI83^TRW=aGVE z^BKDImuqf)u+yp?Ej>}iR}Wo~nl#`x?bq{# zzUI?{+-s6AVYRWcV~S}Cm(~S0Gh_N0!m+P@_~v?nm)cy(z9Y~L336^cT6)mteOHOD z*S|T}QS!>XdUKgvkyRtHu5GWrRfo_r8)wdJaxbiyc_DG^L-9o=)fe9C2}3rOx0krN z%C)86`?wbpSE@Wrl(1WqqAwQ{L zyA!dB0_J(!iAD|ud+3>-dlYqz?zQ@hsBgu~wwDLGe1<|2QT)Sj3%zV)T&wXZ_ z4;M6F4!50pY`@sY5m|MavNOUaICx^);+D_s$#;~hW2ofyC}9$7-`RVgbUbE3;bMj( zkFyeb;?c_i|6h^=KYjeaVO7Aed8Yg&iZ@Ps?9FUw$zb<0+hmoj?^N!Lm20Uj<``hp zLPx$ITwaVP?PJbz>Ky9Ghhv8J3+gqGNG43Ko&b$bqWU2-Io0VpCBN$%CfE;wE;CNq z7yGS-w*!!T8zbex<9@qL!gp-;2SX#;m5n#vXg6ZEMLJr|t?_le*f-J^my+UWy=+Uq zxNJWUVq1*8CE-%-tF)rR7ze-ZhN2|>%H2qO%8D9^3LG}fySHk|^9+-=9VWxK_jJQHNub)$xW%QAL1NTNx;6a5AyE zd_G%5N9W@d+2~WfQL>x#;dY_HdtYc0GBHg|(M!G+zdPc}xN#rC(w% zFXaA|Yb~rrz4^1w?>7ro_v*hgPh(M;a)3j2Gvrs4ID!XqS&p@vHNg`_3Eut6W6C-) zIv?U2CN2!AMpOCZbgo~k>R1j!i6_%2eLy!3tviOL!A2I|>s_P|+jQHb-+yOtXBs{- zhyG7-{je*+4^t&@xIFl{F1_tpjZ!zQ{N#wjhk*N1pWl5 zVymAQ)1of>#ApDsUoaDo^`Gi^t7TdGM60&m1@CfBNOq9St9Y%leMClJDw4Z*aa{z$ z(rU-o6{1eg5=8NvMCqrebf7YnfWK3F8XsXQ1rAfL0`T`tO;aP9pD=~<$=OVS2q(P^ zeeHSlURe%kLEMopCq0R!)z?h(>Bo&88wLfw?&Q;R==mbGy;2Nsp1q!1^v<`*jpYFc zL71H5sB&159-i=Q&0f!M-(pywA8#a~7DWKoCzWZ()+t%Y<$P>W1{P8PL zUxQnc?R|Tm!OJqE)1fJkectOO!YaWRS02^^86p(6J(klCsm$(zTJ@s7XJgu@oltRw z#EZnDkx~0YdHhEM)niVF0=PRR%>Dc0$;?^_izx)f?Ma&lH`4TY7Stt}lUO^Oot=|8 zIKuLf5Ie9rtHJsY%z*|IO>jh16(4`^$r+mQ5{Xw}3~@w1>v#J!=Q$G>A^Vis#Ec3- za#i)#3v=f~XQXh&)f>KQdp((7k6M@N;A-veUx}=Y;vH4+-6NifHJd1b702DsxjK~ z@^;VZ$ysw+c`f|xDoYK@R!=a=ipt37Uf_@BbVIc5S?{-O%qH^?W1J>U31se$>gAk8AXJ88Z-~w->N`;19^Cbx%lZ zI@=IAyhC;NkPdb~?mj2IU2oR3YK&IHHf%wdNm(!FM>1ffU=i`NucH15S$SF5&6&vR zS+0x9a>iDLob2mQn268~4e(?YdFlf$;ks~6n}4bPa^jR_d(HQh>nhC7*2{J~CND`j zS~}q5hkc2|)WP_*X=}K)SD5MnK=k=j1LBPr^*)Nhsc>lOY-xSEFOc2dD1?S4>mkFO*#LMZJ+xk7pN?;8_VC{zW6&oqYCq zamCy#YWS23*hd)KeU-I@z7wBSG`n6j6OM4S5f7v!C;zk|Wo-g81@L&GNsz&9(DGpry~GoFg<9>W!dRpx#IZnU|Hl%{9?n| zn=M7*9sHTl** z(M`EreJsdwI*IX0*Rv)N0@u4L7+U-t>9OWITITcl9{fwV@ryO!NN}0~W{TfEU8tWs zh%*arM&VDIq7by9{S1+L66$XYnk^l9NLIEL_N}ySzSDYR!6wAUtOMic*L4eNH^7Zd z;JzsunI#nonVE}Fl`ZTO6!p0M6EvL}M3K_qzK zum5x=;(TN;wy~)oc}TrKn{omd^u)=04hlG8x;N={!kWz&QeKDBVR^4|L)OZfY|@5qY|Z(@o7rj!5xMMP5_D7Ows7SevA z56l|wCNxLjFTRjmzMxil>W=elu1+l*)79ibk_m3T3Fp+51F4zJhBe6fqzY1|mxuSt z$Cl&6yl^Oq%M3U~eRr%awRZ^-M8iz&U*hH@v4TXERXAnj-y#LWldVD1lD z;-pBWjN0>={h#RuuuTWN&<$)VUQ~@M6bxR}Oy|)Ap0b15t`ajPsxBQx=$!4!GPr-E z-@LC3o^t3Qi|lwZ&_RnYyDPnNSqd8CZ^y4!$h4{NSxhQ-JJMN))d5wWhH`|o?4i`N zX?t~1lt*dyYnksWQ$z~-f7y)@?YuFII1)+y>5=p+gZvmOCY`LqJkQ6H#$e&MY)lbY zcVJt)VvgsD8^|w4Y&fbRPxOc#Z0x9-J}_e|<#?kajviK(y(&+zyys@tA8`+b-Zit6 zdZ)ugOGe3*=W}Axe(|@L(xoZ+U$T4HX2d$D`5@HO?*4{qa7krA^p6mM=|BnHpg!}q znf?u-t52bHKa)a`_L&3phG+TrUp|DgWshQ!-;CpY$>}EA6X3?OqmHnbGXu%z;`s*2 zqzG?3qQ=(Gn0y3->|qu-(?3mNdo8X@PQEpQ!$3U}+ejOpgzm}xAc7kwo!etTaMxA- zI<*Gqw5^55rZCZhJ=q)MEgisM`rz~pOUrxwuhfnW4>+gg2sgemf;)ezlRwDU&NvtE z-aChZDIIliu=@q(sQIX$lkCATgyZnP(mtYwtc?iJw8;B+;p1uS-x?_hd&G; zA>l|SimzB)mL^hobhS`pN{D6ph}o1xHfH;rF+=FpfLY0G2WzXqrD?dsv_;sj7`pdW zA2MJ25H95((BOYa;Cs`_9NEb}AbT|+O;z`M7<0`UAT(o>O7pq81`>k(I>3(BrmZvw(<+ z?;9V}H;d2f9c-!;th~+5f9OeXxY|Le8$&VnMqwE=j$s6Iv&5QKZbb zG;G&kqJM@ZZ~`Yl3i?w6rU^Gia!rkOgY~9^O?5-I(CuuMC-@3j${a#=4|T`n2;Vxr zzsj!d8gy@Llbd)|`3UEabKIO=&Jqv0hw$DA*_3Ys(+c#Rb{oqF2}^V;0P@bG@XXhF zM%20bp){Yk@tV2ue{d5ZnB%(kBSut^Wufs4n%fX6E!V)oHycFXBYqM)XpHbxN}|bL z{)fY6S~Rcids|y?=G3Y6f=fXuIJ?9yfI772psoB{jB8ipk-(!aw11%-QNa$sU(l~k zLKA{LyoP(C$!`o#EnFJpiEB4AUQ>Up(mwl&$_O_nf;b^~HPW6!ti0`0-7qd)- zqpV*%wWCs9@NB->dY2T#x7v6lDA9!`WME2>1X;TENE>$T`T)HV3k#yk(mbuE+v?E= z0d42a3=_NyM34Jz0}C}miIe9bK!UKyy@bP>=GQH`v8!%K99A9v!M2U3UEj&7t+D^u^)Nk zMz~!?HxCB)z$dbQyH<r#%x_pZ)uM7G@Co6T@P-&L7@hV`?&ix=GW zy1eV^8Q$9{_9Vj+r{w9QD-|IzZZ%MLBg2@%IJ<*BAvR4Bk)NY(=(*G*`CNZRj*HZ| zAy65v@t~%Lwzu~h5KcUN-|Rip`(n)K<94W5E}16*Z^ualqeX|{Kv!EB3x`UFDBnFMLVZCN|v{br?0B)WTrzgR0%>b z1#azkNG;=N`K`a%y?jCEX#ARI4fXdxm*^95yi1wtN}jEvOVxTj{uV@MUaiiIAutw0+UOy!g zYFpyOI}#eq8;0x_-gwTxz^Zr)_!K9goz+o=a~C8uKu#D2dTK?Qg(wgrKr&%{xa%PT z5BYd4(oz*Ck*vbQsxh)e{liq-9py3V%1C|~RJ4LHj@z546TJiF!o6BQ=8+JO61nxhQe&&;o0cs+ z!<}K@#+pGx0C5CgN9-5Mjnqpi4C{N!IRr1*cvO_BKqiZW^{Q~4vDlXH^T=+}GJK+u zdjvVb2Z|1n{Ji3B^X98g7dp3J*4rC|Ki=R32k>_cE^l`AiB=gN!-2Z z{gU1miS2|i6!5Xh{+m(LF{N!-ul?unJ>sEB@z`TkYYb9-aT04O^8_9-Ljbu8yk;iz zI1LZ5Z5tC*F2d^dKso#_DdJSsXU!1+{*eztLeGlwv6`L4GQ^3spJp%w{QcXaEuHgf zB`MnDWkYUHGZVAQQydPWq>P+@qQ?1tia%oE#?UV6!CVd-Z78(4-r+3*Hqm8wW`4jXc6lqCW+S;7Oj1|VeNzW>4wY6cJ`TdgV zvEw6D{%UhkjAnhX@jyjEssl|@nFKKm3kT9Gc^5$I{Qfo0+CYMMUIfkORm`|w=%ylM ze_UQf9(_gejXCb$q{D2{YJ)2Crg_~sjDne) z(xmR~U;ie?8pWDcXsj=xXh6aP7zvnR{{gnA^DM;)<+jY7T~;NTfU;d*cDqEn@X`Mx zE!FzR+4b$SoNo*S+7nOQ0wBmQEY2*MlAmHZ|9Fco_`FeNJut}l?Yjz&5_)3|0V=u5 zs8O^#)T?4BzWMgHef*&XX6O2~9nPg2$|-HSq+Q4Ag8Gv(gTRJ~oP&`9o2|F|KSrGyH~70!4@JF2 z;{~jS+!r^`Z`<2XXKsdX)#ZDG;Kg2z0otCu?1*^b(^W8$F4o8&KvFY;{4M&VouqaB z9OWYZe372qjo1wMfAh|x#oMBh*p*l}$5D!3`MFbtvEn`sBgQ{7U7TtbvfA}ySB4aD zs50WfLc|g+9v(P_;r~~-zU-rQSZQ#nP3)9kr_90LI*N z@oK*c$t()_HVSW#^*3VO5%_ zCpX^uTYnXE1(VqNU%O<;xy*4bHyws3yz$z{>Xs%1YdudpXaoOCeeTerC{X9txpl0I zk9RnG<3kQ6RYJ~1Hk%QzAK3`z>WZN!IY>-q7qsasNvg7MxuD{co zWODv@LHFeQ{t_kjO0H$)Y9VQ2-FccmBr(GMMt&m zYQ)m3je^ag=n+BIcgtRF?lVP7etCPjW1Y*)`J+a+(ik6M*?U366uD5sKlkrH zlegQ~POEfIKM^D!N&r2<< zDP6<%1J~Br%$(8ZYu$BE{oTch&Cvhem!`Qs_rVH}7$>uT=Q`-l>$RTFX>)Dudeaf*b?Rx}9Ba zTq1Cgw;FQ8E0wPJ6A&AWgx~0CC|pJ!OF_vlzJbfI^XPR!&xqi2kAk`ml$ob@W=v^M zYPrid<49f&_GuEnr&76S&p zCH(K%>X8WbuYGQ&tQ&uaCp-py8>wrfm6G_{85 zmdADQI!V4wzIY8_e)H1v{@?BoiDaW+;T~(+Rt*D@)Kul=(4z>-D88v-{>?(KKn&Fu zF;;rY$9K=qC>)Em@0WIf5B<;DD>S}U|Io6?Wg42zDmTq7;~f+-5^L7(cBxwlxJTUG z!3!RqSVy2_@?GAKz&){%fDnC$9984-c`-3akpVb~M9$z-;8g51M@oo2#jQ9XhFGOJoZTufkM+IO1L~1dSR!w$C z0IpXEkXjocL=lzfu*$rEo>(J>tAUb+35dA+UKdnYm9G;CyZ}*zx}=B|Kh3-STsqN7 zb^|&wHw0PLC|2m@;JxI6?3?dlvs7d4%nny0_iqD1d zLWh6mZC>4r7Gj@`lEIzT#k8c%aGR`2(m!g8JdN5K?ctA<`#5~uKJS7Id$+yUP3WRo zWFhE@bT+ivEUEl;S|$|xI`;A7*stuDL#E_^w=+(F$nWG2E_X}hY+Eb8q{B;g1gXlc z9MK7D(7q_Lv0{B#$FEN@CAIu3;Aw2_iFs~t3;KRx)f=Ocub5prwBrbK$j{9DoS7%F zNB!s(85=jD{Lr=EKf6wwX?_`MkM%3HYRV!GC1tIyBWI@PJGs~|=_c`fe1{+rn3sJ9 zMEaH#7CZOucFR!w@z9kU=xv)D=h#9IJwOnmRsbOjAQsgzKKGQ#kk61e1F}NzKqf=%!K$5ciMu(y{mdfCBs79#qNI zDuPAUYSk5~-%?T(wL;eBxsak_BA*dlD=@vPslfn+vGZw1+Xe2rS%N#MQG?AHq)*cB z1;M;y^e&>+p^m-c@(o`Nm2HcTa)d~Oad#M_wlw-5js>^uZZn->74WI;vvLH@xbnP8 zW+@iAUU zXPnVK^txq%@?r`=3p@C(?kiu-`VX1&$B;XFNTA_BTFJ_kflIyQQGH^cJslFJ1_Zc_ zx2Zgp13rzlG1LuGm=03c4W0=+$k^O3QtZW7+l*%^?K^jJ?lV&&ZNHW{#&0qw37D@F zm^B1Nzp#enE=X-Z3ivA}Ox~IM+}i1f)qs|=kkaxtkiQ|r;{Kt^IN2)`H$dN`cM23K zT?<{?4jdbV79Dr2QSR%ZhW1lU$*No!WLcM~-ngPa9pG*LebBZ^driK9QNRjfLPTat z%x}uOi21%44-qLIYvgfs6$`8Cd&OSk-1huzG@w)Rn6FPrU11Nw*wRQh5dyny5acBCzm$6VOqCykA9+N*# z#o%6rdTL6BiA~m#woL?UT9r;ci71>q46=}7%RjyW2U6Ac`oNjAo0Fkkk))g*kN+5( zYvVrYk~uE+u2AD*%H)>pbLlB_L<~;_7pG(vh*eRG%_2_!&qL}y3 zshEz!`4uzV_dzK3k~^7>a}&Y0U)y-;qsT7$20$`4*|=k$;Hkz&bAs0Wq!tNo7?L*8@-O*muqwoic*HW%v0m=uN|;4UH?9 z93=%()J!mBO@gsGb~t%M+W7ByYBS3hzivt61{DyBo*%-NVFK$6d_H4jPHpKWv$>d2 zze(Jic3~<{u}L0)KkpD|n_#(elJ3QKxhUbj>6p6xVe!VhGMV;uZV_#HcHtLSBtXS7 zb_n5`d=WwnSrMk0OF>QlB6)iAhtqzKbp0u(??~*Dlz=Njvci!EWg`#jIBWoY*GVm9 zn`S_SWmCAM!<&`vSWW7yET@702>Q3eWRa9*a}Rn?A~Vjo=6&;lwTD=VhSge|(OWLlBqT|Z(6+fX6BJq41;@E&vw*4=fXYH^sbjaix0wleXjAH)fZ?hzelS{Wpjg4ffv3zKID$ zmhd>tBBl=bSqA9`3cveF_opbSxQS!Tqpg*t+fRBK=~&mbsGOO2iUvD}@hAJX&9E~X zry)z90=0RFLBV%*m$AuW^E7?NPWicLfjr=&Yr$$2GiB>eMPQm8k`WnJS(Q-e^O(Da zqWh{DbLN1B!YlmU!3*`KGwQ`IG|sQm2IWrDQrQT&CtM*eJZ3^!C%UfjiO{t7pmW3s zbx!><`BAZsk)1)KSB4C_98BwsjBeG=EBel`?z5P5m*}~0`isNZX#n!w)VT(^a?P*x zM6%WPakJ~|%rNTAZ)igWuK;HN98_7)%C0Hfh32n#j(Cr@j8rDPGOXws{o%_=fS3$H zg$V{eWfS0p`G>Zu2(d&X_1F8Lr?EQ>XT;enpua^qe{?EPB0TR5f_yao?lSyGA!3hP z=(*h(F>qcO#Me+{ZIY58xh86+wrSaf8?F0az4fk2dcY^j#d;~=6M zZ`NlgO*$BK8WZ{6*Q;6?zu8!@y7EOM8di;q$k} z?To4qXL zg(^+j3|P?hsiqvR&X!zO7fg#+tjY7)@n|a}RI3u=)(n{hstA5w@t!(>i9zULk$kTM z(CC&qyh8SWJ!|VO5=J|4^nsET+s$$&XLmS49qf-%ZI#o?l*osHQTr_0vo!X+(>=_q zR|%)oP3u$2(b2l}$R}rhtJuGA+B*J%pdg_nTve9fWG~dun&fi+M)`Kf2L$oZTXYGc z`TU!q=s~MlZ-=8LeJKCfrb|SGoC@polXP=WFF&sTqeOSMlS zr9UF^E|=#8`~3m9{2lz$pGe<>Lw2Fh>bnc4$*BIEm@xD+1(y{NE#vZk;xX{K7Jwn2AQ4zs2-jSRh4GAo0h6Y% z6RXY0DU#k|1%*qtR~>n>yKK|oPqQsn%MY`MH0(igO~U4B+aC4g9iAG)A5XV|Vss>? zC%tSO4la+`k0n9g@xMx9^T~H z)5;ON{DxytKHKYoCq>D|VNtj<;SW<|*_Nd#;czM3n??hfkbncDprrg=uG7C7z{rIN z61=6QyS)%aE^&Us#|vTLYp0~rY;*Ol-QCvbU6Z!3V+i^1)Vk2d*4V%dY@p^Pt1wdW z<8WyiUE-|P)=daq9Der)=@%CHkzkd)0qF@1>}|=+V#I==QCpy(rW@D~0R4NWNx-o? z?7;_6l$NjGxp>zNtmwGe_QeE@(pnHqhEqWkfba69`HjLc-B0;8MQNKH~W!UO0%qzxD z+A^h)|8&V{F5a`|qnsWq2>{dLOL;1FIdS@x3iX2mx1&l({hW3MY#K4bf)H2$GcCQ4L&lor9< zj~`=Yb0%`x3|Ef1^ge&+k!c>*%KT)NPTjyT`|_m}Y3;1B>Zebi?(uwOK+8J2`X#h~ z(D2}@T;i9ZWpX1~FRhdPUPmj1*!y?=;wYe~I3^_WXu58T8y1te5(kp5ImtjRmT_ZDmgLW>$^TYoiK&Kit_bx@XN;4#TW_Yz~8h9npzE0E-o{&}Q zVKFtW2}l3UuB^6NCR^q{?r(cJ0lEOiNZ1P5LN%E6O9##woX5wUnZVV0+52Fz?r0mB zZL&<0rGC5EkGL10`rl4c_5Q3al8Ie*S~ogkExn6p_}S}1UdeXv0Tq39P1vU^S##+; zYGnP=Gpr021p^70f@ Date: Wed, 1 Aug 2018 15:52:38 -0600 Subject: [PATCH 45/97] Fix headers in markdown (#1053) --- docs/_docs/automatic-layout-basics.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_docs/automatic-layout-basics.md b/docs/_docs/automatic-layout-basics.md index 8a830b1cd4..128a1040d4 100755 --- a/docs/_docs/automatic-layout-basics.md +++ b/docs/_docs/automatic-layout-basics.md @@ -6,7 +6,7 @@ prevPage: scroll-node.html nextPage: automatic-layout-containers.html --- -##Box Model Layout +## Box Model Layout ASLayout is an automatic, asynchronous, purely Objective-C box model layout feature. It is a simplified version of CSS flex box, loosely inspired by ComponentKit’s Layout. It is designed to make your layouts extensible and reusable. @@ -14,7 +14,7 @@ ASLayout is an automatic, asynchronous, purely Objective-C box model layout feat `` instances (all ASDisplayNodes and subclasses) do not have any size or position information. Instead, Texture calls the `layoutSpecThatFits:` method with a given size constraint and the component must return a structure describing both its size, and the position and sizes of its children. -##Terminology +## Terminology The terminology is a bit confusing, so here is a brief description of all of the Texture automatic layout players: @@ -30,7 +30,7 @@ Every ASLayoutSpec must act on at least one child. The ASLayoutSpec has the resp You don’t need to be aware of **`ASLayout`** except to know that it represents a computed immutable layout tree and is returned by objects conforming to the `` protocol. -##Layout for UIKit Components: +## Layout for UIKit Components: - for UIViews that are added directly, you will still need to manually lay it out in `didLoad:` - for UIViews that are added via `[ASDisplayNode initWithViewBlock:]` or its variants, you can then include it in `layoutSpecThatFits:` From 78be342e77ec82cec5fa0e1e0b15cb172864edeb Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 2 Aug 2018 07:36:26 -0700 Subject: [PATCH 46/97] [ASTextNode2] Simplify allocWithZone: + initialize implementation #trivial (#1059) * Simplify ASTextNode2 alloc + initialize implementation * Kick the CI by marking two methods as NO_ESCAPE for Xcode 10 --- Source/ASTextNode.mm | 41 +++++++++++++++---------------------- Tests/ASDisplayLayerTests.m | 4 ++-- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 5d51adbffd..f71363d68a 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -1346,36 +1346,29 @@ static NSAttributedString *DefaultTruncationAttributedString() } #endif -+ (id)allocWithZone:(struct _NSZone *)zone +// All direct descendants of ASTextNode get their superclass replaced by ASTextNode2. ++ (void)initialize { - // If they're not experimenting, just forward. - if (!ASActivateExperimentalFeature(ASExperimentalTextNode)) { - return [super allocWithZone:zone]; - } - - // We are plain ASTextNode. Just swap in an ASTextNode2 instead. - if (self == [ASTextNode class]) { - return (ASTextNode *)[ASTextNode2 allocWithZone:zone]; - } - - // We are descended from ASTextNode. We need to change the superclass for the - // ASTextNode subclass to ASTextNode2. - // Walk up the class hierarchy until we find ASTextNode. - // Note: This may be called on multiple threads simultaneously. - Class s; - for (Class c = self; c != Nil && c != [ASTextNode class]; c = s) { - s = class_getSuperclass(c); - if (s == [ASTextNode class]) { + // Texture requires that node subclasses call [super initialize] + [super initialize]; + + if (class_getSuperclass(self) == [ASTextNode class] + && ASActivateExperimentalFeature(ASExperimentalTextNode)) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - // Direct descendent. Update superclass of c and end. - class_setSuperclass(c, [ASTextNode2 class]); + class_setSuperclass(self, [ASTextNode2 class]); #pragma clang diagnostic pop - break; - } } +} - return [super allocWithZone:zone]; +// For direct allocations of ASTextNode itself, we override allocWithZone: ++ (id)allocWithZone:(struct _NSZone *)zone +{ + if (ASActivateExperimentalFeature(ASExperimentalTextNode)) { + return (ASTextNode *)[ASTextNode2 allocWithZone:zone]; + } else { + return [super allocWithZone:zone]; + } } @end diff --git a/Tests/ASDisplayLayerTests.m b/Tests/ASDisplayLayerTests.m index 5f20e928e0..e462e0a4a6 100644 --- a/Tests/ASDisplayLayerTests.m +++ b/Tests/ASDisplayLayerTests.m @@ -217,7 +217,7 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; } // DANGER: Don't use the delegate as the parameters in real code; this is not thread-safe and just for accounting in unit tests! -+ (UIImage *)displayWithParameters:(_ASDisplayLayerTestDelegate *)delegate isCancelled:(asdisplaynode_iscancelled_block_t)sentinelBlock ++ (UIImage *)displayWithParameters:(_ASDisplayLayerTestDelegate *)delegate isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)sentinelBlock { UIImage *contents = bogusImage(); if (delegate->_displayLayerBlock != NULL) { @@ -228,7 +228,7 @@ static _ASDisplayLayerTestDelegateClassModes _class_modes; } // DANGER: Don't use the delegate as the parameters in real code; this is not thread-safe and just for accounting in unit tests! -+ (void)drawRect:(CGRect)bounds withParameters:(_ASDisplayLayerTestDelegate *)delegate isCancelled:(asdisplaynode_iscancelled_block_t)sentinelBlock isRasterizing:(BOOL)isRasterizing ++ (void)drawRect:(CGRect)bounds withParameters:(_ASDisplayLayerTestDelegate *)delegate isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)sentinelBlock isRasterizing:(BOOL)isRasterizing { __atomic_add_fetch(&delegate->_drawRectCount, 1, __ATOMIC_SEQ_CST); } From 093ae3fba03103c78d0f1df917cf9f1f3a2008d2 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 2 Aug 2018 08:39:01 -0700 Subject: [PATCH 47/97] Remove CATransaction signposts because they cause more transactions than needed and are too chatty. (#1060) --- CHANGELOG.md | 1 + Source/ASRunLoopQueue.mm | 68 ---------------------------------------- 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f87a2899..2533928b47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) - Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) - Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) +- Remove CA transaction signpost injection because it causes more transactions and is too chatty. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index 6f5c2232a5..2cc4fc6b3c 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -254,29 +254,6 @@ static void runLoopSourceCallback(void *info) { @end -#if AS_KDEBUG_ENABLE -/** - * This is real, private CA API. Valid as of iOS 10. - */ -typedef enum { - kCATransactionPhasePreLayout, - kCATransactionPhasePreCommit, - kCATransactionPhasePostCommit, -} CATransactionPhase; - -@interface CATransaction (Private) -+ (void)addCommitHandler:(void(^)(void))block forPhase:(CATransactionPhase)phase; -+ (int)currentState; -@end -#endif - -#pragma mark - ASAbstractRunLoopQueue - -@interface ASAbstractRunLoopQueue (Private) -+ (void)load; -+ (void)registerCATransactionObservers; -@end - @implementation ASAbstractRunLoopQueue - (instancetype)init @@ -289,51 +266,6 @@ typedef enum { return self; } -#if AS_KDEBUG_ENABLE -+ (void)load -{ - [self registerCATransactionObservers]; -} - -+ (void)registerCATransactionObservers -{ - static BOOL privateCAMethodsExist; - static dispatch_block_t preLayoutHandler; - static dispatch_block_t preCommitHandler; - static dispatch_block_t postCommitHandler; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - privateCAMethodsExist = [CATransaction respondsToSelector:@selector(addCommitHandler:forPhase:)]; - privateCAMethodsExist &= [CATransaction respondsToSelector:@selector(currentState)]; - if (!privateCAMethodsExist) { - NSLog(@"Private CA methods are gone."); - } - preLayoutHandler = ^{ - ASSignpostStartCustom(ASSignpostCATransactionLayout, 0, [CATransaction currentState]); - }; - preCommitHandler = ^{ - int state = [CATransaction currentState]; - ASSignpostEndCustom(ASSignpostCATransactionLayout, 0, state, ASSignpostColorDefault); - ASSignpostStartCustom(ASSignpostCATransactionCommit, 0, state); - }; - postCommitHandler = ^{ - ASSignpostEndCustom(ASSignpostCATransactionCommit, 0, [CATransaction currentState], ASSignpostColorDefault); - // Can't add new observers inside an observer. rdar://problem/31253952 - dispatch_async(dispatch_get_main_queue(), ^{ - [self registerCATransactionObservers]; - }); - }; - }); - - if (privateCAMethodsExist) { - [CATransaction addCommitHandler:preLayoutHandler forPhase:kCATransactionPhasePreLayout]; - [CATransaction addCommitHandler:preCommitHandler forPhase:kCATransactionPhasePreCommit]; - [CATransaction addCommitHandler:postCommitHandler forPhase:kCATransactionPhasePostCommit]; - } -} - -#endif // AS_KDEBUG_ENABLE - @end #pragma mark - ASRunLoopQueue From e76b4f02f68d1d0efed73addca1dc7529f70c3ae Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 3 Aug 2018 10:23:05 -0700 Subject: [PATCH 48/97] Remove extra string/attributed string creation in accessibility properties (#1062) --- CHANGELOG.md | 1 + Source/Private/_ASPendingState.mm | 91 ++++++++++++++++--------------- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2533928b47..98865abd8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) - Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) - Remove CA transaction signpost injection because it causes more transactions and is too chatty. [Adlai Holler](https://github.com/Adlai-Holler) +- Optimize display node accessibility by not creating attributed & non-attributed copies of hint, label, and value. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 diff --git a/Source/Private/_ASPendingState.mm b/Source/Private/_ASPendingState.mm index a87707bb67..3565aa8353 100644 --- a/Source/Private/_ASPendingState.mm +++ b/Source/Private/_ASPendingState.mm @@ -607,92 +607,92 @@ static UIColor *defaultTintColor = nil; - (NSString *)accessibilityLabel { + if (_flags.setAccessibilityAttributedLabel) { + return accessibilityAttributedLabel.string; + } return accessibilityLabel; } - (void)setAccessibilityLabel:(NSString *)newAccessibilityLabel { - if (! ASObjectIsEqual(accessibilityLabel, newAccessibilityLabel)) { - _flags.setAccessibilityLabel = YES; - _flags.setAccessibilityAttributedLabel = YES; - accessibilityLabel = newAccessibilityLabel ? [newAccessibilityLabel copy] : nil; - accessibilityAttributedLabel = newAccessibilityLabel ? [[NSAttributedString alloc] initWithString:newAccessibilityLabel] : nil; - } + ASCompareAssignCopy(accessibilityLabel, newAccessibilityLabel); + _flags.setAccessibilityLabel = YES; + _flags.setAccessibilityAttributedLabel = NO; } - (NSAttributedString *)accessibilityAttributedLabel { + if (_flags.setAccessibilityLabel) { + return [[NSAttributedString alloc] initWithString:accessibilityLabel]; + } return accessibilityAttributedLabel; } - (void)setAccessibilityAttributedLabel:(NSAttributedString *)newAccessibilityAttributedLabel { - if (! ASObjectIsEqual(accessibilityAttributedLabel, newAccessibilityAttributedLabel)) { - _flags.setAccessibilityAttributedLabel = YES; - _flags.setAccessibilityLabel = YES; - accessibilityAttributedLabel = newAccessibilityAttributedLabel ? [newAccessibilityAttributedLabel copy] : nil; - accessibilityLabel = newAccessibilityAttributedLabel ? [newAccessibilityAttributedLabel.string copy] : nil; - } + ASCompareAssignCopy(accessibilityAttributedLabel, newAccessibilityAttributedLabel); + _flags.setAccessibilityAttributedLabel = YES; + _flags.setAccessibilityLabel = NO; } - (NSString *)accessibilityHint { + if (_flags.setAccessibilityAttributedHint) { + return accessibilityAttributedHint.string; + } return accessibilityHint; } - (void)setAccessibilityHint:(NSString *)newAccessibilityHint { - if (! ASObjectIsEqual(accessibilityHint, newAccessibilityHint)) { - _flags.setAccessibilityHint = YES; - _flags.setAccessibilityAttributedHint = YES; - accessibilityHint = newAccessibilityHint ? [newAccessibilityHint copy] : nil; - accessibilityAttributedHint = newAccessibilityHint ? [[NSAttributedString alloc] initWithString:newAccessibilityHint] : nil; - } + ASCompareAssignCopy(accessibilityHint, newAccessibilityHint); + _flags.setAccessibilityHint = YES; + _flags.setAccessibilityAttributedHint = NO; } - (NSAttributedString *)accessibilityAttributedHint { + if (_flags.setAccessibilityHint) { + return [[NSAttributedString alloc] initWithString:accessibilityHint]; + } return accessibilityAttributedHint; } - (void)setAccessibilityAttributedHint:(NSAttributedString *)newAccessibilityAttributedHint { - if (! ASObjectIsEqual(accessibilityAttributedHint, newAccessibilityAttributedHint)) { - _flags.setAccessibilityAttributedHint = YES; - _flags.setAccessibilityHint = YES; - accessibilityAttributedHint = newAccessibilityAttributedHint ? [newAccessibilityAttributedHint copy] : nil; - accessibilityHint = newAccessibilityAttributedHint ? [newAccessibilityAttributedHint.string copy] : nil; - } + ASCompareAssignCopy(accessibilityAttributedHint, newAccessibilityAttributedHint); + _flags.setAccessibilityAttributedHint = YES; + _flags.setAccessibilityHint = NO; } - (NSString *)accessibilityValue { + if (_flags.setAccessibilityAttributedValue) { + return accessibilityAttributedValue.string; + } return accessibilityValue; } - (void)setAccessibilityValue:(NSString *)newAccessibilityValue { - if (! ASObjectIsEqual(accessibilityValue, newAccessibilityValue)) { - _flags.setAccessibilityValue = YES; - _flags.setAccessibilityAttributedValue = YES; - accessibilityValue = newAccessibilityValue ? [newAccessibilityValue copy] : nil; - accessibilityAttributedValue = newAccessibilityValue ? [[NSAttributedString alloc] initWithString:newAccessibilityValue] : nil; - } + ASCompareAssignCopy(accessibilityValue, newAccessibilityValue); + _flags.setAccessibilityValue = YES; + _flags.setAccessibilityAttributedValue = NO; } - (NSAttributedString *)accessibilityAttributedValue { + if (_flags.setAccessibilityValue) { + return [[NSAttributedString alloc] initWithString:accessibilityValue]; + } return accessibilityAttributedValue; } - (void)setAccessibilityAttributedValue:(NSAttributedString *)newAccessibilityAttributedValue { - if (! ASObjectIsEqual(accessibilityAttributedValue, newAccessibilityAttributedValue)) { - _flags.setAccessibilityAttributedValue = YES; - _flags.setAccessibilityValue = YES; - accessibilityAttributedValue = newAccessibilityAttributedValue? [newAccessibilityAttributedValue copy] : nil; - accessibilityValue = newAccessibilityAttributedValue ? [newAccessibilityAttributedValue.string copy] : nil; - } + ASCompareAssignCopy(accessibilityAttributedValue, newAccessibilityAttributedValue); + _flags.setAccessibilityAttributedValue = YES; + _flags.setAccessibilityValue = NO; } - (UIAccessibilityTraits)accessibilityTraits @@ -1087,20 +1087,23 @@ static UIColor *defaultTintColor = nil; if (flags.setAccessibilityLabel) view.accessibilityLabel = accessibilityLabel; - if (AS_AT_LEAST_IOS11 && flags.setAccessibilityAttributedLabel) - [view setValue:accessibilityAttributedLabel forKey:@"accessibilityAttributedLabel"]; - if (flags.setAccessibilityHint) view.accessibilityHint = accessibilityHint; - if (AS_AT_LEAST_IOS11 && flags.setAccessibilityAttributedHint) - [view setValue:accessibilityAttributedHint forKey:@"accessibilityAttributedHint"]; - if (flags.setAccessibilityValue) view.accessibilityValue = accessibilityValue; - if (AS_AT_LEAST_IOS11 && flags.setAccessibilityAttributedValue) - [view setValue:accessibilityAttributedValue forKey:@"accessibilityAttributedValue"]; + if (AS_AVAILABLE_IOS(11)) { + if (flags.setAccessibilityAttributedLabel) { + view.accessibilityAttributedLabel = accessibilityAttributedLabel; + } + if (flags.setAccessibilityAttributedHint) { + view.accessibilityAttributedHint = accessibilityAttributedHint; + } + if (flags.setAccessibilityAttributedValue) { + view.accessibilityAttributedValue = accessibilityAttributedValue; + } + } if (flags.setAccessibilityTraits) view.accessibilityTraits = accessibilityTraits; From 40e3bf8952ad960dbd82ab9e0e8cd192536177ee Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 3 Aug 2018 10:24:37 -0700 Subject: [PATCH 49/97] Remove objc association & weak proxy from node -> controller pointer (#1061) * Remove objc association & weak proxy from node -> controller relationship * Rename ASNodeController+Beta.m to ASNodeControllerx+Beta.mm Currently we can't import ASDisplayNodeInternal from C * Update project pointers * Rename ASNodeControllerx+Beta.mm to ASNodeController+Beta.mm --- AsyncDisplayKit.xcodeproj/project.pbxproj | 8 +-- CHANGELOG.md | 1 + ...roller+Beta.m => ASNodeController+Beta.mm} | 60 ++----------------- Source/Private/ASDisplayNodeInternal.h | 3 + 4 files changed, 14 insertions(+), 58 deletions(-) rename Source/{ASNodeController+Beta.m => ASNodeController+Beta.mm} (59%) diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 3c66687060..68c61c7e9c 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -158,7 +158,7 @@ 697796611D8AC8D3007E93D7 /* ASLayoutSpec+Subclasses.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6977965E1D8AC8D3007E93D7 /* ASLayoutSpec+Subclasses.mm */; }; 697B315A1CFE4B410049936F /* ASEditableTextNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 697B31591CFE4B410049936F /* ASEditableTextNodeTests.m */; }; 698371DB1E4379CD00437585 /* ASNodeController+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = 698371D91E4379CD00437585 /* ASNodeController+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 698371DC1E4379CD00437585 /* ASNodeController+Beta.m in Sources */ = {isa = PBXBuildFile; fileRef = 698371DA1E4379CD00437585 /* ASNodeController+Beta.m */; }; + 698371DC1E4379CD00437585 /* ASNodeController+Beta.mm in Sources */ = {isa = PBXBuildFile; fileRef = 698371DA1E4379CD00437585 /* ASNodeController+Beta.mm */; }; 698C8B621CAB49FC0052DC3F /* ASLayoutElementExtensibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 698C8B601CAB49FC0052DC3F /* ASLayoutElementExtensibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; 698DFF441E36B6C9002891F1 /* ASStackLayoutSpecUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 698DFF431E36B6C9002891F1 /* ASStackLayoutSpecUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; 698DFF471E36B7E9002891F1 /* ASLayoutSpecUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 698DFF461E36B7E9002891F1 /* ASLayoutSpecUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -716,7 +716,7 @@ 6977965E1D8AC8D3007E93D7 /* ASLayoutSpec+Subclasses.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ASLayoutSpec+Subclasses.mm"; sourceTree = ""; }; 697B31591CFE4B410049936F /* ASEditableTextNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASEditableTextNodeTests.m; sourceTree = ""; }; 698371D91E4379CD00437585 /* ASNodeController+Beta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASNodeController+Beta.h"; sourceTree = ""; }; - 698371DA1E4379CD00437585 /* ASNodeController+Beta.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ASNodeController+Beta.m"; sourceTree = ""; }; + 698371DA1E4379CD00437585 /* ASNodeController+Beta.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "ASNodeController+Beta.mm"; sourceTree = ""; }; 698C8B601CAB49FC0052DC3F /* ASLayoutElementExtensibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutElementExtensibility.h; sourceTree = ""; }; 698DFF431E36B6C9002891F1 /* ASStackLayoutSpecUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackLayoutSpecUtilities.h; sourceTree = ""; }; 698DFF461E36B7E9002891F1 /* ASLayoutSpecUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutSpecUtilities.h; sourceTree = ""; }; @@ -1197,7 +1197,7 @@ 055B9FA61A1C154B00035D6D /* ASNetworkImageNode.h */, 055B9FA71A1C154B00035D6D /* ASNetworkImageNode.mm */, 698371D91E4379CD00437585 /* ASNodeController+Beta.h */, - 698371DA1E4379CD00437585 /* ASNodeController+Beta.m */, + 698371DA1E4379CD00437585 /* ASNodeController+Beta.mm */, DBDB83921C6E879900D0098C /* ASPagerFlowLayout.h */, DBDB83931C6E879900D0098C /* ASPagerFlowLayout.m */, 25E327541C16819500A2170C /* ASPagerNode.h */, @@ -2374,7 +2374,7 @@ DEFAD8131CC48914000527C4 /* ASVideoNode.mm in Sources */, CCA282C11E9EAE010037E8B7 /* ASTip.m in Sources */, B350624C1B010EFD0018CF92 /* _ASPendingState.mm in Sources */, - 698371DC1E4379CD00437585 /* ASNodeController+Beta.m in Sources */, + 698371DC1E4379CD00437585 /* ASNodeController+Beta.mm in Sources */, CC6AA2DB1E9F03B900978E87 /* ASDisplayNode+Ancestry.m in Sources */, 509E68621B3AEDA5009B9150 /* ASAbstractLayoutController.mm in Sources */, 254C6B861BF94F8A003EC431 /* ASTextKitContext.mm in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 98865abd8c..64ec5fff1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Reduced binary size by disabling exception support (which we don't use.) [Adlai Holler](https://github.com/Adlai-Holler) - Create and set delegate for clip corner layers within ASDisplayNode [Michael Schneider](https://github.com/maicki) [#1029](https://github.com/TextureGroup/Texture/pull/1029) - Improve locking situation in ASVideoPlayerNode [Michael Schneider](https://github.com/maicki) [#1042](https://github.com/TextureGroup/Texture/pull/1042) +- Optimize ASDisplayNode -> ASNodeController reference by removing weak proxy and objc associated objects. [Adlai Holler](https://github.com/Adlai-Holler) - Remove CA transaction signpost injection because it causes more transactions and is too chatty. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize display node accessibility by not creating attributed & non-attributed copies of hint, label, and value. [Adlai Holler](https://github.com/Adlai-Holler) diff --git a/Source/ASNodeController+Beta.m b/Source/ASNodeController+Beta.mm similarity index 59% rename from Source/ASNodeController+Beta.m rename to Source/ASNodeController+Beta.mm index 5f5fcddf66..be6da32fee 100644 --- a/Source/ASNodeController+Beta.m +++ b/Source/ASNodeController+Beta.mm @@ -16,38 +16,18 @@ // #import +#import #import #import -#import #define _node (_shouldInvertStrongReference ? _weakNode : _strongNode) -@interface ASDisplayNode (ASNodeControllerOwnership) - -// This property exists for debugging purposes. Don't use __nodeController in production code. -@property (nonatomic, readonly) ASNodeController *__nodeController; - -// These setters are mutually exclusive. Setting one will clear the relationship of the other. -- (void)__setNodeControllerStrong:(ASNodeController *)nodeController; -- (void)__setNodeControllerWeak:(ASNodeController *)nodeController; - -@end - @implementation ASNodeController { ASDisplayNode *_strongNode; __weak ASDisplayNode *_weakNode; } -- (instancetype)init -{ - self = [super init]; - if (self) { - - } - return self; -} - - (void)loadNode { self.node = [[ASDisplayNode alloc] init]; @@ -66,12 +46,14 @@ if (_shouldInvertStrongReference) { // The node should own the controller; weak reference from controller to node. _weakNode = node; - [node __setNodeControllerStrong:self]; + node->_strongNodeController = self; + node->_weakNodeController = nil; _strongNode = nil; } else { // The controller should own the node; weak reference from node to controller. _strongNode = node; - [node __setNodeControllerWeak:self]; + node->_weakNodeController = self; + node->_strongNodeController = nil; _weakNode = nil; } @@ -111,40 +93,10 @@ @end -@implementation ASDisplayNode (ASNodeControllerOwnership) - -- (ASNodeController *)__nodeController -{ - ASNodeController *nodeController = nil; - id object = objc_getAssociatedObject(self, @selector(__nodeController)); - - if ([object isKindOfClass:[ASWeakProxy class]]) { - nodeController = (ASNodeController *)[(ASWeakProxy *)object target]; - } else { - nodeController = (ASNodeController *)object; - } - - return nodeController; -} - -- (void)__setNodeControllerStrong:(ASNodeController *)nodeController -{ - objc_setAssociatedObject(self, @selector(__nodeController), nodeController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (void)__setNodeControllerWeak:(ASNodeController *)nodeController -{ - // Associated objects don't support weak references. Since assign can become a dangling pointer, use ASWeakProxy. - ASWeakProxy *nodeControllerProxy = [ASWeakProxy weakProxyWithTarget:nodeController]; - objc_setAssociatedObject(self, @selector(__nodeController), nodeControllerProxy, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -@end - @implementation ASDisplayNode (ASNodeController) - (ASNodeController *)nodeController { - return self.__nodeController; + return _weakNodeController ?: _strongNodeController; } @end diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 3c7c2e8875..5e0e1d36e6 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -34,6 +34,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol _ASDisplayLayerDelegate; @class _ASDisplayLayer; @class _ASPendingState; +@class ASNodeController; struct ASDisplayNodeFlags; BOOL ASDisplayNodeSubclassOverridesSelector(Class subclass, SEL selector); @@ -92,6 +93,8 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest ASInterfaceState _pendingInterfaceState; UIView *_view; CALayer *_layer; + ASNodeController *_strongNodeController; + __weak ASNodeController *_weakNodeController; std::atomic _atomicFlags; From c5b1d09b499c168c91b59384330d5a8e6a1749a8 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Fri, 3 Aug 2018 16:35:24 -0700 Subject: [PATCH 50/97] Remove direct ivar access on non-self object to fix mocking case #trivial (#1066) * Remove direct ivar access on non-self object to prevent issues when the object is actually a mock * Comment * Remove lock to avoid deadlock risk --- Source/ASDisplayNode.mm | 13 +++++++++++++ Source/ASNodeController+Beta.mm | 5 +---- Source/Private/ASDisplayNodeInternal.h | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 347d41c42c..0fc41d40a4 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -47,6 +47,7 @@ #import #import #import +#import #import #import #import @@ -876,6 +877,18 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); _automaticallyRelayoutOnLayoutMarginsChanges = flag; } +- (void)__setNodeController:(ASNodeController *)controller +{ + // See docs for why we don't lock. + if (controller.shouldInvertStrongReference) { + _strongNodeController = controller; + _weakNodeController = nil; + } else { + _weakNodeController = controller; + _strongNodeController = nil; + } +} + #pragma mark - UIResponder #define HANDLE_NODE_RESPONDER_METHOD(__sel) \ diff --git a/Source/ASNodeController+Beta.mm b/Source/ASNodeController+Beta.mm index be6da32fee..6dcd1a0790 100644 --- a/Source/ASNodeController+Beta.mm +++ b/Source/ASNodeController+Beta.mm @@ -46,17 +46,14 @@ if (_shouldInvertStrongReference) { // The node should own the controller; weak reference from controller to node. _weakNode = node; - node->_strongNodeController = self; - node->_weakNodeController = nil; _strongNode = nil; } else { // The controller should own the node; weak reference from node to controller. _strongNode = node; - node->_weakNodeController = self; - node->_strongNodeController = nil; _weakNode = nil; } + [node __setNodeController:self]; [node addInterfaceStateDelegate:self]; } diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 5e0e1d36e6..9275137549 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -93,8 +93,6 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest ASInterfaceState _pendingInterfaceState; UIView *_view; CALayer *_layer; - ASNodeController *_strongNodeController; - __weak ASNodeController *_weakNodeController; std::atomic _atomicFlags; @@ -138,6 +136,9 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest ASDisplayNode * __weak _supernode; NSMutableArray *_subnodes; + ASNodeController *_strongNodeController; + __weak ASNodeController *_weakNodeController; + // Set this to nil whenever you modify _subnodes NSArray *_cachedSubnodes; @@ -276,6 +277,16 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest */ - (void)__setNeedsDisplay; +/** + * Setup the node -> controller reference. Strong or weak is based on + * the "shouldInvertStrongReference" property of the controller. + * + * Note: To prevent lock-ordering deadlocks, this method does not take the node's lock. + * In practice, changing the node controller of a node multiple times is not + * supported behavior. + */ +- (void)__setNodeController:(ASNodeController *)controller; + /** * Called whenever the node needs to layout its subnodes and, if it's already loaded, its subviews. Executes the layout pass for the node * From b136e84b4e9f413b501a2cf91377b672b84aedf7 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sat, 4 Aug 2018 07:33:53 -0700 Subject: [PATCH 51/97] Add an experimental framesetter cache in ASTextNode2 (#1063) * Add an experimental framesetter cache in ASTextNode2, and stop keeping framesetters around * Update configuration schema * Fix imports * Fix import again and remove set statement --- CHANGELOG.md | 1 + Schemas/configuration.json | 1 + Source/ASExperimentalFeatures.h | 1 + Source/ASExperimentalFeatures.m | 3 +- .../TextExperiment/Component/ASTextLayout.h | 2 - .../TextExperiment/Component/ASTextLayout.m | 82 +++++++++++++++---- 6 files changed, 73 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ec5fff1d..b62de53597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ - Optimize ASDisplayNode -> ASNodeController reference by removing weak proxy and objc associated objects. [Adlai Holler](https://github.com/Adlai-Holler) - Remove CA transaction signpost injection because it causes more transactions and is too chatty. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize display node accessibility by not creating attributed & non-attributed copies of hint, label, and value. [Adlai Holler](https://github.com/Adlai-Holler) +- Add an experimental feature that reuses CTFramesetter objects in ASTextNode2 to improve performance. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 diff --git a/Schemas/configuration.json b/Schemas/configuration.json index 71b5917294..29c4375a41 100644 --- a/Schemas/configuration.json +++ b/Schemas/configuration.json @@ -21,6 +21,7 @@ "exp_network_image_queue", "exp_dealloc_queue_v2", "exp_collection_teardown", + "exp_framesetter_cache" ] } } diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index cc02d8a683..448deb87a3 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -27,6 +27,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue ASExperimentalDeallocQueue = 1 << 6, // exp_dealloc_queue_v2 ASExperimentalCollectionTeardown = 1 << 7, // exp_collection_teardown + ASExperimentalFramesetterCache = 1 << 8, // exp_framesetter_cache ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index dea872b365..5b33fe50be 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -23,7 +23,8 @@ NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags @"exp_infer_layer_defaults", @"exp_network_image_queue", @"exp_dealloc_queue_v2", - @"exp_collection_teardown"])); + @"exp_collection_teardown", + @"exp_framesetter_cache"])); if (flags == ASExperimentalFeatureAll) { return allNames; diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.h b/Source/Private/TextExperiment/Component/ASTextLayout.h index 544d9f5f33..1a6625a3af 100755 --- a/Source/Private/TextExperiment/Component/ASTextLayout.h +++ b/Source/Private/TextExperiment/Component/ASTextLayout.h @@ -225,8 +225,6 @@ AS_EXTERN const CGSize ASTextContainerMaxSize; @property (nonatomic, readonly) NSAttributedString *text; ///< The text range in full text @property (nonatomic, readonly) NSRange range; -///< CTFrameSetter -@property (nonatomic, readonly) CTFramesetterRef frameSetter; ///< CTFrame @property (nonatomic, readonly) CTFrameRef frame; ///< Array of `ASTextLine`, no truncated diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.m b/Source/Private/TextExperiment/Component/ASTextLayout.m index d0aceee9ac..d3d316d14d 100755 --- a/Source/Private/TextExperiment/Component/ASTextLayout.m +++ b/Source/Private/TextExperiment/Component/ASTextLayout.m @@ -16,11 +16,15 @@ // #import + +#import #import #import #import #import +#import + const CGSize ASTextContainerMaxSize = (CGSize){0x100000, 0x100000}; typedef struct { @@ -320,7 +324,6 @@ dispatch_semaphore_signal(_lock); @property (nonatomic) NSAttributedString *text; @property (nonatomic) NSRange range; -@property (nonatomic) CTFramesetterRef frameSetter; @property (nonatomic) CTFrameRef frame; @property (nonatomic) NSArray *lines; @property (nonatomic) ASTextLine *truncatedLine; @@ -484,10 +487,71 @@ dispatch_semaphore_signal(_lock); frameAttrs[(id)kCTFrameProgressionAttributeName] = @(kCTFrameProgressionRightToLeft); } - // create CoreText objects - ctSetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)text); + /* + * Framesetter cache. + * Framesetters can only be used by one thread at a time. + * Create a CFSet with no callbacks (raw pointers) to keep track of which + * framesetters are in use on other threads. If the one for our string is already in use, + * just create a new one. This should be pretty rare. + */ + static pthread_mutex_t busyFramesettersLock = PTHREAD_MUTEX_INITIALIZER; + static NSCache *framesetterCache; + static CFMutableSetRef busyFramesetters; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + if (ASActivateExperimentalFeature(ASExperimentalFramesetterCache)) { + framesetterCache = [[NSCache alloc] init]; + framesetterCache.name = @"org.TextureGroup.Texture.framesetterCache"; + busyFramesetters = CFSetCreateMutable(NULL, 0, NULL); + } + }); + + BOOL haveCached = NO, useCached = NO; + if (framesetterCache) { + // Check if there's one in the cache. + ctSetter = (__bridge_retained CTFramesetterRef)[framesetterCache objectForKey:text]; + + if (ctSetter) { + haveCached = YES; + + // Check-and-set busy on the cached one. + pthread_mutex_lock(&busyFramesettersLock); + BOOL busy = CFSetContainsValue(busyFramesetters, ctSetter); + if (!busy) { + CFSetAddValue(busyFramesetters, ctSetter); + useCached = YES; + } + pthread_mutex_unlock(&busyFramesettersLock); + + // Release if it was busy. + if (busy) { + CFRelease(ctSetter); + ctSetter = NULL; + } + } + } + + // Create a framesetter if needed. + if (!ctSetter) { + ctSetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)text); + } + if (!ctSetter) FAIL_AND_RETURN ctFrame = CTFramesetterCreateFrame(ctSetter, ASTextCFRangeFromNSRange(range), cgPath, (CFDictionaryRef)frameAttrs); + + // Return to cache. + if (framesetterCache) { + if (useCached) { + // If reused: mark available. + pthread_mutex_lock(&busyFramesettersLock); + CFSetRemoveValue(busyFramesetters, ctSetter); + pthread_mutex_unlock(&busyFramesettersLock); + } else if (!haveCached) { + // If first framesetter, add to cache. + [framesetterCache setObject:(__bridge id)ctSetter forKey:text]; + } + } + if (!ctFrame) FAIL_AND_RETURN lines = [NSMutableArray new]; ctLines = CTFrameGetLines(ctFrame); @@ -857,8 +921,7 @@ dispatch_semaphore_signal(_lock); if (attachments.count == 0) { attachments = attachmentRanges = attachmentRects = nil; } - - layout.frameSetter = ctSetter; + layout.frame = ctFrame; layout.lines = lines; layout.truncatedLine = truncatedLine; @@ -903,14 +966,6 @@ dispatch_semaphore_signal(_lock); return layouts; } -- (void)setFrameSetter:(CTFramesetterRef)frameSetter { - if (_frameSetter != frameSetter) { - if (frameSetter) CFRetain(frameSetter); - if (_frameSetter) CFRelease(_frameSetter); - _frameSetter = frameSetter; - } -} - - (void)setFrame:(CTFrameRef)frame { if (_frame != frame) { if (frame) CFRetain(frame); @@ -920,7 +975,6 @@ dispatch_semaphore_signal(_lock); } - (void)dealloc { - if (_frameSetter) CFRelease(_frameSetter); if (_frame) CFRelease(_frame); if (_lineRowsIndex) free(_lineRowsIndex); if (_lineRowsEdge) free(_lineRowsEdge); From 847884a7b463aede869d3d850fd4548d8f817073 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Sun, 5 Aug 2018 08:20:20 -0700 Subject: [PATCH 52/97] Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: (#1054) * Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: * Add changelog --- CHANGELOG.md | 2 +- Source/ASViewController.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b62de53597..96a8c1b2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ - Remove CA transaction signpost injection because it causes more transactions and is too chatty. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize display node accessibility by not creating attributed & non-attributed copies of hint, label, and value. [Adlai Holler](https://github.com/Adlai-Holler) - Add an experimental feature that reuses CTFramesetter objects in ASTextNode2 to improve performance. [Adlai Holler](https://github.com/Adlai-Holler) - +- Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: [Michael Schneider](https://github.com/maicki) [#1054](https://github.com/TextureGroup/Texture/pull/1054) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASViewController.h b/Source/ASViewController.h index b04137cc0d..9f1e78deec 100644 --- a/Source/ASViewController.h +++ b/Source/ASViewController.h @@ -44,7 +44,7 @@ typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitWindowSizeBlock)(C * * @see ASVisibilityDepth */ -- (instancetype)initWithNode:(DisplayNodeType)node; +- (instancetype)initWithNode:(DisplayNodeType)node NS_DESIGNATED_INITIALIZER; NS_ASSUME_NONNULL_END From 2bb216b02e77440a27bad9ea1b44513f1c0996a0 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Sun, 5 Aug 2018 17:24:13 -0700 Subject: [PATCH 53/97] Readability improvements in ASDataController #trivial (#1067) --- Source/Details/ASDataController.mm | 59 ++++++++++++------------------ 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/Source/Details/ASDataController.mm b/Source/Details/ASDataController.mm index 05e266a7dc..9ecfe2dc89 100644 --- a/Source/Details/ASDataController.mm +++ b/Source/Details/ASDataController.mm @@ -149,14 +149,13 @@ typedef void (^ASDataControllerSynchronizationBlock)(); #pragma mark - Cell Layout -- (void)_allocateNodesFromElements:(NSArray *)elements completion:(ASDataControllerCompletionBlock)completionHandler +- (void)_allocateNodesFromElements:(NSArray *)elements { ASSERT_ON_EDITING_QUEUE; NSUInteger nodeCount = elements.count; __weak id weakDataSource = _dataSource; if (nodeCount == 0 || weakDataSource == nil) { - completionHandler(); return; } @@ -165,30 +164,23 @@ typedef void (^ASDataControllerSynchronizationBlock)(); { as_activity_create_for_scope("Data controller batch"); - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + // TODO: Should we use USER_INITIATED here since the user is probably waiting? + dispatch_queue_t queue = dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0); ASDispatchApply(nodeCount, queue, 0, ^(size_t i) { - __strong id strongDataSource = weakDataSource; - if (strongDataSource == nil) { + if (!weakDataSource) { return; } - // Allocate the node. - ASCollectionElement *context = elements[i]; - ASCellNode *node = context.node; - if (node == nil) { - ASDisplayNodeAssertNotNil(node, @"Node block created nil node; %@, %@", self, strongDataSource); - node = [[ASCellNode alloc] init]; // Fallback to avoid crash for production apps. - } - + unowned ASCollectionElement *element = elements[i]; + unowned ASCellNode *node = element.node; // Layout the node if the size range is valid. - ASSizeRange sizeRange = context.constrainedSize; + ASSizeRange sizeRange = element.constrainedSize; if (ASSizeRangeHasSignificantArea(sizeRange)) { [self _layoutNode:node withConstrainedSize:sizeRange]; } }); } - completionHandler(); ASSignpostEndCustom(ASSignpostDataControllerBatch, self, 0, (weakDataSource != nil ? ASSignpostColorDefault : ASSignpostColorRed)); } @@ -648,28 +640,9 @@ typedef void (^ASDataControllerSynchronizationBlock)(); __block __unused os_activity_scope_state_s preparationScope = {}; // unused if deployment target < iOS10 as_activity_scope_enter(as_activity_create("Prepare nodes for collection update", AS_ACTIVITY_CURRENT, OS_ACTIVITY_FLAG_DEFAULT), &preparationScope); - dispatch_block_t completion = ^() { - [_mainSerialQueue performBlockOnMainThread:^{ - as_activity_scope_leave(&preparationScope); - // Step 4: Inform the delegate - [_delegate dataController:self updateWithChangeSet:changeSet updates:^{ - // Step 5: Deploy the new data as "completed" - // - // Note that since the backing collection view might be busy responding to user events (e.g scrolling), - // it will not consume the batch update blocks immediately. - // As a result, in a short intermidate time, the view will still be relying on the old data source state. - // Thus, we can't just swap the new map immediately before step 4, but until this update block is executed. - // (https://github.com/TextureGroup/Texture/issues/378) - self.visibleMap = newMap; - }]; - }]; - --_editingTransactionGroupCount; - }; - // Step 3: Call the layout delegate if possible. Otherwise, allocate and layout all elements if (canDelegate) { [layoutDelegateClass calculateLayoutWithContext:layoutContext]; - completion(); } else { let elementsToProcess = [[NSMutableArray alloc] init]; for (ASCollectionElement *element in newMap) { @@ -682,8 +655,24 @@ typedef void (^ASDataControllerSynchronizationBlock)(); [elementsToProcess addObject:element]; } } - [self _allocateNodesFromElements:elementsToProcess completion:completion]; + [self _allocateNodesFromElements:elementsToProcess]; } + + // Step 4: Inform the delegate on main thread + [_mainSerialQueue performBlockOnMainThread:^{ + as_activity_scope_leave(&preparationScope); + [_delegate dataController:self updateWithChangeSet:changeSet updates:^{ + // Step 5: Deploy the new data as "completed" + // + // Note that since the backing collection view might be busy responding to user events (e.g scrolling), + // it will not consume the batch update blocks immediately. + // As a result, in a short intermidate time, the view will still be relying on the old data source state. + // Thus, we can't just swap the new map immediately before step 4, but until this update block is executed. + // (https://github.com/TextureGroup/Texture/issues/378) + self.visibleMap = newMap; + }]; + }]; + --_editingTransactionGroupCount; }); if (_usesSynchronousDataLoading) { From 03e6ce09164407dbfd81a9c407724f4ebc73bdbf Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 7 Aug 2018 08:32:43 -0700 Subject: [PATCH 54/97] Reduce copying in ASTextNode2 stack (#1065) * Remove copying in text stack, make text container have an optional immutable mode * Changelog * Comment * Update CHANGELOG.md * Use new name * Import header --- CHANGELOG.md | 1 + Source/ASTextNode2.mm | 18 +++++--- .../TextExperiment/Component/ASTextLayout.h | 3 ++ .../TextExperiment/Component/ASTextLayout.m | 45 +++++++++++++------ 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96a8c1b2d3..9ec23015b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Optimize display node accessibility by not creating attributed & non-attributed copies of hint, label, and value. [Adlai Holler](https://github.com/Adlai-Holler) - Add an experimental feature that reuses CTFramesetter objects in ASTextNode2 to improve performance. [Adlai Holler](https://github.com/Adlai-Holler) - Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: [Michael Schneider](https://github.com/maicki) [#1054](https://github.com/TextureGroup/Texture/pull/1054) +- Optimize text stack by removing unneeded copying. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 7d3d8d7b34..3ab1d2f35c 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -236,12 +236,17 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; ASLockScopeSelf(); - ASTextContainer *container = [_textContainer copy]; - NSAttributedString *attributedText = self.attributedText; - container.size = constrainedSize; + ASTextContainer *container; + if (!CGSizeEqualToSize(container.size, constrainedSize)) { + container = [_textContainer copy]; + container.size = constrainedSize; + [container makeImmutable]; + } else { + container = _textContainer; + } [self _ensureTruncationText]; - NSMutableAttributedString *mutableText = [attributedText mutableCopy]; + NSMutableAttributedString *mutableText = [_attributedText mutableCopy]; [self prepareAttributedString:mutableText]; ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:container text:mutableText]; @@ -365,9 +370,12 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; { ASLockScopeSelf(); [self _ensureTruncationText]; + + // Unlike layout, here we must copy the container since drawing is asynchronous. ASTextContainer *copiedContainer = [_textContainer copy]; copiedContainer.size = self.bounds.size; - NSMutableAttributedString *mutableText = [self.attributedText mutableCopy] ?: [[NSMutableAttributedString alloc] init]; + [copiedContainer makeImmutable]; + NSMutableAttributedString *mutableText = [_attributedText mutableCopy] ?: [[NSMutableAttributedString alloc] init]; [self prepareAttributedString:mutableText]; diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.h b/Source/Private/TextExperiment/Component/ASTextLayout.h index 1a6625a3af..c78f4271f3 100755 --- a/Source/Private/TextExperiment/Component/ASTextLayout.h +++ b/Source/Private/TextExperiment/Component/ASTextLayout.h @@ -67,6 +67,9 @@ AS_EXTERN const CGSize ASTextContainerMaxSize; /// Creates a container with the specified path. @param path The path. + (instancetype)containerWithPath:(nullable UIBezierPath *)path NS_RETURNS_RETAINED; +/// Mark this immutable, so you get free copies going forward. +- (void)makeImmutable; + /// The constrained size. (if the size is larger than ASTextContainerMaxSize, it will be clipped) @property CGSize size; diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.m b/Source/Private/TextExperiment/Component/ASTextLayout.m index d3d316d14d..4b3ba691f8 100755 --- a/Source/Private/TextExperiment/Component/ASTextLayout.m +++ b/Source/Private/TextExperiment/Component/ASTextLayout.m @@ -17,6 +17,7 @@ #import +#import #import #import #import @@ -134,26 +135,36 @@ static CGColorRef ASTextGetCGColor(CGColorRef color) { return self; } -- (id)copyWithZone:(NSZone *)zone { - ASTextContainer *one = [self.class new]; +- (id)copyForced:(BOOL)forceCopy +{ dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); + if (_readonly && !forceCopy) { + dispatch_semaphore_signal(_lock); + return self; + } + + ASTextContainer *one = [self.class new]; one->_size = _size; one->_insets = _insets; one->_path = _path; - one->_exclusionPaths = _exclusionPaths.copy; + one->_exclusionPaths = [_exclusionPaths copy]; one->_pathFillEvenOdd = _pathFillEvenOdd; one->_pathLineWidth = _pathLineWidth; one->_verticalForm = _verticalForm; one->_maximumNumberOfRows = _maximumNumberOfRows; one->_truncationType = _truncationType; - one->_truncationToken = _truncationToken.copy; + one->_truncationToken = [_truncationToken copy]; one->_linePositionModifier = [(NSObject *)_linePositionModifier copy]; dispatch_semaphore_signal(_lock); return one; } -- (id)mutableCopyWithZone:(nullable NSZone *)zone { - return [self copyWithZone:zone]; +- (id)copyWithZone:(NSZone *)zone { + return [self copyForced:NO]; +} + +- (id)mutableCopyWithZone:(NSZone *)zone { + return [self copyForced:YES]; } - (void)encodeWithCoder:(NSCoder *)aCoder { @@ -189,18 +200,25 @@ static CGColorRef ASTextGetCGColor(CGColorRef color) { return self; } +- (void)makeImmutable +{ + dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); + _readonly = YES; + dispatch_semaphore_signal(_lock); +} + #define Getter(...) \ dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); \ __VA_ARGS__; \ dispatch_semaphore_signal(_lock); #define Setter(...) \ -if (_readonly) { \ -@throw [NSException exceptionWithName:NSInternalInconsistencyException \ -reason:@"Cannot change the property of the 'container' in 'ASTextLayout'." userInfo:nil]; \ -return; \ -} \ dispatch_semaphore_wait(_lock, DISPATCH_TIME_FOREVER); \ +if (__builtin_expect(_readonly, NO)) { \ + ASDisplayNodeFailAssert(@"Attempt to modify immutable text container."); \ + dispatch_semaphore_signal(_lock); \ + return; \ +} \ __VA_ARGS__; \ dispatch_semaphore_signal(_lock); @@ -407,11 +425,10 @@ dispatch_semaphore_signal(_lock); if (lineRowsIndex) free(lineRowsIndex); \ return nil; } - text = text.mutableCopy; - container = container.copy; + container = [container copy]; if (!text || !container) return nil; if (range.location + range.length > text.length) return nil; - container->_readonly = YES; + [container makeImmutable]; maximumNumberOfRows = container.maximumNumberOfRows; // It may use larger constraint size when create CTFrame with From 5f912d1cd1259503dab392658fcaaa8431bb10cf Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Wed, 15 Aug 2018 11:08:32 -0700 Subject: [PATCH 55/97] Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster (#1056) --- AsyncDisplayKit.xcodeproj/project.pbxproj | 8 ++- CHANGELOG.md | 1 + Source/TextKit/ASTextKitFontSizeAdjuster.mm | 4 +- Tests/ASTextKitFontSizeAdjusterTests.mm | 51 ++++++++++++++++++ Tests/ASTextNodeSnapshotTests.m | 16 ++++++ .../testFontPointSizeScaling@2x.png | Bin 0 -> 1770 bytes .../testFontPointSizeScaling@2x.png | Bin 0 -> 1770 bytes 7 files changed, 75 insertions(+), 5 deletions(-) create mode 100644 Tests/ASTextKitFontSizeAdjusterTests.mm create mode 100644 Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png create mode 100644 Tests/ReferenceImages_iOS_10/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 68c61c7e9c..30f3f6e941 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -228,6 +228,7 @@ ACF6ED611B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */; }; ACF6ED621B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */; }; ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm */; }; + AE440175210FB7CF00B36DA2 /* ASTextKitFontSizeAdjusterTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = AE440174210FB7CF00B36DA2 /* ASTextKitFontSizeAdjusterTests.mm */; }; AE6987C11DD04E1000B9E458 /* ASPagerNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AE6987C01DD04E1000B9E458 /* ASPagerNodeTests.m */; }; AEEC47E41C21D3D200EC1693 /* ASVideoNodeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.m */; }; B13CA0F81C519EBA00E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = B13CA0F61C519E9400E031AB /* ASCollectionViewLayoutFacilitatorProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -814,6 +815,7 @@ ACF6ED591B178DC700DA7C62 /* ASOverlayLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASOverlayLayoutSpecSnapshotTests.mm; sourceTree = ""; }; ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRatioLayoutSpecSnapshotTests.mm; sourceTree = ""; }; ACF6ED5B1B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackLayoutSpecSnapshotTests.mm; sourceTree = ""; }; + AE440174210FB7CF00B36DA2 /* ASTextKitFontSizeAdjusterTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ASTextKitFontSizeAdjusterTests.mm; sourceTree = ""; }; AE6987C01DD04E1000B9E458 /* ASPagerNodeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASPagerNodeTests.m; sourceTree = ""; }; AEB7B0181C5962EA00662EF4 /* ASDefaultPlayButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDefaultPlayButton.h; sourceTree = ""; }; AEB7B0191C5962EA00662EF4 /* ASDefaultPlayButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDefaultPlayButton.m; sourceTree = ""; }; @@ -1253,7 +1255,6 @@ 058D09C5195D04C000B7D73C /* Tests */ = { isa = PBXGroup; children = ( - CC35CEC520DD87280006448D /* ASCollectionsTests.m */, DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.m */, AC026B571BD3F61800BBC17E /* ASAbsoluteLayoutSpecSnapshotTests.m */, 696FCB301D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm */, @@ -1264,6 +1265,7 @@ CC051F1E1D7A286A006434CB /* ASCALayerTests.m */, ACF6ED531B178DC700DA7C62 /* ASCenterLayoutSpecSnapshotTests.mm */, CCDD148A1EEDCD9D0020834E /* ASCollectionModernDataSourceTests.m */, + CC35CEC520DD87280006448D /* ASCollectionsTests.m */, 2538B6F21BC5D2A2003CA0B4 /* ASCollectionViewFlowLayoutInspectorTests.m */, 9F06E5CC1B4CAF4200F015D8 /* ASCollectionViewTests.mm */, CCEDDDD8200C518800FFCD0A /* ASConfigurationTests.m */, @@ -1314,8 +1316,10 @@ 3C9C128419E616EF00E942A0 /* ASTableViewTests.mm */, CC4981B21D1A02BE004E13CC /* ASTableViewThrashTests.m */, 058D0A33195D057000B7D73C /* ASTextKitCoreTextAdditionsTests.m */, + AE440174210FB7CF00B36DA2 /* ASTextKitFontSizeAdjusterTests.mm */, 254C6B531BF8FF2A003EC431 /* ASTextKitTests.mm */, 254C6B511BF8FE6D003EC431 /* ASTextKitTruncationTests.mm */, + C057D9BC20B5453D00FC9112 /* ASTextNode2SnapshotTests.m */, CC8B05D71D73979700F54286 /* ASTextNodePerformanceTests.m */, 81E95C131D62639600336598 /* ASTextNodeSnapshotTests.m */, 058D0A36195D057000B7D73C /* ASTextNodeTests.m */, @@ -1325,7 +1329,6 @@ 4496D0721FA9EA6B001CC8D5 /* ASTraitCollectionTests.m */, CC0AEEA31D66316E005D1C78 /* ASUICollectionViewTests.m */, AEEC47E31C21D3D200EC1693 /* ASVideoNodeTests.m */, - C057D9BC20B5453D00FC9112 /* ASTextNode2SnapshotTests.m */, CCA221D21D6FA7EF00AF6A0F /* ASViewControllerTests.m */, 83A7D95D1D446A6E00BF333E /* ASWeakMapTests.m */, CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.m */, @@ -2265,6 +2268,7 @@ buildActionMask = 2147483647; files = ( CCEDDDD9200C518800FFCD0A /* ASConfigurationTests.m in Sources */, + AE440175210FB7CF00B36DA2 /* ASTextKitFontSizeAdjusterTests.mm in Sources */, E51B78BF1F028ABF00E32604 /* ASLayoutFlatteningTests.m in Sources */, 4496D0731FA9EA6B001CC8D5 /* ASTraitCollectionTests.m in Sources */, 29CDC2E21AAE70D000833CA4 /* ASBasicImageDownloaderContextTests.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ec23015b1..01ecb97cab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - Add an experimental feature that reuses CTFramesetter objects in ASTextNode2 to improve performance. [Adlai Holler](https://github.com/Adlai-Holler) - Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: [Michael Schneider](https://github.com/maicki) [#1054](https://github.com/TextureGroup/Texture/pull/1054) - Optimize text stack by removing unneeded copying. [Adlai Holler](https://github.com/Adlai-Holler) +- Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/TextKit/ASTextKitFontSizeAdjuster.mm b/Source/TextKit/ASTextKitFontSizeAdjuster.mm index dce59597fc..13d3e92965 100644 --- a/Source/TextKit/ASTextKitFontSizeAdjuster.mm +++ b/Source/TextKit/ASTextKitFontSizeAdjuster.mm @@ -87,8 +87,6 @@ paragraphStyle.tailIndent = (paragraphStyle.tailIndent * scaleFactor); paragraphStyle.minimumLineHeight = (paragraphStyle.minimumLineHeight * scaleFactor); paragraphStyle.maximumLineHeight = (paragraphStyle.maximumLineHeight * scaleFactor); - paragraphStyle.lineHeightMultiple = (paragraphStyle.lineHeightMultiple * scaleFactor); - paragraphStyle.paragraphSpacing = (paragraphStyle.paragraphSpacing * scaleFactor); [attrString removeAttribute:NSParagraphStyleAttributeName range:range]; [attrString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range]; @@ -214,7 +212,7 @@ if (longestWordFits == NO) { // we need to check the longest word to make sure it fits - longestWordFits = std::ceil((longestWordSize.width * adjustedScale) <= _constrainedSize.width); + longestWordFits = std::ceil((longestWordSize.width * adjustedScale) <= _constrainedSize.width); } // if the longest word fits, go ahead and check max line and height. If it didn't fit continue to the next scale factor diff --git a/Tests/ASTextKitFontSizeAdjusterTests.mm b/Tests/ASTextKitFontSizeAdjusterTests.mm new file mode 100644 index 0000000000..937028d3f5 --- /dev/null +++ b/Tests/ASTextKitFontSizeAdjusterTests.mm @@ -0,0 +1,51 @@ +// +// ASTextKitFontSizeAdjusterTests.mm +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 +#import + +@interface ASFontSizeAdjusterTests : XCTestCase + +@end + +@implementation ASFontSizeAdjusterTests + +- (void)testFontSizeAdjusterAttributes +{ + NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; + paragraphStyle.lineHeightMultiple = 2.0; + paragraphStyle.lineSpacing = 2.0; + paragraphStyle.paragraphSpacing = 4.0; + paragraphStyle.firstLineHeadIndent = 6.0; + paragraphStyle.headIndent = 8.0; + paragraphStyle.tailIndent = 10.0; + paragraphStyle.minimumLineHeight = 12.0; + paragraphStyle.maximumLineHeight = 14.0; + + NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"Lorem ipsum dolor sit amet" + attributes:@{ NSParagraphStyleAttributeName: paragraphStyle }]; + + [ASTextKitFontSizeAdjuster adjustFontSizeForAttributeString:string withScaleFactor:0.5]; + + NSParagraphStyle *adjustedParagraphStyle = [string attribute:NSParagraphStyleAttributeName atIndex:0 effectiveRange:nil]; + + XCTAssertEqual(adjustedParagraphStyle.lineHeightMultiple, 2.0); + XCTAssertEqual(adjustedParagraphStyle.lineSpacing, 1.0); + XCTAssertEqual(adjustedParagraphStyle.paragraphSpacing, 2.0); + XCTAssertEqual(adjustedParagraphStyle.firstLineHeadIndent, 3.0); + XCTAssertEqual(adjustedParagraphStyle.headIndent, 4.0); + XCTAssertEqual(adjustedParagraphStyle.tailIndent, 5.0); + XCTAssertEqual(adjustedParagraphStyle.minimumLineHeight, 6.0); + XCTAssertEqual(adjustedParagraphStyle.maximumLineHeight, 7.0); +} + +@end diff --git a/Tests/ASTextNodeSnapshotTests.m b/Tests/ASTextNodeSnapshotTests.m index c81f5241a3..1d705f77b7 100644 --- a/Tests/ASTextNodeSnapshotTests.m +++ b/Tests/ASTextNodeSnapshotTests.m @@ -137,4 +137,20 @@ ASSnapshotVerifyNode(textNode, nil); } +- (void)testFontPointSizeScaling +{ + NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; + paragraphStyle.lineHeightMultiple = 0.5; + paragraphStyle.lineSpacing = 2.0; + + ASTextNode *textNode = [[ASTextNode alloc] init]; + textNode.style.maxSize = CGSizeMake(60, 80); + textNode.pointSizeScaleFactors = @[@0.5]; + textNode.attributedText = [[NSAttributedString alloc] initWithString:@"Quality is an important thing" + attributes:@{ NSParagraphStyleAttributeName: paragraphStyle }]; + + ASDisplayNodeSizeToFitSizeRange(textNode, ASSizeRangeMake(CGSizeZero, CGSizeMake(INFINITY, INFINITY))); + ASSnapshotVerifyNode(textNode, nil); +} + @end diff --git a/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png b/Tests/ReferenceImages_64/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..111bd5004842fec4a3eab9adc46b4b649de4286d GIT binary patch literal 1770 zcmbW2c{tRI8pmfEeq%7BXzWHvLn*REp)qELj578ma(<3#EXQ%O7o9VVt*KimLzWuM zSTad+Y*((IuB;g;OA#YvZ{+0KqBA|u{pbFB-{<+hpYQwr@%`(4p7(~clRa8mRT>6^ zp&ibUUBwI)i!23*dn%_IiZ zzb04LSwqfwoN>H(RLZ2XwtdL;Eq{QzPgnngyLO7bK6UrCZN>27@aBR=pCLgINE3+W zo9l-~@z%53Cm#ydx2R< zl$ff8ovLYgEOc;Ak|~Uj!-m-Sm}Sb~$x1ZcFpLv}P;_knqur?Hmi|7E#)r^|bnGGA zYE<`jtIq|`b|&_-3mZ%c{k}f$5eHhT=YPBrTOR4?-ox=Yw!SWi$Z{)=APitvjvFK^ zay~-m$&F|OnAZ?eNX|tP&vhk8ba|L3HEFrv>t759m^Fmt+vJtHZK4vS?zEq3b{LO; zF2^&%u4%La+IN=KnaZZ5fk;^xPXo{o zvc6wcg%B21We-lwTRBAYM zf&|i`Q&BE2k!mDr1fEyr!B^cJ12(1VAi=pN`Auvp&6F zJ~*_ygB-o)@M4J;HTsim*3tqH$xEO!ytX_ayHz+X0>5)V(q35^{)_5!zO1yi_JYY$4fT?Cz9ymltv z`+XKZ>~c4=Y-oxYs%{ZD_}e@Ylwk0C+>qx7f$;`vLz{0jM$tTR5AGyu&z=fKejGZ>Yw!?N1NYOVJRT z#4XKqUjxQr%Mk^?$v;bP4xCj>D;;|}a&}-%NX5yKIBkQ4`=XOpi|P_P&fx}^;F_*< z3{Y4e!@PbSUz>bX2=PS+G)!d^a_00zv5HZNgjVFy#D%>RK$%O6io4|qW}LMBpG1YW zFE3ktIa|b{QK8{iGd(njlAwpi<2UNB$hQ2xBK3;13sc~<@iM=F)+*0Hg-w~_)kZFR z@Ynt#A}zBK+XM+XZcIO{4g{)LFu7UKYM#H4Rfqs;a6uD*l<`V_i7jEkmT6`=#)y)) zQqP`(y3PBHw?gdu4UDt3y-S!BE?_^a$HW#~tfumBU9_=dz^`0tpJBgI`Xy2gMFkea zR6n)-L#U`E$My}(7>x;bw)e`V(q6=UMSX%l*gUV&BGDqlKa6(rp4- k8E^z3t84`RKPFB^Ij{Y)L_>GrcX24pf#O82vIUd=2G<-I2mk;8 literal 0 HcmV?d00001 diff --git a/Tests/ReferenceImages_iOS_10/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png b/Tests/ReferenceImages_iOS_10/ASTextNodeSnapshotTests/testFontPointSizeScaling@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..111bd5004842fec4a3eab9adc46b4b649de4286d GIT binary patch literal 1770 zcmbW2c{tRI8pmfEeq%7BXzWHvLn*REp)qELj578ma(<3#EXQ%O7o9VVt*KimLzWuM zSTad+Y*((IuB;g;OA#YvZ{+0KqBA|u{pbFB-{<+hpYQwr@%`(4p7(~clRa8mRT>6^ zp&ibUUBwI)i!23*dn%_IiZ zzb04LSwqfwoN>H(RLZ2XwtdL;Eq{QzPgnngyLO7bK6UrCZN>27@aBR=pCLgINE3+W zo9l-~@z%53Cm#ydx2R< zl$ff8ovLYgEOc;Ak|~Uj!-m-Sm}Sb~$x1ZcFpLv}P;_knqur?Hmi|7E#)r^|bnGGA zYE<`jtIq|`b|&_-3mZ%c{k}f$5eHhT=YPBrTOR4?-ox=Yw!SWi$Z{)=APitvjvFK^ zay~-m$&F|OnAZ?eNX|tP&vhk8ba|L3HEFrv>t759m^Fmt+vJtHZK4vS?zEq3b{LO; zF2^&%u4%La+IN=KnaZZ5fk;^xPXo{o zvc6wcg%B21We-lwTRBAYM zf&|i`Q&BE2k!mDr1fEyr!B^cJ12(1VAi=pN`Auvp&6F zJ~*_ygB-o)@M4J;HTsim*3tqH$xEO!ytX_ayHz+X0>5)V(q35^{)_5!zO1yi_JYY$4fT?Cz9ymltv z`+XKZ>~c4=Y-oxYs%{ZD_}e@Ylwk0C+>qx7f$;`vLz{0jM$tTR5AGyu&z=fKejGZ>Yw!?N1NYOVJRT z#4XKqUjxQr%Mk^?$v;bP4xCj>D;;|}a&}-%NX5yKIBkQ4`=XOpi|P_P&fx}^;F_*< z3{Y4e!@PbSUz>bX2=PS+G)!d^a_00zv5HZNgjVFy#D%>RK$%O6io4|qW}LMBpG1YW zFE3ktIa|b{QK8{iGd(njlAwpi<2UNB$hQ2xBK3;13sc~<@iM=F)+*0Hg-w~_)kZFR z@Ynt#A}zBK+XM+XZcIO{4g{)LFu7UKYM#H4Rfqs;a6uD*l<`V_i7jEkmT6`=#)y)) zQqP`(y3PBHw?gdu4UDt3y-S!BE?_^a$HW#~tfumBU9_=dz^`0tpJBgI`Xy2gMFkea zR6n)-L#U`E$My}(7>x;bw)e`V(q6=UMSX%l*gUV&BGDqlKa6(rp4- k8E^z3t84`RKPFB^Ij{Y)L_>GrcX24pf#O82vIUd=2G<-I2mk;8 literal 0 HcmV?d00001 From 022b6b77854d77b8bc82d548f52eb303e29408dd Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Mon, 20 Aug 2018 23:26:14 +0200 Subject: [PATCH 56/97] Fix multiple documentation issues #trivial (#1073) --- docs/_data/nav_docs.yml | 1 - docs/_docs/asrunloopqueue.md | 2 +- docs/_docs/automatic-layout-containers.md | 8 +-- .../layout2-layout-element-properties.md | 70 +++++++++---------- docs/_docs/team.md | 2 +- 5 files changed, 41 insertions(+), 42 deletions(-) diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index 91e76d3434..6b4b7b8072 100755 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -44,7 +44,6 @@ - title: Advanced Technologies items: - asvisibility - - asenvironment - asrunloopqueue - title: Node Containers items: diff --git a/docs/_docs/asrunloopqueue.md b/docs/_docs/asrunloopqueue.md index cd2e978c22..f40f532ed8 100755 --- a/docs/_docs/asrunloopqueue.md +++ b/docs/_docs/asrunloopqueue.md @@ -2,7 +2,7 @@ title: ASRunLoopQueue layout: docs permalink: /docs/asrunloopqueue.html -prevPage: asenvironment.html +prevPage: asvisibility.html --- Even with main thread work, Texture is able to dramatically reduce its impact on the user experience by way of the rather amazing ASRunLoopQueue. diff --git a/docs/_docs/automatic-layout-containers.md b/docs/_docs/automatic-layout-containers.md index 8bd56d205b..b612b37c78 100755 --- a/docs/_docs/automatic-layout-containers.md +++ b/docs/_docs/automatic-layout-containers.md @@ -16,7 +16,7 @@ Both nodes and layoutSpecs conform to the `` protocol. Any `ASLay ### Single Child layoutSpecs - +
    @@ -39,10 +39,10 @@ Both nodes and layoutSpecs conform to the `` protocol. Any `ASLay - + - + @@ -70,7 +70,7 @@ The following layoutSpecs may contain one or more children.
    LayoutSpec Description
    ASRatioLayoutSpec

    Lays out a component at a fixed aspect ratio (which can be scaled).

    This spec is great for objects that do not have an intrinisic size, such as ASNetworkImageNodes and ASVideoNodes.

    Lays out a component at a fixed aspect ratio (which can be scaled).

    This spec is great for objects that do not have an intrinisic size, such as ASNetworkImageNodes and ASVideoNodes.

    ASRelativeLayoutSpecASRelativeLayoutSpec

    Lays out a component and positions it within the layout bounds according to vertical and horizontal positional specifiers. Similar to the “9-part” image areas, a child can be positioned at any of the 4 corners, or the middle of any of the 4 edges, as well as the center.

    -# ASLayoutable Properties +### ASLayoutable Properties The following properties can be applied to both nodes _and_ `layoutSpec`s; both conform to the `ASLayoutable` protocol. diff --git a/docs/_docs/layout2-layout-element-properties.md b/docs/_docs/layout2-layout-element-properties.md index 21ed56b113..18735a8cdf 100755 --- a/docs/_docs/layout2-layout-element-properties.md +++ b/docs/_docs/layout2-layout-element-properties.md @@ -22,42 +22,42 @@ nextPage: layout2-api-sizing.html Description - `CGFloat .style.spacingBefore` + CGFloat .style.spacingBefore Additional space to place before this object in the stacking direction. - `CGFloat .style.spacingAfter` + CGFloat .style.spacingAfter Additional space to place after this object in the stacking direction. - `CGFloat .style.flexGrow` + CGFloat .style.flexGrow If the sum of childrens' stack dimensions is less than the minimum size, should this object grow? - `CGFloat .style.flexShrink` + CGFloat .style.flexShrink If the sum of childrens' stack dimensions is greater than the maximum size, should this object shrink? - `ASDimension .style.flexBasis` - Specifies the initial size for this object, in the stack dimension (horizontal or vertical), before the `flexGrow` / `flexShrink` properties are applied and the remaining space is distributed. + ASDimension .style.flexBasis + Specifies the initial size for this object, in the stack dimension (horizontal or vertical), before the flexGrow / flexShrink properties are applied and the remaining space is distributed. - `ASStackLayoutAlignSelf .style.alignSelf` + ASStackLayoutAlignSelf .style.alignSelf Orientation of the object along cross axis, overriding alignItems. Options include:
      -
    • `ASStackLayoutAlignSelfAuto`
    • -
    • `ASStackLayoutAlignSelfStart`
    • -
    • `ASStackLayoutAlignSelfEnd`
    • -
    • `ASStackLayoutAlignSelfCenter`
    • -
    • `ASStackLayoutAlignSelfStretch`
    • +
    • ASStackLayoutAlignSelfAuto
    • +
    • ASStackLayoutAlignSelfStart
    • +
    • ASStackLayoutAlignSelfEnd
    • +
    • ASStackLayoutAlignSelfCenter
    • +
    • ASStackLayoutAlignSelfStretch
    - `CGFloat .style.ascender` + CGFloat .style.ascender Used for baseline alignment. The distance from the top of the object to its baseline. - `CGFloat .style.descender` + CGFloat .style.descender Used for baseline alignment. The distance from the baseline of the object to its bottom. @@ -75,8 +75,8 @@ nextPage: layout2-api-sizing.html Description - `CGPoint .style.layoutPosition` - The `CGPoint` position of this object within its `ASAbsoluteLayoutSpec` parent spec. + CGPoint .style.layoutPosition + The CGPoint position of this object within its ASAbsoluteLayoutSpec parent spec. @@ -92,55 +92,55 @@ nextPage: layout2-api-sizing.html Description - `ASDimension .style.width` - The `width` property specifies the width of the content area of an `ASLayoutElement`. The `minWidth` and `maxWidth` properties override `width`. Defaults to `ASDimensionAuto`. + ASDimension .style.width + The width property specifies the width of the content area of an ASLayoutElement. The minWidth and maxWidth properties override width. Defaults to ASDimensionAuto. - `ASDimension .style.height` - The `height` property specifies the height of the content area of an `ASLayoutElement`. The `minHeight` and `maxHeight` properties override `height`. Defaults to `ASDimensionAuto`. + ASDimension .style.height + The height property specifies the height of the content area of an ASLayoutElement. The minHeight and maxHeight properties override height. Defaults to ASDimensionAuto. - `ASDimension .style.minWidth` - The `minWidth` property is used to set the minimum width of a given element. It prevents the used value of the `width` property from becoming smaller than the value specified for `minWidth`. The value of `minWidth` overrides both `maxWidth` and `width`. Defaults to `ASDimensionAuto`. + ASDimension .style.minWidth + The minWidth property is used to set the minimum width of a given element. It prevents the used value of the width property from becoming smaller than the value specified for minWidth. The value of minWidth overrides both maxWidth and width. Defaults to ASDimensionAuto. - `ASDimension .style.maxWidth` - The `maxWidth` property is used to set the maximum width of a given element. It prevents the used value of the `width` property from becoming larger than the value specified for `maxWidth`. The value of `maxWidth` overrides `width`, but `minWidth` overrides `maxWidth`. Defaults to `ASDimensionAuto`. + ASDimension .style.maxWidth + The maxWidth property is used to set the maximum width of a given element. It prevents the used value of the width property from becoming larger than the value specified for maxWidth. The value of maxWidth overrides width, but minWidth overrides maxWidth. Defaults to ASDimensionAuto. - `ASDimension .style.minHeight` - The `minHeight` property is used to set the minimum height of a given element. It prevents the used value of the `height` property from becoming smaller than the value specified for `minHeight`. The value of `minHeight` overrides both `maxHeight` and `height`. Defaults to `ASDimensionAuto`. + ASDimension .style.minHeight + The minHeight property is used to set the minimum height of a given element. It prevents the used value of the height property from becoming smaller than the value specified for minHeight. The value of minHeight overrides both maxHeight and height. Defaults to ASDimensionAuto. - `ASDimension .style.maxHeight` - The `maxHeight` property is used to set the maximum height of a given element. It prevents the used value of the `height` property from becoming larger than the value specified for `maxHeight`. The value of `maxHeight` overrides `height`, but `minHeight` overrides `maxHeight`. Defaults to `ASDimensionAuto` + ASDimension .style.maxHeight + The maxHeight property is used to set the maximum height of a given element. It prevents the used value of the height property from becoming larger than the value specified for maxHeight. The value of maxHeight overrides height, but minHeight overrides maxHeight. Defaults to ASDimensionAuto - `CGSize .style.preferredSize` + CGSize .style.preferredSize

    Provides a suggested size for a layout element. If the optional minSize or maxSize are provided, and the preferredSize exceeds these, the minSize or maxSize will be enforced. If this optional value is not provided, the layout element’s size will default to it’s intrinsic content size provided calculateSizeThatFits:

    This method is optional, but one of either preferredSize or preferredLayoutSize is required for nodes that either have no intrinsic content size or should be laid out at a different size than its intrinsic content size. For example, this property could be set on an ASImageNode to display at a size different from the underlying image size.

    Warning: calling the getter when the size's width or height are relative will cause an assert.

    - `CGSize .style.minSize` + CGSize .style.minSize

    An optional property that provides a minimum size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum size is smaller than its child’s minimum size, the child’s minimum size will be enforced and its size will extend out of the layout spec’s.

    For example, if you set a preferred relative width of 50% and a minimum width of 200 points on an element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, since 160 pts is lower than the minimum width of 200 pts, the minimum width would be used.

    - `CGSize .style.maxSize` + CGSize .style.maxSize

    An optional property that provides a maximum size bound for a layout element. If provided, this restriction will always be enforced. If a child layout element’s maximum size is smaller than its parent, the child’s maximum size will be enforced and its size will extend out of the layout spec’s.

    For example, if you set a preferred relative width of 50% and a maximum width of 120 points on an element in a full screen container, this would result in a width of 160 points on an iPhone screen. However, since 160 pts is higher than the maximum width of 120 pts, the maximum width would be used.

    - `ASLayoutSize .style.preferredLayoutSize` - Provides a suggested RELATIVE size for a layout element. An ASLayoutSize uses percentages rather than points to specify layout. E.g. width should be 50% of the parent’s width. If the optional minLayoutSize or maxLayoutSize are provided, and the preferredLayoutSize exceeds these, the minLayoutSize or maxLayoutSize will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size provided `calculateSizeThatFits:` + ASLayoutSize .style.preferredLayoutSize + Provides a suggested RELATIVE size for a layout element. An ASLayoutSize uses percentages rather than points to specify layout. E.g. width should be 50% of the parent’s width. If the optional minLayoutSize or maxLayoutSize are provided, and the preferredLayoutSize exceeds these, the minLayoutSize or maxLayoutSize will be enforced. If this optional value is not provided, the layout element’s size will default to its intrinsic content size provided calculateSizeThatFits: - `ASLayoutSize .style.minLayoutSize` + ASLayoutSize .style.minLayoutSize An optional property that provides a minimum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s minimum relative size is smaller than its child’s minimum relative size, the child’s minimum relative size will be enforced and its size will extend out of the layout spec’s. - `ASLayoutSize .style.maxLayoutSize` + ASLayoutSize .style.maxLayoutSize An optional property that provides a maximum RELATIVE size bound for a layout element. If provided, this restriction will always be enforced. If a parent layout element’s maximum relative size is smaller than its child’s maximum relative size, the child’s maximum relative size will be enforced and its size will extend out of the layout spec’s. diff --git a/docs/_docs/team.md b/docs/_docs/team.md index 5f67265894..e3a9643912 100755 --- a/docs/_docs/team.md +++ b/docs/_docs/team.md @@ -13,7 +13,7 @@ permalink: /docs/team.html -

    Michael Schneider (@maicki) is especially passionate about API design and recently led the re-architecture of the layout API for the 2.0 release. As our resident layout expert, Michael volunteers much of his own time to help developers on Texture's public slack channel. Previous, Michael worked on Pocket for iOS, Mac and Chrome and the Instapaper Mac app.

    +

    Michael Schneider (@maicki) is especially passionate about API design and recently led the re-architecture of the layout API for the 2.0 release. As our resident layout expert, Michael volunteers much of his own time to help developers on Texture's public slack channel. Before he joined Pinterest, Michael worked on Pocket for iOS, Mac and Chrome and Read Later an Instapaper and Pocket Mac app.

    From 2e95f5503eed6ac766e2b7a293a33b0c5722bca1 Mon Sep 17 00:00:00 2001 From: JK Junkyu Jeon Date: Tue, 21 Aug 2018 23:54:36 +0900 Subject: [PATCH 57/97] Update showcase to add Wishpoke (#1078) --- docs/showcase.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/showcase.md b/docs/showcase.md index 1eaddbf0df..fed05f3d03 100755 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -256,6 +256,12 @@ permalink: /showcase.html
    Apollo for Reddit + + + +
    + Wishpoke + From 31cb65b38a67088ca62a47ab563a607d810aabce Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Wed, 22 Aug 2018 16:14:03 -0700 Subject: [PATCH 58/97] Fix compiler error in ASLocking #trivial (#1079) --- Source/ASLocking.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASLocking.h b/Source/ASLocking.h index 1e53a150ea..46c12e96c3 100644 --- a/Source/ASLocking.h +++ b/Source/ASLocking.h @@ -107,7 +107,7 @@ NS_INLINE void ASUnlockSet(ASLockSet *lockSet) { */ NS_INLINE ASLockSet ASLockSequence(NS_NOESCAPE ASLockSequenceBlock body) { - __block ASLockSet locks = (ASLockSet){0}; + __block ASLockSet locks = (ASLockSet){0, {}}; BOOL (^addLock)(id) = ^(id obj) { // nil lock = ignore. From 1d31fc21d406ba51f5103fe8963c01e6a29a7c6b Mon Sep 17 00:00:00 2001 From: Jia Wern Lim <42153084+jiawernlim@users.noreply.github.com> Date: Fri, 24 Aug 2018 11:41:27 -0700 Subject: [PATCH 59/97] Refactored `accessibleElements` to `accessibilityElements` (#1069) * Refactored `accessibleElements` to `accessibilityElements`, and removed the re-definition of the property. With this refactor, the field can now be used as a single access point into the accessibility elements of a view. Also, removing the re-definition of the property in _ASDisplayViewAccessibility.h enables us to make use of the field and its associated helper methods directly from the `UIAccessibilityContainer` API rather than rolling our own implementation. * Added tests for the accessors to ASDisplayView.accessibilityElements. * Commented out tests for older a11y accessors & added relevant warnings. Also added assertions that the getter and setter for the accessibilityElements property are used only on the main thread. --- AsyncDisplayKit.xcodeproj/project.pbxproj | 5 +++ CHANGELOG.md | 1 + Source/ASDisplayNode+Yoga.mm | 2 +- Source/Details/_ASDisplayView.mm | 8 ++-- Source/Details/_ASDisplayViewAccessiblity.h | 8 ++-- Source/Details/_ASDisplayViewAccessiblity.mm | 42 +++++++------------- Tests/ASDisplayViewAccessibilityTests.mm | 42 ++++++++++++++++++++ 7 files changed, 72 insertions(+), 36 deletions(-) create mode 100644 Tests/ASDisplayViewAccessibilityTests.mm diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 30f3f6e941..e916d4bf5c 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -497,6 +497,7 @@ E5E281761E71C845006B67C2 /* ASCollectionLayoutState.mm in Sources */ = {isa = PBXBuildFile; fileRef = E5E281751E71C845006B67C2 /* ASCollectionLayoutState.mm */; }; E5E2D72E1EA780C4005C24C6 /* ASCollectionGalleryLayoutDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = E5E2D72D1EA780C4005C24C6 /* ASCollectionGalleryLayoutDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; E5E2D7301EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E5E2D72F1EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm */; }; + F3F698D2211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */; }; F711994E1D20C21100568860 /* ASDisplayNodeExtrasTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F711994D1D20C21100568860 /* ASDisplayNodeExtrasTests.m */; }; FA4FAF15200A850200E735BD /* ASControlNode+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA4FAF14200A850200E735BD /* ASControlNode+Private.h */; }; /* End PBXBuildFile section */ @@ -1028,6 +1029,7 @@ E5E2D72D1EA780C4005C24C6 /* ASCollectionGalleryLayoutDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCollectionGalleryLayoutDelegate.h; sourceTree = ""; }; E5E2D72F1EA780DF005C24C6 /* ASCollectionGalleryLayoutDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = ASCollectionGalleryLayoutDelegate.mm; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; EFA731F0396842FF8AB635EE /* libPods-AsyncDisplayKitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AsyncDisplayKitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDisplayViewAccessibilityTests.mm; sourceTree = ""; }; F711994D1D20C21100568860 /* ASDisplayNodeExtrasTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASDisplayNodeExtrasTests.m; sourceTree = ""; }; FA4FAF14200A850200E735BD /* ASControlNode+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASControlNode+Private.h"; sourceTree = ""; }; FB07EABBCF28656C6297BC2D /* Pods-AsyncDisplayKitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AsyncDisplayKitTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AsyncDisplayKitTests/Pods-AsyncDisplayKitTests.debug.xcconfig"; sourceTree = ""; }; @@ -1255,6 +1257,8 @@ 058D09C5195D04C000B7D73C /* Tests */ = { isa = PBXGroup; children = ( + F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */, + CC35CEC520DD87280006448D /* ASCollectionsTests.m */, DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.m */, AC026B571BD3F61800BBC17E /* ASAbsoluteLayoutSpecSnapshotTests.m */, 696FCB301D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm */, @@ -2299,6 +2303,7 @@ 4E9127691F64157600499623 /* ASRunLoopQueueTests.m in Sources */, CC4981B31D1A02BE004E13CC /* ASTableViewThrashTests.m in Sources */, CC54A81E1D7008B300296A24 /* ASDispatchTests.m in Sources */, + F3F698D2211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm in Sources */, CCE4F9B31F0D60AC00062E4E /* ASIntegerMapTests.m in Sources */, 058D0A3B195D057000B7D73C /* ASDisplayNodeTestsHelper.m in Sources */, 83A7D95E1D446A6E00BF333E /* ASWeakMapTests.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 01ecb97cab..dfd341c4c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - Add an experimental feature that reuses CTFramesetter objects in ASTextNode2 to improve performance. [Adlai Holler](https://github.com/Adlai-Holler) - Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: [Michael Schneider](https://github.com/maicki) [#1054](https://github.com/TextureGroup/Texture/pull/1054) - Optimize text stack by removing unneeded copying. [Adlai Holler](https://github.com/Adlai-Holler) +- Renamed `accessibleElements` to `accessibilityElements` and removed the re-definition of the property in ASDisplayView. [Jia Wern Lim](https://github.com/jiawernlim) - Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen) ## 2.7 diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index ea9739de86..dc2f27cb7f 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -298,7 +298,7 @@ // Reset accessible elements, since layout may have changed. ASPerformBlockOnMainThread(^{ - [(_ASDisplayView *)self.view setAccessibleElements:nil]; + [(_ASDisplayView *)self.view setAccessibilityElements:nil]; }); ASDisplayNodePerformBlockOnEveryYogaChild(self, ^(ASDisplayNode * _Nonnull node) { diff --git a/Source/Details/_ASDisplayView.mm b/Source/Details/_ASDisplayView.mm index 21fdd17f12..92907152a2 100644 --- a/Source/Details/_ASDisplayView.mm +++ b/Source/Details/_ASDisplayView.mm @@ -99,8 +99,8 @@ static _ASDisplayViewMethodOverrides GetASDisplayViewMethodOverrides(Class c) BOOL _inHitTest; BOOL _inPointInside; - NSArray *_accessibleElements; - CGRect _lastAccessibleElementsFrame; + NSArray *_accessibilityElements; + CGRect _lastAccessibilityElementsFrame; _ASDisplayViewMethodOverrides _methodOverrides; } @@ -303,7 +303,7 @@ static _ASDisplayViewMethodOverrides GetASDisplayViewMethodOverrides(Class c) [super addSubview:view]; #ifndef ASDK_ACCESSIBILITY_DISABLE - self.accessibleElements = nil; + self.accessibilityElements = nil; #endif } @@ -312,7 +312,7 @@ static _ASDisplayViewMethodOverrides GetASDisplayViewMethodOverrides(Class c) [super willRemoveSubview:subview]; #ifndef ASDK_ACCESSIBILITY_DISABLE - self.accessibleElements = nil; + self.accessibilityElements = nil; #endif } diff --git a/Source/Details/_ASDisplayViewAccessiblity.h b/Source/Details/_ASDisplayViewAccessiblity.h index 5edd82e23f..d697943282 100644 --- a/Source/Details/_ASDisplayViewAccessiblity.h +++ b/Source/Details/_ASDisplayViewAccessiblity.h @@ -18,6 +18,8 @@ #import #import -@interface _ASDisplayView (UIAccessibilityContainer) -@property (copy, nonatomic) NSArray *accessibleElements; -@end +// WARNING: When dealing with accessibility elements, please use the `accessibilityElements` +// property instead of the older methods e.g. `accessibilityElementCount()`. While the older methods +// should still work as long as accessibility is enabled, this framework provides no guarantees on +// their correctness. For details, see +// https://developer.apple.com/documentation/objectivec/nsobject/1615147-accessibilityelements diff --git a/Source/Details/_ASDisplayViewAccessiblity.mm b/Source/Details/_ASDisplayViewAccessiblity.mm index 1f336ac529..ff812e4ea2 100644 --- a/Source/Details/_ASDisplayViewAccessiblity.mm +++ b/Source/Details/_ASDisplayViewAccessiblity.mm @@ -243,7 +243,7 @@ static void CollectAccessibilityElementsForView(_ASDisplayView *view, NSMutableA } @interface _ASDisplayView () { - NSArray *_accessibleElements; + NSArray *_accessibilityElements; } @end @@ -252,43 +252,29 @@ static void CollectAccessibilityElementsForView(_ASDisplayView *view, NSMutableA #pragma mark - UIAccessibility -- (void)setAccessibleElements:(NSArray *)accessibleElements +- (void)setAccessibilityElements:(NSArray *)accessibilityElements { - _accessibleElements = nil; + ASDisplayNodeAssertMainThread(); + _accessibilityElements = nil; } -- (NSArray *)accessibleElements +- (NSArray *)accessibilityElements { + ASDisplayNodeAssertMainThread(); + ASDisplayNode *viewNode = self.asyncdisplaykit_node; if (viewNode == nil) { return @[]; } - - if (_accessibleElements != nil) { - return _accessibleElements; + + if (_accessibilityElements == nil) { + NSMutableArray *accessibilityElements = [[NSMutableArray alloc] init]; + CollectAccessibilityElementsForView(self, accessibilityElements); + SortAccessibilityElements(accessibilityElements); + _accessibilityElements = accessibilityElements; } - NSMutableArray *accessibleElements = [[NSMutableArray alloc] init]; - CollectAccessibilityElementsForView(self, accessibleElements); - SortAccessibilityElements(accessibleElements); - _accessibleElements = accessibleElements; - - return _accessibleElements; -} - -- (NSInteger)accessibilityElementCount -{ - return self.accessibleElements.count; -} - -- (id)accessibilityElementAtIndex:(NSInteger)index -{ - return self.accessibleElements[index]; -} - -- (NSInteger)indexOfAccessibilityElement:(id)element -{ - return [self.accessibleElements indexOfObjectIdenticalTo:element]; + return _accessibilityElements; } @end diff --git a/Tests/ASDisplayViewAccessibilityTests.mm b/Tests/ASDisplayViewAccessibilityTests.mm new file mode 100644 index 0000000000..e35d1fa0bf --- /dev/null +++ b/Tests/ASDisplayViewAccessibilityTests.mm @@ -0,0 +1,42 @@ +// +// ASDisplayViewAccessibilityTests.mm +// Texture +// +// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. +// 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 + +#import +#import + +@interface ASDisplayViewAccessibilityTests : XCTestCase +@end + +@implementation ASDisplayViewAccessibilityTests + +- (void)testAccessibilityElementsAccessors +{ + // Setup nodes with accessibility info + ASDisplayNode *node = nil; + ASDisplayNode *subnode = nil; + node = [[ASDisplayNode alloc] init]; + subnode = [[ASDisplayNode alloc] init]; + NSString *label = @"foo"; + subnode.isAccessibilityElement = YES; + subnode.accessibilityLabel = label; + [node addSubnode:subnode]; + XCTAssertEqualObjects([node.view.accessibilityElements.firstObject accessibilityLabel], label); + // NOTE: The following tests will fail unless accessibility is enabled, e.g. by turning the + // accessibility inspector on. See https://github.com/TextureGroup/Texture/pull/1069 for details. + /*XCTAssertEqualObjects([[node.view accessibilityElementAtIndex:0] accessibilityLabel], label); + XCTAssertEqual(node.view.accessibilityElementCount, 1); + XCTAssertEqual([node.view indexOfAccessibilityElement:node.view.accessibilityElements.firstObject], 0);*/ +} + +@end From 465abb1ded1777e7573a65e70df0ef0a2bda0df4 Mon Sep 17 00:00:00 2001 From: appleguy Date: Tue, 28 Aug 2018 07:39:18 -0700 Subject: [PATCH 60/97] [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077) * [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses) With permission of the Facebook Open Source team, we are simplifying the Texture license so that clients can rely on the Apache 2 terms that most of Texture is already covered by. This means that code originally forked from AsyncDisplayKit will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a PATENTS file. After getting confirmation that the updates to these core files look good, we'll propagate this new license header to all files (in this same PR) and get sign-off from all parties before landing. * [License] Update all Texture source files to be pure Apache 2. * Changelog entry for Apache 2 license update. * Revert "[License] Update all Texture source files to be pure Apache 2." This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b. * [License] Update all Texture source files to be pure Apache 2, maintaining copyrights. * [License] Update CONTRIBUTING, README, Podspec & Dangerfile. --- ASDK-Licenses/LICENSE | 30 ----------------- ASDK-Licenses/PATENTS | 33 ------------------- CHANGELOG.md | 1 + CONTRIBUTING.md | 22 +++---------- Dangerfile | 26 ++++----------- LICENSE | 14 +++----- README.md | 2 +- Source/ASBlockTypes.h | 14 ++------ Source/ASButtonNode.h | 14 ++------ Source/ASButtonNode.mm | 14 ++------ Source/ASCGImageBuffer.h | 8 ++--- Source/ASCGImageBuffer.m | 8 ++--- Source/ASCellNode.h | 14 ++------ Source/ASCellNode.mm | 14 ++------ Source/ASCollectionNode+Beta.h | 14 ++------ Source/ASCollectionNode.h | 14 ++------ Source/ASCollectionNode.mm | 14 ++------ Source/ASCollectionView.h | 14 ++------ Source/ASCollectionView.mm | 14 ++------ ...SCollectionViewLayoutFacilitatorProtocol.h | 14 ++------ Source/ASCollectionViewProtocols.h | 14 ++------ Source/ASCollections.h | 8 ++--- Source/ASCollections.m | 8 ++--- Source/ASConfiguration.h | 8 ++--- Source/ASConfiguration.m | 8 ++--- Source/ASConfigurationDelegate.h | 8 ++--- Source/ASConfigurationInternal.h | 8 ++--- Source/ASConfigurationInternal.m | 8 ++--- Source/ASContextTransitioning.h | 14 ++------ Source/ASControlNode+Subclasses.h | 14 ++------ Source/ASControlNode.h | 14 ++------ Source/ASControlNode.mm | 14 ++------ Source/ASDisplayNode+Beta.h | 14 ++------ Source/ASDisplayNode+Convenience.h | 14 ++------ Source/ASDisplayNode+Convenience.m | 14 ++------ Source/ASDisplayNode+InterfaceState.h | 8 ++--- Source/ASDisplayNode+Layout.mm | 14 ++------ Source/ASDisplayNode+Subclasses.h | 14 ++------ Source/ASDisplayNode+Yoga.mm | 14 ++------ Source/ASDisplayNode.h | 14 ++------ Source/ASDisplayNode.mm | 14 ++------ Source/ASDisplayNodeExtras.h | 14 ++------ Source/ASDisplayNodeExtras.mm | 14 ++------ Source/ASEditableTextNode.h | 14 ++------ Source/ASEditableTextNode.mm | 14 ++------ Source/ASExperimentalFeatures.h | 8 ++--- Source/ASExperimentalFeatures.m | 8 ++--- Source/ASImageNode+AnimatedImage.mm | 14 ++------ Source/ASImageNode.h | 14 ++------ Source/ASImageNode.mm | 14 ++------ Source/ASLocking.h | 8 ++--- Source/ASMainThreadDeallocation.h | 8 ++--- Source/ASMainThreadDeallocation.mm | 8 ++--- Source/ASMapNode.h | 14 ++------ Source/ASMapNode.mm | 14 ++------ Source/ASMultiplexImageNode.h | 14 ++------ Source/ASMultiplexImageNode.mm | 14 ++------ Source/ASNavigationController.h | 14 ++------ Source/ASNavigationController.m | 14 ++------ Source/ASNetworkImageLoadInfo.h | 8 ++--- Source/ASNetworkImageLoadInfo.m | 8 ++--- Source/ASNetworkImageNode.h | 14 ++------ Source/ASNetworkImageNode.mm | 14 ++------ Source/ASNodeController+Beta.h | 14 ++------ Source/ASNodeController+Beta.mm | 16 +++------ Source/ASPagerFlowLayout.h | 14 ++------ Source/ASPagerFlowLayout.m | 14 ++------ Source/ASPagerNode+Beta.h | 8 ++--- Source/ASPagerNode.h | 14 ++------ Source/ASPagerNode.m | 14 ++------ Source/ASRangeManagingNode.h | 8 ++--- Source/ASRunLoopQueue.h | 14 ++------ Source/ASRunLoopQueue.mm | 14 ++------ Source/ASScrollNode.h | 14 ++------ Source/ASScrollNode.mm | 14 ++------ Source/ASSectionController.h | 14 ++------ Source/ASSupplementaryNodeSource.h | 14 ++------ Source/ASTabBarController.h | 14 ++------ Source/ASTabBarController.m | 14 ++------ Source/ASTableNode+Beta.h | 8 ++--- Source/ASTableNode.h | 14 ++------ Source/ASTableNode.mm | 14 ++------ Source/ASTableView.h | 14 ++------ Source/ASTableView.mm | 14 ++------ Source/ASTableViewInternal.h | 14 ++------ Source/ASTableViewProtocols.h | 14 ++------ Source/ASTextNode+Beta.h | 14 ++------ Source/ASTextNode.h | 14 ++------ Source/ASTextNode.mm | 14 ++------ Source/ASTextNode2.h | 8 ++--- Source/ASTextNode2.mm | 8 ++--- Source/ASTextNodeCommon.h | 8 ++--- Source/ASVideoNode.h | 14 ++------ Source/ASVideoNode.mm | 14 ++------ Source/ASVideoPlayerNode.h | 14 ++------ Source/ASVideoPlayerNode.mm | 14 ++------ Source/ASViewController.h | 14 ++------ Source/ASViewController.mm | 14 ++------ Source/ASVisibilityProtocols.h | 14 ++------ Source/ASVisibilityProtocols.m | 14 ++------ Source/AsyncDisplayKit+IGListKitMethods.h | 14 ++------ Source/AsyncDisplayKit+IGListKitMethods.m | 14 ++------ Source/AsyncDisplayKit.h | 14 ++------ Source/Base/ASAssert.h | 14 ++------ Source/Base/ASAssert.m | 8 ++--- Source/Base/ASAvailability.h | 14 ++------ Source/Base/ASBaseDefines.h | 14 ++------ Source/Base/ASDisplayNode+Ancestry.h | 14 ++------ Source/Base/ASDisplayNode+Ancestry.m | 14 ++------ Source/Base/ASEqualityHelpers.h | 14 ++------ Source/Base/ASLog.h | 14 ++------ Source/Base/ASLog.m | 8 ++--- Source/Base/ASSignpost.h | 8 ++--- Source/Debug/AsyncDisplayKit+Debug.h | 14 ++------ Source/Debug/AsyncDisplayKit+Debug.m | 14 ++------ Source/Debug/AsyncDisplayKit+Tips.h | 14 ++------ Source/Debug/AsyncDisplayKit+Tips.m | 14 ++------ Source/Details/ASAbstractLayoutController.h | 14 ++------ Source/Details/ASAbstractLayoutController.mm | 14 ++------ Source/Details/ASBasicImageDownloader.h | 14 ++------ Source/Details/ASBasicImageDownloader.mm | 14 ++------ Source/Details/ASBatchContext.h | 14 ++------ Source/Details/ASBatchContext.m | 14 ++------ Source/Details/ASBatchFetchingDelegate.h | 8 ++--- Source/Details/ASCollectionElement.h | 14 ++------ Source/Details/ASCollectionElement.mm | 14 ++------ .../Details/ASCollectionFlowLayoutDelegate.h | 14 ++------ .../Details/ASCollectionFlowLayoutDelegate.m | 14 ++------ .../ASCollectionGalleryLayoutDelegate.h | 8 ++--- .../ASCollectionGalleryLayoutDelegate.mm | 8 ++--- Source/Details/ASCollectionInternal.h | 14 ++------ Source/Details/ASCollectionInternal.m | 14 ++------ Source/Details/ASCollectionLayoutContext.h | 14 ++------ Source/Details/ASCollectionLayoutContext.m | 8 ++--- Source/Details/ASCollectionLayoutDelegate.h | 14 ++------ Source/Details/ASCollectionLayoutState.h | 14 ++------ Source/Details/ASCollectionLayoutState.mm | 8 ++--- .../ASCollectionViewLayoutController.h | 14 ++------ .../ASCollectionViewLayoutController.m | 14 ++------ .../Details/ASCollectionViewLayoutInspector.h | 14 ++------ .../Details/ASCollectionViewLayoutInspector.m | 14 ++------ Source/Details/ASDataController.h | 14 ++------ Source/Details/ASDataController.mm | 14 ++------ Source/Details/ASDelegateProxy.h | 14 ++------ Source/Details/ASDelegateProxy.m | 14 ++------ Source/Details/ASElementMap.h | 14 ++------ Source/Details/ASElementMap.m | 14 ++------ Source/Details/ASEventLog.h | 14 ++------ Source/Details/ASEventLog.mm | 14 ++------ Source/Details/ASGraphicsContext.h | 8 ++--- Source/Details/ASGraphicsContext.m | 8 ++--- Source/Details/ASHashing.h | 8 ++--- Source/Details/ASHashing.m | 8 ++--- Source/Details/ASHighlightOverlayLayer.h | 14 ++------ Source/Details/ASHighlightOverlayLayer.mm | 14 ++------ .../ASImageContainerProtocolCategories.h | 14 ++------ .../ASImageContainerProtocolCategories.m | 14 ++------ Source/Details/ASImageProtocols.h | 14 ++------ Source/Details/ASIntegerMap.h | 8 ++--- Source/Details/ASIntegerMap.mm | 8 ++--- Source/Details/ASLayoutController.h | 14 ++------ Source/Details/ASLayoutRangeType.h | 14 ++------ Source/Details/ASMainSerialQueue.h | 14 ++------ Source/Details/ASMainSerialQueue.mm | 14 ++------ .../ASMutableAttributedStringBuilder.h | 14 ++------ .../ASMutableAttributedStringBuilder.m | 14 ++------ Source/Details/ASObjectDescriptionHelpers.h | 14 ++------ Source/Details/ASObjectDescriptionHelpers.m | 14 ++------ Source/Details/ASPINRemoteImageDownloader.h | 14 ++------ Source/Details/ASPINRemoteImageDownloader.m | 14 ++------ Source/Details/ASPageTable.h | 8 ++--- Source/Details/ASPageTable.m | 8 ++--- .../Details/ASPhotosFrameworkImageRequest.h | 14 ++------ .../Details/ASPhotosFrameworkImageRequest.m | 14 ++------ Source/Details/ASRangeController.h | 14 ++------ Source/Details/ASRangeController.mm | 14 ++------ ...SRangeControllerUpdateRangeProtocol+Beta.h | 14 ++------ Source/Details/ASRecursiveUnfairLock.h | 8 ++--- Source/Details/ASRecursiveUnfairLock.m | 8 ++--- Source/Details/ASScrollDirection.h | 14 ++------ Source/Details/ASScrollDirection.m | 14 ++------ Source/Details/ASSectionContext.h | 14 ++------ Source/Details/ASTableLayoutController.h | 14 ++------ Source/Details/ASTableLayoutController.m | 14 ++------ Source/Details/ASThread.h | 14 ++------ Source/Details/ASTraceEvent.h | 14 ++------ Source/Details/ASTraceEvent.m | 14 ++------ Source/Details/ASTraitCollection.h | 14 ++------ Source/Details/ASTraitCollection.m | 14 ++------ Source/Details/ASWeakProxy.h | 14 ++------ Source/Details/ASWeakProxy.m | 14 ++------ Source/Details/ASWeakSet.h | 14 ++------ Source/Details/ASWeakSet.m | 14 ++------ Source/Details/CoreGraphics+ASConvenience.h | 14 ++------ Source/Details/CoreGraphics+ASConvenience.m | 14 ++------ Source/Details/NSArray+Diffing.h | 14 ++------ Source/Details/NSArray+Diffing.mm | 16 +++------ Source/Details/NSIndexSet+ASHelpers.h | 14 ++------ Source/Details/NSIndexSet+ASHelpers.m | 14 ++------ ...MutableAttributedString+TextKitAdditions.h | 14 ++------ ...MutableAttributedString+TextKitAdditions.m | 14 ++------ .../Transactions/_ASAsyncTransaction.h | 14 ++------ .../Transactions/_ASAsyncTransaction.mm | 14 ++------ .../_ASAsyncTransactionContainer+Private.h | 14 ++------ .../_ASAsyncTransactionContainer.h | 14 ++------ .../_ASAsyncTransactionContainer.m | 14 ++------ .../Transactions/_ASAsyncTransactionGroup.h | 14 ++------ .../Transactions/_ASAsyncTransactionGroup.m | 14 ++------ .../UICollectionViewLayout+ASConvenience.h | 14 ++------ .../UICollectionViewLayout+ASConvenience.m | 14 ++------ Source/Details/UIView+ASConvenience.h | 14 ++------ Source/Details/_ASCollectionReusableView.h | 14 ++------ Source/Details/_ASCollectionReusableView.m | 14 ++------ Source/Details/_ASCollectionViewCell.h | 14 ++------ Source/Details/_ASCollectionViewCell.m | 14 ++------ Source/Details/_ASDisplayLayer.h | 14 ++------ Source/Details/_ASDisplayLayer.mm | 14 ++------ Source/Details/_ASDisplayView.h | 14 ++------ Source/Details/_ASDisplayView.mm | 14 ++------ Source/Details/_ASDisplayViewAccessiblity.h | 14 ++------ Source/Details/_ASDisplayViewAccessiblity.mm | 14 ++------ Source/IGListAdapter+AsyncDisplayKit.h | 14 ++------ Source/IGListAdapter+AsyncDisplayKit.m | 14 ++------ Source/Layout/ASAbsoluteLayoutElement.h | 14 ++------ Source/Layout/ASAbsoluteLayoutSpec.h | 14 ++------ Source/Layout/ASAbsoluteLayoutSpec.mm | 14 ++------ Source/Layout/ASAsciiArtBoxCreator.h | 14 ++------ Source/Layout/ASAsciiArtBoxCreator.m | 14 ++------ Source/Layout/ASBackgroundLayoutSpec.h | 14 ++------ Source/Layout/ASBackgroundLayoutSpec.mm | 14 ++------ Source/Layout/ASCenterLayoutSpec.h | 14 ++------ Source/Layout/ASCenterLayoutSpec.mm | 14 ++------ Source/Layout/ASCornerLayoutSpec.h | 8 ++--- Source/Layout/ASCornerLayoutSpec.mm | 8 ++--- Source/Layout/ASDimension.h | 14 ++------ Source/Layout/ASDimension.mm | 14 ++------ Source/Layout/ASDimensionInternal.h | 14 ++------ Source/Layout/ASDimensionInternal.mm | 14 ++------ Source/Layout/ASInsetLayoutSpec.h | 14 ++------ Source/Layout/ASInsetLayoutSpec.mm | 14 ++------ Source/Layout/ASLayout+IGListKit.h | 10 ++---- Source/Layout/ASLayout+IGListKit.mm | 8 ++--- Source/Layout/ASLayout.h | 14 ++------ Source/Layout/ASLayout.mm | 14 ++------ Source/Layout/ASLayoutElement.h | 14 ++------ Source/Layout/ASLayoutElement.mm | 14 ++------ Source/Layout/ASLayoutElementExtensibility.h | 14 ++------ Source/Layout/ASLayoutElementPrivate.h | 14 ++------ Source/Layout/ASLayoutSpec+Subclasses.h | 14 ++------ Source/Layout/ASLayoutSpec+Subclasses.mm | 14 ++------ Source/Layout/ASLayoutSpec.h | 14 ++------ Source/Layout/ASLayoutSpec.mm | 14 ++------ Source/Layout/ASOverlayLayoutSpec.h | 14 ++------ Source/Layout/ASOverlayLayoutSpec.mm | 14 ++------ Source/Layout/ASRatioLayoutSpec.h | 14 ++------ Source/Layout/ASRatioLayoutSpec.mm | 14 ++------ Source/Layout/ASRelativeLayoutSpec.h | 14 ++------ Source/Layout/ASRelativeLayoutSpec.mm | 14 ++------ Source/Layout/ASStackLayoutDefines.h | 14 ++------ Source/Layout/ASStackLayoutElement.h | 14 ++------ Source/Layout/ASStackLayoutSpec.h | 14 ++------ Source/Layout/ASStackLayoutSpec.mm | 14 ++------ Source/Layout/ASYogaUtilities.h | 8 ++--- Source/Layout/ASYogaUtilities.mm | 8 ++--- .../Private/ASBasicImageDownloaderInternal.h | 14 ++------ Source/Private/ASBatchFetching.h | 14 ++------ Source/Private/ASBatchFetching.m | 14 ++------ Source/Private/ASCellNode+Internal.h | 14 ++------ Source/Private/ASCollectionLayout.h | 8 ++--- Source/Private/ASCollectionLayout.mm | 14 ++------ Source/Private/ASCollectionLayoutCache.h | 8 ++--- Source/Private/ASCollectionLayoutCache.mm | 8 ++--- .../ASCollectionLayoutContext+Private.h | 14 ++------ Source/Private/ASCollectionLayoutDefines.h | 8 ++--- Source/Private/ASCollectionLayoutDefines.m | 8 ++--- .../Private/ASCollectionLayoutState+Private.h | 8 ++--- .../Private/ASCollectionView+Undeprecated.h | 14 ++------ .../ASCollectionViewFlowLayoutInspector.h | 14 ++------ .../ASCollectionViewFlowLayoutInspector.m | 14 ++------ Source/Private/ASControlNode+Private.h | 14 ++------ Source/Private/ASControlTargetAction.h | 14 ++------ Source/Private/ASControlTargetAction.m | 14 ++------ Source/Private/ASDefaultPlayButton.h | 14 ++------ Source/Private/ASDefaultPlayButton.m | 14 ++------ Source/Private/ASDefaultPlaybackButton.h | 14 ++------ Source/Private/ASDefaultPlaybackButton.m | 14 ++------ Source/Private/ASDispatch.h | 14 ++------ Source/Private/ASDispatch.m | 8 ++--- Source/Private/ASDisplayNode+AsyncDisplay.mm | 14 ++------ Source/Private/ASDisplayNode+DebugTiming.h | 14 ++------ Source/Private/ASDisplayNode+DebugTiming.mm | 14 ++------ .../Private/ASDisplayNode+FrameworkPrivate.h | 14 ++------ Source/Private/ASDisplayNode+UIViewBridge.mm | 14 ++------ .../ASDisplayNodeCornerLayerDelegate.h | 14 ++------ .../ASDisplayNodeCornerLayerDelegate.m | 14 ++------ Source/Private/ASDisplayNodeInternal.h | 14 ++------ Source/Private/ASDisplayNodeLayout.h | 14 ++------ Source/Private/ASDisplayNodeLayout.mm | 14 ++------ Source/Private/ASDisplayNodeTipState.h | 14 ++------ Source/Private/ASDisplayNodeTipState.m | 14 ++------ .../Private/ASIGListAdapterBasedDataSource.h | 14 ++------ .../Private/ASIGListAdapterBasedDataSource.m | 14 ++------ .../ASImageNode+AnimatedImagePrivate.h | 14 ++------ Source/Private/ASImageNode+CGExtras.h | 14 ++------ Source/Private/ASImageNode+CGExtras.m | 14 ++------ Source/Private/ASImageNode+Private.h | 14 ++------ Source/Private/ASInternalHelpers.h | 14 ++------ Source/Private/ASInternalHelpers.m | 14 ++------ Source/Private/ASLayerBackingTipProvider.h | 14 ++------ Source/Private/ASLayerBackingTipProvider.m | 14 ++------ Source/Private/ASLayoutTransition.h | 14 ++------ Source/Private/ASLayoutTransition.mm | 14 ++------ Source/Private/ASMutableElementMap.h | 14 ++------ Source/Private/ASMutableElementMap.m | 14 ++------ .../Private/ASNetworkImageLoadInfo+Private.h | 8 ++--- Source/Private/ASPendingStateController.h | 14 ++------ Source/Private/ASPendingStateController.mm | 14 ++------ Source/Private/ASRectMap.h | 8 ++--- Source/Private/ASRectMap.mm | 8 ++--- Source/Private/ASResponderChainEnumerator.h | 14 ++------ Source/Private/ASResponderChainEnumerator.m | 14 ++------ Source/Private/ASSection.h | 14 ++------ Source/Private/ASSection.m | 14 ++------ Source/Private/ASTableView+Undeprecated.h | 14 ++------ Source/Private/ASTip.h | 14 ++------ Source/Private/ASTip.m | 14 ++------ Source/Private/ASTipNode.h | 14 ++------ Source/Private/ASTipNode.m | 14 ++------ Source/Private/ASTipProvider.h | 14 ++------ Source/Private/ASTipProvider.m | 14 ++------ Source/Private/ASTipsController.h | 14 ++------ Source/Private/ASTipsController.m | 14 ++------ Source/Private/ASTipsWindow.h | 14 ++------ Source/Private/ASTipsWindow.m | 14 ++------ Source/Private/ASTwoDimensionalArrayUtils.h | 14 ++------ Source/Private/ASTwoDimensionalArrayUtils.m | 14 ++------ Source/Private/ASWeakMap.h | 14 ++------ Source/Private/ASWeakMap.m | 14 ++------ .../Layout/ASLayoutElementStylePrivate.h | 14 ++------ Source/Private/Layout/ASLayoutSpecPrivate.h | 14 ++------ Source/Private/Layout/ASLayoutSpecUtilities.h | 14 ++------ .../Layout/ASStackLayoutSpecUtilities.h | 14 ++------ .../Private/Layout/ASStackPositionedLayout.h | 14 ++------ .../Private/Layout/ASStackPositionedLayout.mm | 14 ++------ .../Layout/ASStackUnpositionedLayout.h | 14 ++------ .../Layout/ASStackUnpositionedLayout.mm | 14 ++------ .../Component/ASTextDebugOption.h | 9 ++--- .../Component/ASTextDebugOption.m | 9 ++--- .../TextExperiment/Component/ASTextInput.h | 14 ++------ .../TextExperiment/Component/ASTextInput.m | 14 ++------ .../TextExperiment/Component/ASTextLayout.h | 14 ++------ .../TextExperiment/Component/ASTextLayout.m | 14 ++------ .../TextExperiment/Component/ASTextLine.h | 14 ++------ .../TextExperiment/Component/ASTextLine.m | 14 ++------ .../TextExperiment/String/ASTextAttribute.h | 14 ++------ .../TextExperiment/String/ASTextAttribute.m | 14 ++------ .../TextExperiment/String/ASTextRunDelegate.h | 9 ++--- .../TextExperiment/String/ASTextRunDelegate.m | 9 ++--- .../TextExperiment/Utility/ASTextUtilities.h | 9 ++--- .../TextExperiment/Utility/ASTextUtilities.m | 9 ++--- .../Utility/NSAttributedString+ASText.h | 9 ++--- .../Utility/NSAttributedString+ASText.m | 9 ++--- .../Utility/NSParagraphStyle+ASText.h | 9 ++--- .../Utility/NSParagraphStyle+ASText.m | 9 ++--- .../Private/_ASCollectionGalleryLayoutInfo.h | 8 ++--- .../Private/_ASCollectionGalleryLayoutInfo.m | 8 ++--- .../Private/_ASCollectionGalleryLayoutItem.h | 8 ++--- .../Private/_ASCollectionGalleryLayoutItem.mm | 8 ++--- Source/Private/_ASCoreAnimationExtras.h | 14 ++------ Source/Private/_ASCoreAnimationExtras.mm | 14 ++------ Source/Private/_ASHierarchyChangeSet.h | 14 ++------ Source/Private/_ASHierarchyChangeSet.mm | 14 ++------ Source/Private/_ASPendingState.h | 14 ++------ Source/Private/_ASPendingState.mm | 14 ++------ Source/Private/_ASScopeTimer.h | 14 ++------ Source/TextKit/ASLayoutManager.h | 14 ++------ Source/TextKit/ASLayoutManager.m | 14 ++------ Source/TextKit/ASTextKitAttributes.h | 14 ++------ Source/TextKit/ASTextKitAttributes.mm | 14 ++------ Source/TextKit/ASTextKitComponents.h | 14 ++------ Source/TextKit/ASTextKitComponents.mm | 14 ++------ Source/TextKit/ASTextKitContext.h | 14 ++------ Source/TextKit/ASTextKitContext.mm | 14 ++------ Source/TextKit/ASTextKitCoreTextAdditions.h | 14 ++------ Source/TextKit/ASTextKitCoreTextAdditions.m | 14 ++------ Source/TextKit/ASTextKitEntityAttribute.h | 14 ++------ Source/TextKit/ASTextKitEntityAttribute.m | 14 ++------ Source/TextKit/ASTextKitFontSizeAdjuster.h | 14 ++------ Source/TextKit/ASTextKitFontSizeAdjuster.mm | 14 ++------ .../TextKit/ASTextKitRenderer+Positioning.h | 14 ++------ .../TextKit/ASTextKitRenderer+Positioning.mm | 14 ++------ .../TextKit/ASTextKitRenderer+TextChecking.h | 14 ++------ .../TextKit/ASTextKitRenderer+TextChecking.mm | 14 ++------ Source/TextKit/ASTextKitRenderer.h | 14 ++------ Source/TextKit/ASTextKitRenderer.mm | 14 ++------ Source/TextKit/ASTextKitShadower.h | 14 ++------ Source/TextKit/ASTextKitShadower.mm | 14 ++------ Source/TextKit/ASTextKitTailTruncater.h | 14 ++------ Source/TextKit/ASTextKitTailTruncater.mm | 14 ++------ Source/TextKit/ASTextKitTruncating.h | 14 ++------ Source/TextKit/ASTextNodeTypes.h | 14 ++------ Source/TextKit/ASTextNodeWordKerner.h | 14 ++------ Source/TextKit/ASTextNodeWordKerner.m | 14 ++------ Source/UIImage+ASConvenience.h | 14 ++------ Source/UIImage+ASConvenience.m | 14 ++------ Source/UIResponder+AsyncDisplayKit.h | 14 ++------ Source/UIResponder+AsyncDisplayKit.m | 14 ++------ Source/_ASTransitionContext.h | 14 ++------ Source/_ASTransitionContext.m | 14 ++------ Source/tvOS/ASControlNode+tvOS.m | 14 ++------ Source/tvOS/ASImageNode+tvOS.m | 14 ++------ .../ASListKitTestAdapterDataSource.h | 14 ++------ .../ASListKitTestAdapterDataSource.m | 14 ++------ .../ASDKListKitTests/ASListKitTests.m | 14 ++------ .../ASDKListKitTests/ASListTestCellNode.h | 14 ++------ .../ASDKListKitTests/ASListTestCellNode.m | 14 ++------ .../ASDKListKitTests/ASListTestObject.h | 14 ++------ .../ASDKListKitTests/ASListTestObject.m | 14 ++------ .../ASDKListKitTests/ASListTestSection.h | 14 ++------ .../ASDKListKitTests/ASListTestSection.m | 14 ++------ .../ASListTestSupplementaryNode.h | 14 ++------ .../ASListTestSupplementaryNode.m | 14 ++------ .../ASListTestSupplementarySource.h | 14 ++------ .../ASListTestSupplementarySource.m | 14 ++------ Tests/ASAbsoluteLayoutSpecSnapshotTests.m | 16 ++------- Tests/ASBackgroundLayoutSpecSnapshotTests.mm | 16 +++------ Tests/ASBasicImageDownloaderContextTests.m | 14 ++------ Tests/ASBasicImageDownloaderTests.m | 16 ++------- Tests/ASBatchFetchingTests.m | 14 ++------ Tests/ASBridgedPropertiesTests.mm | 16 ++------- Tests/ASCALayerTests.m | 14 ++------ Tests/ASCenterLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASCollectionModernDataSourceTests.m | 8 ++--- ...ASCollectionViewFlowLayoutInspectorTests.m | 14 ++------ Tests/ASCollectionViewTests.mm | 14 ++------ Tests/ASCollectionsTests.m | 8 ++--- Tests/ASConfigurationTests.m | 8 ++--- Tests/ASControlNodeTests.m | 14 ++------ Tests/ASCornerLayoutSpecSnapshotTests.mm | 8 ++--- Tests/ASDimensionTests.mm | 14 ++------ Tests/ASDispatchTests.m | 14 ++------ Tests/ASDisplayLayerTests.m | 14 ++------ Tests/ASDisplayNodeAppearanceTests.m | 14 ++------ Tests/ASDisplayNodeExtrasTests.m | 4 +-- Tests/ASDisplayNodeImplicitHierarchyTests.m | 14 ++------ Tests/ASDisplayNodeLayoutTests.mm | 14 ++------ Tests/ASDisplayNodeSnapshotTests.m | 4 +-- Tests/ASDisplayNodeTests.mm | 14 ++------ Tests/ASDisplayNodeTestsHelper.h | 14 ++------ Tests/ASDisplayNodeTestsHelper.m | 14 ++------ Tests/ASEditableTextNodeTests.m | 16 ++------- Tests/ASImageNodeSnapshotTests.m | 14 ++------ Tests/ASInsetLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASIntegerMapTests.m | 8 ++--- Tests/ASLayoutElementStyleTests.m | 16 +++------ Tests/ASLayoutEngineTests.mm | 8 ++--- Tests/ASLayoutFlatteningTests.m | 8 ++--- Tests/ASLayoutSpecSnapshotTestsHelper.h | 14 ++------ Tests/ASLayoutSpecSnapshotTestsHelper.m | 14 ++------ Tests/ASLayoutSpecTests.m | 14 ++------ Tests/ASLayoutTestNode.h | 8 ++--- Tests/ASLayoutTestNode.mm | 8 ++--- Tests/ASMultiplexImageNodeTests.m | 14 ++------ Tests/ASMutableAttributedStringBuilderTests.m | 14 ++------ Tests/ASNavigationControllerTests.m | 8 ++--- Tests/ASNetworkImageNodeTests.m | 8 ++--- Tests/ASOverlayLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASPagerNodeTests.m | 14 ++------ Tests/ASPerformanceTestContext.h | 8 ++--- Tests/ASPerformanceTestContext.m | 14 ++------ Tests/ASPhotosFrameworkImageRequestTests.m | 16 ++------- Tests/ASRatioLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASRectMapTests.m | 4 +-- Tests/ASRecursiveUnfairLockTests.m | 8 ++--- Tests/ASRelativeLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASRunLoopQueueTests.m | 8 ++--- Tests/ASScrollNodeTests.m | 8 ++--- Tests/ASSnapshotTestCase.h | 14 ++------ Tests/ASSnapshotTestCase.m | 14 ++------ Tests/ASStackLayoutSpecSnapshotTests.mm | 14 ++------ Tests/ASTLayoutFixture.h | 8 ++--- Tests/ASTLayoutFixture.mm | 8 ++--- Tests/ASTabBarControllerTests.m | 8 ++--- Tests/ASTableViewTests.mm | 14 ++------ Tests/ASTableViewThrashTests.m | 14 ++------ Tests/ASTextKitCoreTextAdditionsTests.m | 14 ++------ Tests/ASTextKitFontSizeAdjusterTests.mm | 8 ++--- Tests/ASTextKitTests.mm | 14 ++------ Tests/ASTextKitTruncationTests.mm | 14 ++------ Tests/ASTextNode2SnapshotTests.m | 10 ++---- Tests/ASTextNodePerformanceTests.m | 8 ++--- Tests/ASTextNodeSnapshotTests.m | 15 ++------- Tests/ASTextNodeTests.m | 14 ++------ Tests/ASTextNodeWordKernerTests.mm | 14 ++------ Tests/ASTraitCollectionTests.m | 8 ++--- Tests/ASUICollectionViewTests.m | 14 ++------ Tests/ASVideoNodeTests.m | 14 ++------ Tests/ASViewControllerTests.m | 14 ++------ Tests/ASWeakMapTests.m | 16 ++------- Tests/ASWeakSetTests.m | 16 ++------- Tests/ASWrapperSpecSnapshotTests.mm | 14 ++------ Tests/ArrayDiffingTests.m | 16 ++------- Tests/Common/ASDisplayNode+OCMock.m | 8 ++--- Tests/Common/ASTestCase.h | 14 ++------ Tests/Common/ASTestCase.m | 14 ++------ Tests/Common/ASXCTExtensions.h | 14 ++++---- Tests/Common/NSInvocation+ASTestHelpers.h | 8 ++--- Tests/Common/NSInvocation+ASTestHelpers.m | 8 ++--- Tests/Common/OCMockObject+ASAdditions.h | 8 ++--- Tests/Common/OCMockObject+ASAdditions.m | 8 ++--- Tests/Common/debugbreak.h | 8 ++--- Tests/TestHost/AppDelegate.h | 14 ++------ Tests/TestHost/AppDelegate.m | 16 +++------ Tests/TestHost/main.m | 14 ++------ Texture.podspec | 2 +- .../ASCollectionView/Sample/AppDelegate.h | 16 +++------ .../ASCollectionView/Sample/AppDelegate.m | 16 +++------ examples/ASCollectionView/Sample/ItemNode.h | 16 +++------ examples/ASCollectionView/Sample/ItemNode.m | 16 +++------ .../Sample/PresentingViewController.h | 18 +++------- .../Sample/PresentingViewController.m | 18 +++------- .../Sample/SupplementaryNode.h | 16 +++------ .../Sample/SupplementaryNode.m | 16 +++------ .../ASCollectionView/Sample/ViewController.h | 16 +++------ .../ASCollectionView/Sample/ViewController.m | 14 ++------ examples/ASCollectionView/Sample/main.m | 16 +++------ .../ASDKLayoutTransition/Sample/AppDelegate.h | 16 +++------ .../ASDKLayoutTransition/Sample/AppDelegate.m | 16 +++------ .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ examples/ASDKLayoutTransition/Sample/main.m | 16 +++------ examples/ASDKTube/Sample/AppDelegate.h | 16 +++------ examples/ASDKTube/Sample/AppDelegate.m | 16 +++------ .../Controller/VideoFeedNodeController.h | 18 +++------- .../Controller/VideoFeedNodeController.m | 18 +++------- examples/ASDKTube/Sample/Models/Utilities.h | 20 +++-------- examples/ASDKTube/Sample/Models/Utilities.m | 18 +++------- examples/ASDKTube/Sample/Models/VideoModel.h | 18 +++------- examples/ASDKTube/Sample/Models/VideoModel.m | 18 +++------- .../ASDKTube/Sample/Nodes/VideoContentCell.h | 18 +++------- .../ASDKTube/Sample/Nodes/VideoContentCell.m | 18 +++------- examples/ASDKTube/Sample/ViewController.h | 16 +++------ examples/ASDKTube/Sample/ViewController.m | 16 +++------ .../Sample/WindowWithStatusBarUnderlay.h | 18 +++------- .../Sample/WindowWithStatusBarUnderlay.m | 18 +++------- examples/ASDKTube/Sample/main.m | 16 +++------ .../Sample/ASCollectionSectionController.h | 6 ++-- .../Sample/ASCollectionSectionController.m | 6 ++-- examples/ASDKgram/Sample/AppDelegate.h | 18 +++------- examples/ASDKgram/Sample/AppDelegate.m | 14 ++------ examples/ASDKgram/Sample/FeedHeaderNode.h | 6 ++-- examples/ASDKgram/Sample/FeedHeaderNode.m | 6 ++-- examples/ASDKgram/Sample/ImageURLModel.h | 18 +++------- examples/ASDKgram/Sample/ImageURLModel.m | 18 +++------- examples/ASDKgram/Sample/PhotoCellNode.h | 14 ++------ examples/ASDKgram/Sample/PhotoCellNode.m | 14 ++------ .../ASDKgram/Sample/PhotoCollectionViewCell.h | 18 +++------- .../ASDKgram/Sample/PhotoCollectionViewCell.m | 18 +++------- .../ASDKgram/Sample/PhotoFeedBaseController.h | 14 ++------ .../ASDKgram/Sample/PhotoFeedBaseController.m | 14 ++------ .../Sample/PhotoFeedControllerProtocol.h | 6 ++-- .../Sample/PhotoFeedListKitViewController.h | 6 ++-- .../Sample/PhotoFeedListKitViewController.m | 6 ++-- examples/ASDKgram/Sample/PhotoFeedModel.h | 14 ++------ examples/ASDKgram/Sample/PhotoFeedModel.m | 14 ++------ .../ASDKgram/Sample/PhotoFeedNodeController.h | 18 +++------- .../ASDKgram/Sample/PhotoFeedNodeController.m | 18 +++------- .../Sample/PhotoFeedSectionController.h | 6 ++-- .../Sample/PhotoFeedSectionController.m | 6 ++-- .../ASDKgram/Sample/PhotoFeedViewController.h | 18 +++------- .../ASDKgram/Sample/PhotoFeedViewController.m | 14 ++------ examples/ASDKgram/Sample/PhotoModel.h | 14 ++------ examples/ASDKgram/Sample/PhotoModel.m | 14 ++------ examples/ASDKgram/Sample/PhotoTableViewCell.h | 14 ++------ examples/ASDKgram/Sample/PhotoTableViewCell.m | 14 ++------ .../Sample/RefreshingSectionControllerType.h | 6 ++-- examples/ASDKgram/Sample/TailLoadingNode.h | 6 ++-- examples/ASDKgram/Sample/TailLoadingNode.m | 6 ++-- .../ASDKgram/Sample/TextureConfigDelegate.m | 8 ++--- examples/ASDKgram/Sample/UserModel.h | 14 ++------ examples/ASDKgram/Sample/UserModel.m | 14 ++------ examples/ASDKgram/Sample/Utilities.h | 20 +++-------- examples/ASDKgram/Sample/Utilities.m | 18 +++------- .../Sample/WindowWithStatusBarUnderlay.h | 18 +++------- .../Sample/WindowWithStatusBarUnderlay.m | 18 +++------- examples/ASDKgram/Sample/main.m | 18 +++------- examples/ASMapNode/Sample/AppDelegate.h | 16 +++------ examples/ASMapNode/Sample/AppDelegate.m | 16 +++------ .../ASMapNode/Sample/CustomMapAnnotation.h | 16 +++------ .../ASMapNode/Sample/CustomMapAnnotation.m | 16 +++------ examples/ASMapNode/Sample/MapHandlerNode.h | 14 ++------ examples/ASMapNode/Sample/MapHandlerNode.m | 14 ++------ examples/ASMapNode/Sample/ViewController.h | 16 +++------ examples/ASMapNode/Sample/ViewController.m | 16 +++------ examples/ASMapNode/Sample/main.m | 16 +++------ .../ASViewController/Sample/AppDelegate.h | 16 +++------ .../ASViewController/Sample/AppDelegate.m | 16 +++------ .../ASViewController/Sample/DetailCellNode.h | 16 +++------ .../ASViewController/Sample/DetailCellNode.m | 16 +++------ .../ASViewController/Sample/DetailRootNode.h | 16 +++------ .../ASViewController/Sample/DetailRootNode.m | 16 +++------ .../Sample/DetailViewController.h | 16 +++------ .../Sample/DetailViewController.m | 16 +++------ .../ASViewController/Sample/ViewController.h | 16 +++------ .../ASViewController/Sample/ViewController.m | 16 +++------ examples/ASViewController/Sample/main.m | 16 +++------ .../AnimatedGIF/ASAnimatedImage/AppDelegate.h | 18 +++------- .../AnimatedGIF/ASAnimatedImage/AppDelegate.m | 18 +++------- .../ASAnimatedImage/ViewController.h | 18 +++------- .../ASAnimatedImage/ViewController.m | 14 ++------ examples/AnimatedGIF/ASAnimatedImage/main.m | 18 +++------- .../Sample/AppDelegate.h | 18 +++------- .../Sample/AppDelegate.m | 18 +++------- .../OverviewASCollectionNode.h | 17 ++-------- .../OverviewASCollectionNode.m | 17 ++-------- .../Node Containers/OverviewASPagerNode.h | 17 ++-------- .../Node Containers/OverviewASPagerNode.m | 17 ++-------- .../Node Containers/OverviewASTableNode.h | 17 ++-------- .../Node Containers/OverviewASTableNode.m | 17 ++-------- .../Sample/OverviewComponentsViewController.h | 18 +++------- .../Sample/OverviewComponentsViewController.m | 18 +++------- .../Sample/OverviewDetailViewController.h | 18 +++------- .../Sample/OverviewDetailViewController.m | 18 +++------- .../AsyncDisplayKitOverview/Sample/main.m | 18 +++------- .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 14 ++------ .../CatDealsCollectionView/Sample/BlurbNode.h | 14 ++------ .../CatDealsCollectionView/Sample/BlurbNode.m | 14 ++------ .../CatDealsCollectionView/Sample/ItemNode.h | 14 ++------ .../CatDealsCollectionView/Sample/ItemNode.m | 14 ++------ .../Sample/ItemStyles.h | 14 ++------ .../Sample/ItemStyles.m | 14 ++------ .../Sample/ItemViewModel.h | 14 ++------ .../Sample/ItemViewModel.m | 14 ++------ .../Sample/LoadingNode.h | 14 ++------ .../Sample/LoadingNode.m | 14 ++------ .../Sample/PlaceholderNetworkImageNode.h | 14 ++------ .../Sample/PlaceholderNetworkImageNode.m | 14 ++------ .../Sample/PresentingViewController.h | 18 +++------- .../Sample/PresentingViewController.m | 18 +++------- .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 14 ++------ examples/CatDealsCollectionView/Sample/main.m | 16 +++------ .../Sample/AppDelegate.swift | 21 +++--------- .../Sample/ImageCellNode.swift | 21 +++--------- .../Sample/MosaicCollectionViewLayout.swift | 23 +++---------- .../Sample/ViewController.swift | 16 +++------ .../CustomCollectionView/Sample/AppDelegate.h | 16 +++------ .../CustomCollectionView/Sample/AppDelegate.m | 16 +++------ .../Sample/ImageCellNode.h | 18 +++------- .../Sample/ImageCellNode.m | 14 ++------ .../Sample/ImageCollectionViewCell.h | 6 ++-- .../Sample/ImageCollectionViewCell.m | 6 ++-- .../Sample/MosaicCollectionLayoutDelegate.h | 8 ++--- .../Sample/MosaicCollectionLayoutDelegate.m | 8 ++--- .../Sample/MosaicCollectionLayoutInfo.h | 8 ++--- .../Sample/MosaicCollectionLayoutInfo.m | 8 ++--- .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 14 ++------ examples/CustomCollectionView/Sample/main.m | 16 +++------ .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 16 +++------ .../Sample/HorizontalScrollCellNode.h | 16 +++------ .../Sample/HorizontalScrollCellNode.mm | 16 +++------ .../Sample/RandomCoreGraphicsNode.h | 18 +++------- .../Sample/RandomCoreGraphicsNode.m | 18 +++------- .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ .../Sample/main.m | 16 +++------ examples/Kittens/Sample/AppDelegate.h | 16 +++------ examples/Kittens/Sample/AppDelegate.m | 14 ++------ examples/Kittens/Sample/BlurbNode.h | 16 +++------ examples/Kittens/Sample/BlurbNode.m | 16 +++------ examples/Kittens/Sample/KittenNode.h | 16 +++------ examples/Kittens/Sample/KittenNode.mm | 16 +++------ examples/Kittens/Sample/ViewController.h | 16 +++------ examples/Kittens/Sample/ViewController.m | 14 ++------ examples/Kittens/Sample/main.m | 16 +++------ .../Sample/AppDelegate.swift | 16 +++------ .../Sample/LayoutExampleNode+Layouts.swift | 16 +++------ .../Sample/LayoutExampleNode.swift | 16 +++------ .../Sample/LayoutExampleViewController.swift | 16 +++------ .../Sample/OverviewCellNode.swift | 16 +++------ .../Sample/OverviewViewController.swift | 16 +++------ .../Sample/Utilities.swift | 16 +++------ .../LayoutSpecExamples/Sample/AppDelegate.h | 9 +++-- .../LayoutSpecExamples/Sample/AppDelegate.m | 9 +++-- .../Sample/LayoutExampleNodes.h | 14 ++------ .../Sample/LayoutExampleNodes.m | 14 ++------ .../Sample/LayoutExampleViewController.h | 9 +++-- .../Sample/LayoutExampleViewController.m | 9 +++-- .../Sample/OverviewCellNode.h | 9 +++-- .../Sample/OverviewCellNode.m | 9 +++-- .../Sample/OverviewViewController.h | 9 +++-- .../Sample/OverviewViewController.m | 14 ++------ .../LayoutSpecExamples/Sample/Utilities.h | 14 ++------ .../LayoutSpecExamples/Sample/Utilities.m | 14 ++------ examples/LayoutSpecExamples/Sample/main.m | 16 +++------ examples/PagerNode/Sample/AppDelegate.h | 16 +++------ examples/PagerNode/Sample/AppDelegate.m | 16 +++------ examples/PagerNode/Sample/PageNode.h | 18 +++------- examples/PagerNode/Sample/PageNode.m | 14 ++------ examples/PagerNode/Sample/ViewController.h | 16 +++------ examples/PagerNode/Sample/ViewController.m | 16 +++------ examples/PagerNode/Sample/main.m | 16 +++------ .../Sample/AppDelegate.h | 14 ++------ .../Sample/AppDelegate.m | 14 ++------ .../Sample/CommentsNode.h | 14 ++------ .../Sample/CommentsNode.m | 14 ++------ .../Sample/LikesNode.h | 14 ++------ .../Sample/LikesNode.m | 14 ++------ .../SocialAppLayout-Inverted/Sample/Post.h | 14 ++------ .../SocialAppLayout-Inverted/Sample/Post.m | 14 ++------ .../Sample/PostNode.h | 14 ++------ .../Sample/PostNode.m | 14 ++------ .../Sample/TextStyles.h | 14 ++------ .../Sample/TextStyles.m | 14 ++------ .../Sample/ViewController.h | 14 ++------ .../Sample/ViewController.m | 14 ++------ .../SocialAppLayout-Inverted/Sample/main.m | 14 ++------ examples/SocialAppLayout/Sample/AppDelegate.h | 16 +++------ examples/SocialAppLayout/Sample/AppDelegate.m | 16 +++------ .../SocialAppLayout/Sample/CommentsNode.h | 16 +++------ .../SocialAppLayout/Sample/CommentsNode.m | 16 +++------ examples/SocialAppLayout/Sample/LikesNode.h | 16 +++------ examples/SocialAppLayout/Sample/LikesNode.m | 16 +++------ examples/SocialAppLayout/Sample/Post.h | 16 +++------ examples/SocialAppLayout/Sample/Post.m | 16 +++------ examples/SocialAppLayout/Sample/PostNode.h | 16 +++------ examples/SocialAppLayout/Sample/PostNode.m | 14 ++------ examples/SocialAppLayout/Sample/TextStyles.h | 16 +++------ examples/SocialAppLayout/Sample/TextStyles.m | 16 +++------ .../SocialAppLayout/Sample/ViewController.h | 16 +++------ .../SocialAppLayout/Sample/ViewController.m | 16 +++------ examples/SocialAppLayout/Sample/main.m | 16 +++------ examples/Swift/Sample/AppDelegate.swift | 16 +++------ .../Swift/Sample/TailLoadingCellNode.swift | 18 +++------- examples/Swift/Sample/ViewController.swift | 16 +++------ .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 16 +++------ .../Sample/GradientTableNode.h | 16 +++------ .../Sample/GradientTableNode.mm | 16 +++------ .../Sample/RandomCoreGraphicsNode.h | 18 +++------- .../Sample/RandomCoreGraphicsNode.m | 18 +++------- .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ .../Sample/main.m | 16 +++------ examples/Videos/Sample/ASVideoNode.h | 16 +++------ examples/Videos/Sample/ASVideoNode.m | 16 +++------ examples/Videos/Sample/AppDelegate.h | 16 +++------ examples/Videos/Sample/AppDelegate.m | 16 +++------ examples/Videos/Sample/ViewController.h | 16 +++------ examples/Videos/Sample/ViewController.m | 16 +++------ examples/Videos/Sample/main.m | 16 +++------ .../ASDKgram-Swift/AppDelegate.swift | 16 +++------ .../ASDKgram-Swift/Constants.swift | 19 +++-------- .../ASDKgram-Swift/ASDKgram-Swift/Date.swift | 16 +++------ .../ASDKgram-Swift/NetworkImageView.swift | 16 +++------ .../ASDKgram-Swift/NumberFormatter.swift | 16 +++------ .../OrderedDictionary+Codable.swift | 16 ++++----- .../OrderedDictionary+Description.swift | 16 ++++----- .../OrderedDictionary/OrderedDictionary.swift | 16 ++++----- .../ASDKgram-Swift/PX500Convenience.swift | 18 +++------- .../ASDKgram-Swift/ParseResponse.swift | 16 +++------ .../ASDKgram-Swift/PhotoFeedModel.swift | 16 +++------ .../PhotoFeedTableNodeController.swift | 16 +++------ .../PhotoFeedTableViewController.swift | 16 +++------ .../ASDKgram-Swift/PhotoModel.swift | 16 +++------ .../ASDKgram-Swift/PhotoTableNodeCell.swift | 16 +++------ .../ASDKgram-Swift/PhotoTableViewCell.swift | 16 +++------ .../ASDKgram-Swift/PopularPageModel.swift | 16 +++------ .../ASDKgram-Swift/UIColor.swift | 16 +++------ .../ASDKgram-Swift/ASDKgram-Swift/URL.swift | 16 +++------ .../ASDKgram-Swift/Webservice.swift | 17 +++------- .../Sample/Sample.h | 5 +-- .../Contents.swift | 8 ++++- .../Index.xcplaygroundpage/Contents.swift | 31 ++++------------- .../Contents.swift | 10 ++++-- .../Contents.swift | 8 ++++- .../Contents.swift | 13 +++++--- .../Sources/ASPlayground.swift | 7 ++++ .../Sources/HorizontalStackWithSpacer.swift | 7 ++++ .../Sources/PhotoWithInsetTextOverlay.swift | 7 ++++ .../Sources/PhotoWithOutsetIconOverlay.swift | 7 ++++ .../Sources/StackLayout.swift | 7 ++++ .../Sample.playground/Sources/Utilities.swift | 7 ++++ .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 18 +++------- .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ .../ASTableViewStressTest/Sample/main.m | 16 +++------ .../ASTraitCollection/Sample/AppDelegate.h | 16 +++------ .../ASTraitCollection/Sample/AppDelegate.m | 16 +++------ .../Sample/CollectionViewController.h | 16 +++------ .../Sample/CollectionViewController.m | 16 +++------ .../ASTraitCollection/Sample/KittenNode.h | 16 +++------ .../ASTraitCollection/Sample/KittenNode.m | 16 +++------ .../Sample/OverrideViewController.h | 16 +++------ .../Sample/OverrideViewController.m | 16 +++------ .../Sample/TableViewController.h | 16 +++------ .../Sample/TableViewController.m | 16 +++------ .../ASTraitCollection/Sample/ViewController.h | 16 +++------ .../ASTraitCollection/Sample/ViewController.m | 16 +++------ .../ASTraitCollection/Sample/main.m | 16 +++------ .../Sample/AppDelegate.swift | 18 +++------- .../Sample/DemoCellNode.swift | 18 +++------- .../Sample/Utilities.swift | 18 +++------- .../Sample/ViewController.swift | 18 +++------- .../CarthageExample/AppDelegate.h | 18 +++------- .../CarthageExample/AppDelegate.m | 18 +++------- .../CarthageExample/ViewController.h | 18 +++------- .../CarthageExample/ViewController.m | 18 +++------- .../CarthageBuildTest/CarthageExample/main.m | 18 +++------- .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 16 +++------ .../Sample/ImageViewController.h | 16 +++------ .../Sample/ImageViewController.m | 16 +++------ .../Sample/MosaicCollectionViewLayout.h | 20 +++-------- .../Sample/MosaicCollectionViewLayout.m | 20 +++-------- .../Sample/SupplementaryNode.h | 16 +++------ .../Sample/SupplementaryNode.m | 16 +++------ .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ .../Sample/main.m | 16 +++------ .../EditableText/Sample/AppDelegate.h | 16 +++------ .../EditableText/Sample/AppDelegate.m | 16 +++------ .../EditableText/Sample/ViewController.h | 16 +++------ .../EditableText/Sample/ViewController.m | 16 +++------ examples_extra/EditableText/Sample/main.m | 16 +++------ examples_extra/Multiplex/Sample/AppDelegate.h | 16 +++------ examples_extra/Multiplex/Sample/AppDelegate.m | 16 +++------ examples_extra/Multiplex/Sample/ScreenNode.h | 18 +++------- examples_extra/Multiplex/Sample/ScreenNode.m | 18 +++------- .../Multiplex/Sample/ViewController.h | 16 +++------ .../Multiplex/Sample/ViewController.m | 16 +++------ examples_extra/Multiplex/Sample/main.m | 16 +++------ .../Placeholders/Sample/AppDelegate.h | 16 +++------ .../Placeholders/Sample/AppDelegate.m | 16 +++------ examples_extra/Placeholders/Sample/PostNode.h | 16 +++------ examples_extra/Placeholders/Sample/PostNode.m | 16 +++------ .../Placeholders/Sample/SlowpokeImageNode.h | 16 +++------ .../Placeholders/Sample/SlowpokeImageNode.m | 16 +++------ .../Placeholders/Sample/SlowpokeShareNode.h | 16 +++------ .../Placeholders/Sample/SlowpokeShareNode.m | 16 +++------ .../Placeholders/Sample/SlowpokeTextNode.h | 16 +++------ .../Placeholders/Sample/SlowpokeTextNode.m | 16 +++------ .../Placeholders/Sample/ViewController.h | 16 +++------ .../Placeholders/Sample/ViewController.m | 16 +++------ examples_extra/Placeholders/Sample/main.m | 16 +++------ .../RepoSearcher/AppDelegate.swift | 6 ++-- .../IGListCollectionContext+ASDK.swift | 6 ++-- .../RepoSearcher/LabelSectionController.swift | 6 ++-- .../NSObject+IGListDiffable.swift | 6 ++-- .../RepoSearcher/SearchNode.swift | 6 ++-- .../SearchSectionController.swift | 6 ++-- .../RepoSearcher/SearchViewController.swift | 6 ++-- examples_extra/Shop/Shop/AppDelegate.swift | 6 ++-- .../Shop/Shop/Extensions/UIColor.swift | 6 ++-- .../Shop/Shop/Models/Category.swift | 6 ++-- .../Shop/Shop/Models/DummyGenerator.swift | 6 ++-- examples_extra/Shop/Shop/Models/Product.swift | 6 ++-- .../Shop/Scenes/Product/ProductCellNode.swift | 6 ++-- .../Shop/Scenes/Product/ProductNode.swift | 6 ++-- .../Product/ProductViewController.swift | 6 ++-- .../Shop/Scenes/Product/StarRatingNode.swift | 6 ++-- .../Products/ProductCollectionNode.swift | 6 ++-- .../Scenes/Products/ProductTableNode.swift | 6 ++-- .../ProductsCollectionViewController.swift | 6 ++-- .../Shop/Scenes/Products/ProductsLayout.swift | 6 ++-- .../ProductsTableViewController.swift | 6 ++-- .../Shop/Shop/Scenes/Shop/ShopCellNode.swift | 6 ++-- .../Shop/Scenes/Shop/ShopViewController.swift | 6 ++-- .../Shop/Shop/Shop-Bridging-Header.h | 6 +++- examples_extra/Shop/ShopTests/ShopTests.swift | 6 ++-- .../Sample/AppDelegate.h | 16 +++------ .../Sample/AppDelegate.m | 16 +++------ .../Sample/AsyncTableViewController.h | 16 +++------ .../Sample/AsyncTableViewController.m | 16 +++------ .../Sample/AsyncViewController.h | 18 +++------- .../Sample/AsyncViewController.m | 18 +++------- .../Sample/RandomCoreGraphicsNode.h | 18 +++------- .../Sample/RandomCoreGraphicsNode.m | 18 +++------- .../SynchronousConcurrency/Sample/main.m | 16 +++------ .../SynchronousKittens/Sample/AppDelegate.h | 16 +++------ .../SynchronousKittens/Sample/AppDelegate.m | 16 +++------ .../SynchronousKittens/Sample/BlurbNode.h | 16 +++------ .../SynchronousKittens/Sample/BlurbNode.m | 16 +++------ .../SynchronousKittens/Sample/KittenNode.h | 16 +++------ .../SynchronousKittens/Sample/KittenNode.mm | 16 +++------ .../Sample/ViewController.h | 16 +++------ .../Sample/ViewController.m | 16 +++------ .../SynchronousKittens/Sample/main.m | 16 +++------ .../TextStressTest/Sample/AppDelegate.h | 17 ++++------ .../TextStressTest/Sample/AppDelegate.m | 8 ++--- .../Sample/CollectionViewController.h | 8 ++--- .../Sample/CollectionViewController.m | 8 ++--- .../TextStressTest/Sample/TabBarController.h | 8 ++--- .../TextStressTest/Sample/TabBarController.m | 8 ++--- .../TextStressTest/Sample/TextCellNode.h | 8 ++--- .../TextStressTest/Sample/TextCellNode.m | 8 ++--- .../TextStressTest/Sample/ViewController.h | 17 ++++------ .../TextStressTest/Sample/ViewController.m | 17 ++++------ examples_extra/TextStressTest/Sample/main.m | 17 ++++------ .../VideoTableView/Sample/AppDelegate.h | 16 +++------ .../VideoTableView/Sample/AppDelegate.m | 16 +++------ .../VideoTableView/Sample/BlurbNode.h | 16 +++------ .../VideoTableView/Sample/BlurbNode.m | 16 +++------ .../VideoTableView/Sample/NicCageNode.h | 16 +++------ .../VideoTableView/Sample/NicCageNode.mm | 14 ++------ .../VideoTableView/Sample/ViewController.h | 16 +++------ .../VideoTableView/Sample/ViewController.m | 16 +++------ examples_extra/VideoTableView/Sample/main.m | 16 +++------ .../Framework/Sample/AppDelegate.swift | 14 ++------ .../Framework/Sample/ViewController.swift | 14 ++------ .../Life With Frameworks/main.m | 6 ++-- .../Life Without CocoaPods/AppDelegate.h | 13 ++------ .../Life Without CocoaPods/AppDelegate.m | 13 ++------ .../Life Without CocoaPods/ViewController.h | 13 ++------ .../Life Without CocoaPods/ViewController.m | 13 ++------ .../Life Without CocoaPods/main.m | 13 ++------ 920 files changed, 3001 insertions(+), 9534 deletions(-) delete mode 100644 ASDK-Licenses/LICENSE delete mode 100644 ASDK-Licenses/PATENTS mode change 100755 => 100644 Source/ASNetworkImageNode.mm mode change 100755 => 100644 Source/Base/ASBaseDefines.h mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextDebugOption.h mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextDebugOption.m mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextInput.h mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextInput.m mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextLayout.h mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextLayout.m mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextLine.h mode change 100755 => 100644 Source/Private/TextExperiment/Component/ASTextLine.m mode change 100755 => 100644 Source/Private/TextExperiment/String/ASTextAttribute.h mode change 100755 => 100644 Source/Private/TextExperiment/String/ASTextAttribute.m mode change 100755 => 100644 Source/Private/TextExperiment/String/ASTextRunDelegate.h mode change 100755 => 100644 Source/Private/TextExperiment/String/ASTextRunDelegate.m mode change 100755 => 100644 Source/Private/TextExperiment/Utility/ASTextUtilities.h mode change 100755 => 100644 Source/Private/TextExperiment/Utility/ASTextUtilities.m mode change 100755 => 100644 Source/Private/TextExperiment/Utility/NSAttributedString+ASText.h mode change 100755 => 100644 Source/Private/TextExperiment/Utility/NSAttributedString+ASText.m mode change 100755 => 100644 Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.h mode change 100755 => 100644 Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.m mode change 100755 => 100644 Source/TextKit/ASTextKitAttributes.h mode change 100755 => 100644 Source/TextKit/ASTextKitAttributes.mm mode change 100755 => 100644 Source/TextKit/ASTextKitContext.h mode change 100755 => 100644 Source/TextKit/ASTextKitContext.mm mode change 100755 => 100644 Source/TextKit/ASTextKitEntityAttribute.h mode change 100755 => 100644 Source/TextKit/ASTextKitEntityAttribute.m mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer+Positioning.h mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer+Positioning.mm mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer+TextChecking.h mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer+TextChecking.mm mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer.h mode change 100755 => 100644 Source/TextKit/ASTextKitRenderer.mm mode change 100755 => 100644 Source/TextKit/ASTextKitShadower.h mode change 100755 => 100644 Source/TextKit/ASTextKitShadower.mm mode change 100755 => 100644 Source/TextKit/ASTextKitTailTruncater.h mode change 100755 => 100644 Source/TextKit/ASTextKitTailTruncater.mm mode change 100755 => 100644 Source/TextKit/ASTextKitTruncating.h mode change 100755 => 100644 examples/CustomCollectionView-Swift/Sample/MosaicCollectionViewLayout.swift diff --git a/ASDK-Licenses/LICENSE b/ASDK-Licenses/LICENSE deleted file mode 100644 index 507edbd628..0000000000 --- a/ASDK-Licenses/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -BSD License - -For AsyncDisplayKit software - -Copyright (c) 2014-present, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ASDK-Licenses/PATENTS b/ASDK-Licenses/PATENTS deleted file mode 100644 index ce9e31cee3..0000000000 --- a/ASDK-Licenses/PATENTS +++ /dev/null @@ -1,33 +0,0 @@ -Additional Grant of Patent Rights Version 2 - -"Software" means the AsyncDisplayKit software distributed by Facebook, Inc. - -Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software -("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable -(subject to the termination provision below) license under any Necessary -Claims, to make, have made, use, sell, offer to sell, import, and otherwise -transfer the Software. For avoidance of doubt, no license is granted under -Facebook's rights in any patent claims that are infringed by (i) modifications -to the Software made by you or any third party or (ii) the Software in -combination with any software or other technology. - -The license granted hereunder will terminate, automatically and without notice, -if you (or any of your subsidiaries, corporate affiliates or agents) initiate -directly or indirectly, or take a direct financial interest in, any Patent -Assertion: (i) against Facebook or any of its subsidiaries or corporate -affiliates, (ii) against any party if such Patent Assertion arises in whole or -in part from any software, technology, product or service of Facebook or any of -its subsidiaries or corporate affiliates, or (iii) against any party relating -to the Software. Notwithstanding the foregoing, if Facebook or any of its -subsidiaries or corporate affiliates files a lawsuit alleging patent -infringement against you in the first instance, and you respond by filing a -patent infringement counterclaim in that lawsuit against that party that is -unrelated to the Software, the license granted hereunder will not terminate -under section (i) of this paragraph due to such counterclaim. - -A "Necessary Claim" is a claim of a patent owned by Facebook that is -necessarily infringed by the Software standing alone. - -A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, -or contributory infringement or inducement to infringe any patent, including a -cross-claim or counterclaim. diff --git a/CHANGELOG.md b/CHANGELOG.md index dfd341c4c2..d41a74f20f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077) - [ASNetworkImageNode] Allow delegate methods to be called on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1007](https://github.com/TextureGroup/Texture/pull/1007) - [ASLayoutTransition] Add support for preserving order after node moves during transitions. (This order defines the z-order as well.) [Kevin Smith](https://github.com/wiseoldduck) [#1006] - [ASDisplayNode] Adds support for multiple interface state delegates. [Garrett Moon](https://github.com/garrettmoon) [#979](https://github.com/TextureGroup/Texture/pull/979) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 12274c0a44..22aded2d6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,12 +87,8 @@ Copy and paste this to the top of your new file(s): // ASDisplayNode.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // ``` @@ -102,17 +98,9 @@ If you’ve modified an existing file, change the header to: // ASDisplayNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // ``` diff --git a/Dangerfile b/Dangerfile index edbbec21ec..60c90dfe2e 100644 --- a/Dangerfile +++ b/Dangerfile @@ -69,13 +69,8 @@ end # Ensure new files have proper header new_source_license_header = <<-HEREDOC -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 -// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 HEREDOC if has_added_source_files @@ -84,20 +79,11 @@ end # Ensure modified files have proper header modified_source_license_header = <<-HEREDOC -// 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 /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) through the 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 -// +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 HEREDOC if has_modified_source_files check_file_header(modified_source_files, [modified_source_license_header, new_source_license_header]) -end \ No newline at end of file +end diff --git a/LICENSE b/LICENSE index 8ce6c68398..c63a7c0a29 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,7 @@ -The Texture project was created by Pinterest as a continuation, under a -different name and license, of the AsyncDisplayKit codebase originally developed -by Facebook. AsyncDisplayKit was originally released by Facebook under a BSD -license and additional patent grant. Those BSD and patent licenses govern use -of code in Texture contributed prior to 4/13/2017 (the original AsyncDisplayKit -code), and copies of the licenses are included in the /ASDK-Licenses directory -of this source tree for reference. +The Texture project was created by Pinterest as a continuation, under a different +name and license, of the AsyncDisplayKit codebase originally developed by Facebook. -All code contributed to Texture after 4/13/2017 is released by Pinterest under -the Apache License, Version 2.0. +All code in Texture is covered by the Apache License, Version 2.0. Apache License Version 2.0, January 2004 @@ -184,4 +178,4 @@ Apache License incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - END OF TERMS AND CONDITIONS \ No newline at end of file + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 97cb293660..64e7f4ab33 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,4 @@ We welcome any contributions. See the [CONTRIBUTING](https://github.com/textureg ## License -The Texture project was created by Pinterest as a continuation, under a different name and license, of the AsyncDisplayKit codebase originally developed by Facebook. AsyncDisplayKit was originally released by Facebook under a BSD license and additional patent grant. Those BSD and patent licenses govern use of code in Texture contributed prior to 4/13/2017 (the original AsyncDisplayKit code), and copies of the licenses are included in the root directory of this source tree for reference. All code contributed to Texture after 4/13/2017 is released by Pinterest under an Apache 2.0 license. +The Texture project is available for free use, as described by the [LICENSE](https://github.com/texturegroup/texture/blob/master/LICENSE) (Apache 2.0). diff --git a/Source/ASBlockTypes.h b/Source/ASBlockTypes.h index f0e2875e12..e1c7456019 100644 --- a/Source/ASBlockTypes.h +++ b/Source/ASBlockTypes.h @@ -2,17 +2,9 @@ // ASBlockTypes.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASButtonNode.h b/Source/ASButtonNode.h index 55f0e328c2..f43a544df1 100644 --- a/Source/ASButtonNode.h +++ b/Source/ASButtonNode.h @@ -2,17 +2,9 @@ // ASButtonNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASButtonNode.mm b/Source/ASButtonNode.mm index bd245262dc..f0ca75eed2 100644 --- a/Source/ASButtonNode.mm +++ b/Source/ASButtonNode.mm @@ -2,17 +2,9 @@ // ASButtonNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCGImageBuffer.h b/Source/ASCGImageBuffer.h index dfff516812..a77452622b 100644 --- a/Source/ASCGImageBuffer.h +++ b/Source/ASCGImageBuffer.h @@ -2,12 +2,8 @@ // ASCGImageBuffer.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCGImageBuffer.m b/Source/ASCGImageBuffer.m index 8b236f65c6..5e0c3dc921 100644 --- a/Source/ASCGImageBuffer.m +++ b/Source/ASCGImageBuffer.m @@ -2,12 +2,8 @@ // ASCGImageBuffer.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASCGImageBuffer.h" diff --git a/Source/ASCellNode.h b/Source/ASCellNode.h index e7f25e920d..589d08e3ad 100644 --- a/Source/ASCellNode.h +++ b/Source/ASCellNode.h @@ -2,17 +2,9 @@ // ASCellNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCellNode.mm b/Source/ASCellNode.mm index e2cd825c54..6bdf705f93 100644 --- a/Source/ASCellNode.mm +++ b/Source/ASCellNode.mm @@ -2,17 +2,9 @@ // ASCellNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionNode+Beta.h b/Source/ASCollectionNode+Beta.h index 506f9dc2f6..136e024011 100644 --- a/Source/ASCollectionNode+Beta.h +++ b/Source/ASCollectionNode+Beta.h @@ -2,17 +2,9 @@ // ASCollectionNode+Beta.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionNode.h b/Source/ASCollectionNode.h index 194f31f016..4615ecb3a8 100644 --- a/Source/ASCollectionNode.h +++ b/Source/ASCollectionNode.h @@ -2,17 +2,9 @@ // ASCollectionNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index 59714ef62e..82388c85aa 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -2,17 +2,9 @@ // ASCollectionNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionView.h b/Source/ASCollectionView.h index 33608617cf..6e9d343dc8 100644 --- a/Source/ASCollectionView.h +++ b/Source/ASCollectionView.h @@ -2,17 +2,9 @@ // ASCollectionView.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index cef0d581ad..47ea99bf0b 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -2,17 +2,9 @@ // ASCollectionView.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollectionViewLayoutFacilitatorProtocol.h b/Source/ASCollectionViewLayoutFacilitatorProtocol.h index 2b4835a7f7..3db2dc9979 100644 --- a/Source/ASCollectionViewLayoutFacilitatorProtocol.h +++ b/Source/ASCollectionViewLayoutFacilitatorProtocol.h @@ -2,17 +2,9 @@ // ASCollectionViewLayoutFacilitatorProtocol.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/ASCollectionViewProtocols.h b/Source/ASCollectionViewProtocols.h index 42d6b37c51..a33e433faa 100644 --- a/Source/ASCollectionViewProtocols.h +++ b/Source/ASCollectionViewProtocols.h @@ -2,17 +2,9 @@ // ASCollectionViewProtocols.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollections.h b/Source/ASCollections.h index bc36864f4e..ca3b31c65c 100644 --- a/Source/ASCollections.h +++ b/Source/ASCollections.h @@ -2,12 +2,8 @@ // ASCollections.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASCollections.m b/Source/ASCollections.m index 3d9793d049..b82a428619 100644 --- a/Source/ASCollections.m +++ b/Source/ASCollections.m @@ -2,12 +2,8 @@ // ASCollections.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASCollections.h" diff --git a/Source/ASConfiguration.h b/Source/ASConfiguration.h index af0d3ae098..c529dad801 100644 --- a/Source/ASConfiguration.h +++ b/Source/ASConfiguration.h @@ -2,12 +2,8 @@ // ASConfiguration.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASConfiguration.m b/Source/ASConfiguration.m index 6918c47aa5..7923f5837c 100644 --- a/Source/ASConfiguration.m +++ b/Source/ASConfiguration.m @@ -2,12 +2,8 @@ // ASConfiguration.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASConfigurationDelegate.h b/Source/ASConfigurationDelegate.h index 88055f0379..5f94d0a36b 100644 --- a/Source/ASConfigurationDelegate.h +++ b/Source/ASConfigurationDelegate.h @@ -2,12 +2,8 @@ // ASConfigurationDelegate.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASConfigurationInternal.h b/Source/ASConfigurationInternal.h index 0d2662acd7..fa3bb4c56f 100644 --- a/Source/ASConfigurationInternal.h +++ b/Source/ASConfigurationInternal.h @@ -2,12 +2,8 @@ // ASConfigurationInternal.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // /// Note this has to be public because it's imported by public header ASThread.h =/ diff --git a/Source/ASConfigurationInternal.m b/Source/ASConfigurationInternal.m index 9d7c1bcf5a..fd2e537913 100644 --- a/Source/ASConfigurationInternal.m +++ b/Source/ASConfigurationInternal.m @@ -2,12 +2,8 @@ // ASConfigurationInternal.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASConfigurationInternal.h" diff --git a/Source/ASContextTransitioning.h b/Source/ASContextTransitioning.h index f433b85f10..9802ecefc4 100644 --- a/Source/ASContextTransitioning.h +++ b/Source/ASContextTransitioning.h @@ -2,17 +2,9 @@ // ASContextTransitioning.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASControlNode+Subclasses.h b/Source/ASControlNode+Subclasses.h index f77f639435..2e9cdb2849 100644 --- a/Source/ASControlNode+Subclasses.h +++ b/Source/ASControlNode+Subclasses.h @@ -2,17 +2,9 @@ // ASControlNode+Subclasses.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASControlNode.h b/Source/ASControlNode.h index a3cc8b2369..0918fdb0b0 100644 --- a/Source/ASControlNode.h +++ b/Source/ASControlNode.h @@ -2,17 +2,9 @@ // ASControlNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASControlNode.mm b/Source/ASControlNode.mm index a3a18efe57..c04faccc7c 100644 --- a/Source/ASControlNode.mm +++ b/Source/ASControlNode.mm @@ -2,17 +2,9 @@ // ASControlNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Beta.h b/Source/ASDisplayNode+Beta.h index cd42006ccb..e140721cc6 100644 --- a/Source/ASDisplayNode+Beta.h +++ b/Source/ASDisplayNode+Beta.h @@ -2,17 +2,9 @@ // ASDisplayNode+Beta.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Convenience.h b/Source/ASDisplayNode+Convenience.h index b5806b0f7f..3c00f67213 100644 --- a/Source/ASDisplayNode+Convenience.h +++ b/Source/ASDisplayNode+Convenience.h @@ -2,17 +2,9 @@ // ASDisplayNode+Convenience.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Convenience.m b/Source/ASDisplayNode+Convenience.m index 4e47f78ace..c5d2c981ed 100644 --- a/Source/ASDisplayNode+Convenience.m +++ b/Source/ASDisplayNode+Convenience.m @@ -2,17 +2,9 @@ // ASDisplayNode+Convenience.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASDisplayNode+Convenience.h" diff --git a/Source/ASDisplayNode+InterfaceState.h b/Source/ASDisplayNode+InterfaceState.h index bff9fa9ef9..cca1e4e729 100644 --- a/Source/ASDisplayNode+InterfaceState.h +++ b/Source/ASDisplayNode+InterfaceState.h @@ -2,12 +2,8 @@ // ASDisplayNode+InterfaceState.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index c6f25202d2..3e08fd9606 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -2,17 +2,9 @@ // ASDisplayNode+Layout.mm // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Subclasses.h b/Source/ASDisplayNode+Subclasses.h index d4cbc39f2d..98d006e091 100644 --- a/Source/ASDisplayNode+Subclasses.h +++ b/Source/ASDisplayNode+Subclasses.h @@ -2,17 +2,9 @@ // ASDisplayNode+Subclasses.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index dc2f27cb7f..fedff84cf1 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -2,17 +2,9 @@ // ASDisplayNode+Yoga.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNode.h b/Source/ASDisplayNode.h index 9eb64cbb84..9bf9236d0e 100644 --- a/Source/ASDisplayNode.h +++ b/Source/ASDisplayNode.h @@ -2,17 +2,9 @@ // ASDisplayNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 0fc41d40a4..f24a9cb28d 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2,17 +2,9 @@ // ASDisplayNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNodeExtras.h b/Source/ASDisplayNodeExtras.h index aa3fcbe57a..09512ead9b 100644 --- a/Source/ASDisplayNodeExtras.h +++ b/Source/ASDisplayNodeExtras.h @@ -2,17 +2,9 @@ // ASDisplayNodeExtras.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASDisplayNodeExtras.mm b/Source/ASDisplayNodeExtras.mm index 01e8ff17ec..d1be1576e3 100644 --- a/Source/ASDisplayNodeExtras.mm +++ b/Source/ASDisplayNodeExtras.mm @@ -2,17 +2,9 @@ // ASDisplayNodeExtras.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASEditableTextNode.h b/Source/ASEditableTextNode.h index a61f848c34..fb0c003564 100644 --- a/Source/ASEditableTextNode.h +++ b/Source/ASEditableTextNode.h @@ -2,17 +2,9 @@ // ASEditableTextNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASEditableTextNode.mm b/Source/ASEditableTextNode.mm index 358d5e7941..962a2e96e2 100644 --- a/Source/ASEditableTextNode.mm +++ b/Source/ASEditableTextNode.mm @@ -2,17 +2,9 @@ // ASEditableTextNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 448deb87a3..26c228f8e9 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -2,12 +2,8 @@ // ASExperimentalFeatures.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index 5b33fe50be..b12891fd73 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -2,12 +2,8 @@ // ASExperimentalFeatures.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASImageNode+AnimatedImage.mm b/Source/ASImageNode+AnimatedImage.mm index bd085eabe1..a9d6d2227a 100644 --- a/Source/ASImageNode+AnimatedImage.mm +++ b/Source/ASImageNode+AnimatedImage.mm @@ -2,17 +2,9 @@ // ASImageNode+AnimatedImage.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASImageNode.h b/Source/ASImageNode.h index 13460bcf6d..ea540a3d3f 100644 --- a/Source/ASImageNode.h +++ b/Source/ASImageNode.h @@ -2,17 +2,9 @@ // ASImageNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index d060d8993e..cc2905d273 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -2,17 +2,9 @@ // ASImageNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASLocking.h b/Source/ASLocking.h index 46c12e96c3..3e284dc26c 100644 --- a/Source/ASLocking.h +++ b/Source/ASLocking.h @@ -2,12 +2,8 @@ // ASLocking.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMainThreadDeallocation.h b/Source/ASMainThreadDeallocation.h index a2aa8249f0..391b6bb696 100644 --- a/Source/ASMainThreadDeallocation.h +++ b/Source/ASMainThreadDeallocation.h @@ -2,12 +2,8 @@ // ASMainThreadDeallocation.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMainThreadDeallocation.mm b/Source/ASMainThreadDeallocation.mm index 98484088f7..0bf6d19806 100644 --- a/Source/ASMainThreadDeallocation.mm +++ b/Source/ASMainThreadDeallocation.mm @@ -2,12 +2,8 @@ // ASMainThreadDeallocation.mm // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMapNode.h b/Source/ASMapNode.h index c8820a18a1..9ddc2b6ffc 100644 --- a/Source/ASMapNode.h +++ b/Source/ASMapNode.h @@ -2,17 +2,9 @@ // ASMapNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMapNode.mm b/Source/ASMapNode.mm index 8dc9215795..1c204ab974 100644 --- a/Source/ASMapNode.mm +++ b/Source/ASMapNode.mm @@ -2,17 +2,9 @@ // ASMapNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMultiplexImageNode.h b/Source/ASMultiplexImageNode.h index 95785afe24..503b5cbf59 100644 --- a/Source/ASMultiplexImageNode.h +++ b/Source/ASMultiplexImageNode.h @@ -2,17 +2,9 @@ // ASMultiplexImageNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASMultiplexImageNode.mm b/Source/ASMultiplexImageNode.mm index 1bddadb7d5..30001e5f3f 100644 --- a/Source/ASMultiplexImageNode.mm +++ b/Source/ASMultiplexImageNode.mm @@ -2,17 +2,9 @@ // ASMultiplexImageNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNavigationController.h b/Source/ASNavigationController.h index b23c523299..cd6e417d41 100644 --- a/Source/ASNavigationController.h +++ b/Source/ASNavigationController.h @@ -2,17 +2,9 @@ // ASNavigationController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNavigationController.m b/Source/ASNavigationController.m index 24423ea6cf..51c097f0b0 100644 --- a/Source/ASNavigationController.m +++ b/Source/ASNavigationController.m @@ -2,17 +2,9 @@ // ASNavigationController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNetworkImageLoadInfo.h b/Source/ASNetworkImageLoadInfo.h index 6db366a9cd..55c4b49a7a 100644 --- a/Source/ASNetworkImageLoadInfo.h +++ b/Source/ASNetworkImageLoadInfo.h @@ -2,12 +2,8 @@ // ASNetworkImageLoadInfo.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNetworkImageLoadInfo.m b/Source/ASNetworkImageLoadInfo.m index 00baa1bf7c..f0f0554430 100644 --- a/Source/ASNetworkImageLoadInfo.m +++ b/Source/ASNetworkImageLoadInfo.m @@ -2,12 +2,8 @@ // ASNetworkImageLoadInfo.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNetworkImageNode.h b/Source/ASNetworkImageNode.h index 4722c88d20..f77a9a59d1 100644 --- a/Source/ASNetworkImageNode.h +++ b/Source/ASNetworkImageNode.h @@ -2,17 +2,9 @@ // ASNetworkImageNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm old mode 100755 new mode 100644 index 635d8ee87a..ce864647af --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -2,17 +2,9 @@ // ASNetworkImageNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNodeController+Beta.h b/Source/ASNodeController+Beta.h index a1411226e4..7c00ba8fed 100644 --- a/Source/ASNodeController+Beta.h +++ b/Source/ASNodeController+Beta.h @@ -2,17 +2,9 @@ // ASNodeController+Beta.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASNodeController+Beta.mm b/Source/ASNodeController+Beta.mm index 6dcd1a0790..77199b25f6 100644 --- a/Source/ASNodeController+Beta.mm +++ b/Source/ASNodeController+Beta.mm @@ -1,18 +1,10 @@ // -// ASNodeController+Beta.m +// ASNodeController+Beta.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASPagerFlowLayout.h b/Source/ASPagerFlowLayout.h index 81d1311314..17c61d6c47 100644 --- a/Source/ASPagerFlowLayout.h +++ b/Source/ASPagerFlowLayout.h @@ -2,17 +2,9 @@ // ASPagerFlowLayout.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASPagerFlowLayout.m b/Source/ASPagerFlowLayout.m index 16944b8770..0a6ad673da 100644 --- a/Source/ASPagerFlowLayout.m +++ b/Source/ASPagerFlowLayout.m @@ -2,17 +2,9 @@ // ASPagerFlowLayout.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASPagerNode+Beta.h b/Source/ASPagerNode+Beta.h index bd963ec19f..a768f6be3f 100644 --- a/Source/ASPagerNode+Beta.h +++ b/Source/ASPagerNode+Beta.h @@ -2,12 +2,8 @@ // ASPagerNode+Beta.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASPagerNode.h b/Source/ASPagerNode.h index 52ec8bfd85..9fb99775f5 100644 --- a/Source/ASPagerNode.h +++ b/Source/ASPagerNode.h @@ -2,17 +2,9 @@ // ASPagerNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASPagerNode.m b/Source/ASPagerNode.m index d2452e6f76..c857ad3261 100644 --- a/Source/ASPagerNode.m +++ b/Source/ASPagerNode.m @@ -2,17 +2,9 @@ // ASPagerNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASRangeManagingNode.h b/Source/ASRangeManagingNode.h index 2716efbe4f..c331a77bee 100644 --- a/Source/ASRangeManagingNode.h +++ b/Source/ASRangeManagingNode.h @@ -2,12 +2,8 @@ // ASRangeManagingNode.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASRunLoopQueue.h b/Source/ASRunLoopQueue.h index 84f557438f..5cb6d2f7a7 100644 --- a/Source/ASRunLoopQueue.h +++ b/Source/ASRunLoopQueue.h @@ -2,17 +2,9 @@ // ASRunLoopQueue.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index 2cc4fc6b3c..391e8e85e1 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -2,17 +2,9 @@ // ASRunLoopQueue.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASScrollNode.h b/Source/ASScrollNode.h index 972bbb425f..1137e89ede 100644 --- a/Source/ASScrollNode.h +++ b/Source/ASScrollNode.h @@ -2,17 +2,9 @@ // ASScrollNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASScrollNode.mm b/Source/ASScrollNode.mm index a7458f19df..c155b4749b 100644 --- a/Source/ASScrollNode.mm +++ b/Source/ASScrollNode.mm @@ -2,17 +2,9 @@ // ASScrollNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASSectionController.h b/Source/ASSectionController.h index b418ee969b..de26770ceb 100644 --- a/Source/ASSectionController.h +++ b/Source/ASSectionController.h @@ -2,17 +2,9 @@ // ASSectionController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASSupplementaryNodeSource.h b/Source/ASSupplementaryNodeSource.h index d0d096ae7c..8f1bfcfa09 100644 --- a/Source/ASSupplementaryNodeSource.h +++ b/Source/ASSupplementaryNodeSource.h @@ -2,17 +2,9 @@ // ASSupplementaryNodeSource.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTabBarController.h b/Source/ASTabBarController.h index bd24c38815..faa67a041c 100644 --- a/Source/ASTabBarController.h +++ b/Source/ASTabBarController.h @@ -2,17 +2,9 @@ // ASTabBarController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTabBarController.m b/Source/ASTabBarController.m index f43ecf7843..67a9ad964d 100644 --- a/Source/ASTabBarController.m +++ b/Source/ASTabBarController.m @@ -2,17 +2,9 @@ // ASTabBarController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableNode+Beta.h b/Source/ASTableNode+Beta.h index c2b27fa971..6d580bdc43 100644 --- a/Source/ASTableNode+Beta.h +++ b/Source/ASTableNode+Beta.h @@ -2,12 +2,8 @@ // ASTableNode+Beta.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableNode.h b/Source/ASTableNode.h index d5a5ed6767..2476c309c1 100644 --- a/Source/ASTableNode.h +++ b/Source/ASTableNode.h @@ -2,17 +2,9 @@ // ASTableNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableNode.mm b/Source/ASTableNode.mm index 540fb466ad..12d3f972f4 100644 --- a/Source/ASTableNode.mm +++ b/Source/ASTableNode.mm @@ -2,17 +2,9 @@ // ASTableNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableView.h b/Source/ASTableView.h index f87627378d..a2258b3207 100644 --- a/Source/ASTableView.h +++ b/Source/ASTableView.h @@ -2,17 +2,9 @@ // ASTableView.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableView.mm b/Source/ASTableView.mm index ae215a1210..b88906bf89 100644 --- a/Source/ASTableView.mm +++ b/Source/ASTableView.mm @@ -2,17 +2,9 @@ // ASTableView.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableViewInternal.h b/Source/ASTableViewInternal.h index ac814690ce..d8bbf577ab 100644 --- a/Source/ASTableViewInternal.h +++ b/Source/ASTableViewInternal.h @@ -2,17 +2,9 @@ // ASTableViewInternal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTableViewProtocols.h b/Source/ASTableViewProtocols.h index 08c54d0412..969a5c61cb 100644 --- a/Source/ASTableViewProtocols.h +++ b/Source/ASTableViewProtocols.h @@ -2,17 +2,9 @@ // ASTableViewProtocols.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNode+Beta.h b/Source/ASTextNode+Beta.h index a0bbdbbcea..09259bd7f4 100644 --- a/Source/ASTextNode+Beta.h +++ b/Source/ASTextNode+Beta.h @@ -2,17 +2,9 @@ // ASTextNode+Beta.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNode.h b/Source/ASTextNode.h index d1d1c734e2..b6c676a3a6 100644 --- a/Source/ASTextNode.h +++ b/Source/ASTextNode.h @@ -2,17 +2,9 @@ // ASTextNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index f71363d68a..01819de417 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -2,17 +2,9 @@ // ASTextNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNode2.h b/Source/ASTextNode2.h index fcff5b60a7..7718672515 100644 --- a/Source/ASTextNode2.h +++ b/Source/ASTextNode2.h @@ -2,12 +2,8 @@ // ASTextNode2.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 3ab1d2f35c..e17c707254 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -2,12 +2,8 @@ // ASTextNode2.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASTextNodeCommon.h b/Source/ASTextNodeCommon.h index 0ff51b4021..c702561e63 100644 --- a/Source/ASTextNodeCommon.h +++ b/Source/ASTextNodeCommon.h @@ -2,12 +2,8 @@ // ASTextNodeCommon.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASVideoNode.h b/Source/ASVideoNode.h index ceed47ab7b..69df055367 100644 --- a/Source/ASVideoNode.h +++ b/Source/ASVideoNode.h @@ -2,17 +2,9 @@ // ASVideoNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASVideoNode.mm b/Source/ASVideoNode.mm index 3b8c9bd37c..4cb4ba8c5f 100644 --- a/Source/ASVideoNode.mm +++ b/Source/ASVideoNode.mm @@ -2,17 +2,9 @@ // ASVideoNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASVideoPlayerNode.h b/Source/ASVideoPlayerNode.h index 8e7c3a9519..8d4cf87bcb 100644 --- a/Source/ASVideoPlayerNode.h +++ b/Source/ASVideoPlayerNode.h @@ -2,17 +2,9 @@ // ASVideoPlayerNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #if TARGET_OS_IOS diff --git a/Source/ASVideoPlayerNode.mm b/Source/ASVideoPlayerNode.mm index 0097f3d718..e71cdbc4f7 100644 --- a/Source/ASVideoPlayerNode.mm +++ b/Source/ASVideoPlayerNode.mm @@ -2,17 +2,9 @@ // ASVideoPlayerNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASViewController.h b/Source/ASViewController.h index 9f1e78deec..94863298d5 100644 --- a/Source/ASViewController.h +++ b/Source/ASViewController.h @@ -2,17 +2,9 @@ // ASViewController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASViewController.mm b/Source/ASViewController.mm index 8aded78c3c..78dd75a096 100644 --- a/Source/ASViewController.mm +++ b/Source/ASViewController.mm @@ -2,17 +2,9 @@ // ASViewController.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASVisibilityProtocols.h b/Source/ASVisibilityProtocols.h index 7f94bf6ae3..837e848269 100644 --- a/Source/ASVisibilityProtocols.h +++ b/Source/ASVisibilityProtocols.h @@ -2,17 +2,9 @@ // ASVisibilityProtocols.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/ASVisibilityProtocols.m b/Source/ASVisibilityProtocols.m index 4078793292..9ee52c433f 100644 --- a/Source/ASVisibilityProtocols.m +++ b/Source/ASVisibilityProtocols.m @@ -2,17 +2,9 @@ // ASVisibilityProtocols.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/AsyncDisplayKit+IGListKitMethods.h b/Source/AsyncDisplayKit+IGListKitMethods.h index 8c7002dca8..aa0de42510 100644 --- a/Source/AsyncDisplayKit+IGListKitMethods.h +++ b/Source/AsyncDisplayKit+IGListKitMethods.h @@ -2,17 +2,9 @@ // AsyncDisplayKit+IGListKitMethods.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/AsyncDisplayKit+IGListKitMethods.m b/Source/AsyncDisplayKit+IGListKitMethods.m index 186909729c..50d7a219f8 100644 --- a/Source/AsyncDisplayKit+IGListKitMethods.m +++ b/Source/AsyncDisplayKit+IGListKitMethods.m @@ -2,17 +2,9 @@ // AsyncDisplayKit+IGListKitMethods.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/AsyncDisplayKit.h b/Source/AsyncDisplayKit.h index d98d003615..1445e07832 100644 --- a/Source/AsyncDisplayKit.h +++ b/Source/AsyncDisplayKit.h @@ -2,17 +2,9 @@ // AsyncDisplayKit.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASAssert.h b/Source/Base/ASAssert.h index 863a52466d..e838c86dd1 100644 --- a/Source/Base/ASAssert.h +++ b/Source/Base/ASAssert.h @@ -2,17 +2,9 @@ // ASAssert.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Base/ASAssert.m b/Source/Base/ASAssert.m index 0eceba944b..73bee34ea9 100644 --- a/Source/Base/ASAssert.m +++ b/Source/Base/ASAssert.m @@ -2,12 +2,8 @@ // ASAssert.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASAvailability.h b/Source/Base/ASAvailability.h index 32efcbc0bf..88e9e3fbe0 100644 --- a/Source/Base/ASAvailability.h +++ b/Source/Base/ASAvailability.h @@ -2,17 +2,9 @@ // ASAvailability.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h old mode 100755 new mode 100644 index 2fabc0dde5..5c72cb71bd --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -2,17 +2,9 @@ // ASBaseDefines.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASDisplayNode+Ancestry.h b/Source/Base/ASDisplayNode+Ancestry.h index 6c5815db88..2c61cee00c 100644 --- a/Source/Base/ASDisplayNode+Ancestry.h +++ b/Source/Base/ASDisplayNode+Ancestry.h @@ -2,17 +2,9 @@ // ASDisplayNode+Ancestry.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASDisplayNode+Ancestry.m b/Source/Base/ASDisplayNode+Ancestry.m index 566cc8bd33..33b53b18fc 100644 --- a/Source/Base/ASDisplayNode+Ancestry.m +++ b/Source/Base/ASDisplayNode+Ancestry.m @@ -2,17 +2,9 @@ // ASDisplayNode+Ancestry.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASDisplayNode+Ancestry.h" diff --git a/Source/Base/ASEqualityHelpers.h b/Source/Base/ASEqualityHelpers.h index 9bdfb2edef..602459547b 100644 --- a/Source/Base/ASEqualityHelpers.h +++ b/Source/Base/ASEqualityHelpers.h @@ -2,17 +2,9 @@ // ASEqualityHelpers.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASLog.h b/Source/Base/ASLog.h index 99da08cc17..ccab4b8e58 100644 --- a/Source/Base/ASLog.h +++ b/Source/Base/ASLog.h @@ -2,17 +2,9 @@ // ASLog.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASLog.m b/Source/Base/ASLog.m index e1c42ea79d..8dcd8a8f34 100644 --- a/Source/Base/ASLog.m +++ b/Source/Base/ASLog.m @@ -2,12 +2,8 @@ // ASLog.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Base/ASSignpost.h b/Source/Base/ASSignpost.h index fa2635003c..a841794417 100644 --- a/Source/Base/ASSignpost.h +++ b/Source/Base/ASSignpost.h @@ -2,12 +2,8 @@ // ASSignpost.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // /// The signposts we use. Signposts are grouped by color. The SystemTrace.tracetemplate file diff --git a/Source/Debug/AsyncDisplayKit+Debug.h b/Source/Debug/AsyncDisplayKit+Debug.h index 683e98bc60..6dc51374ec 100644 --- a/Source/Debug/AsyncDisplayKit+Debug.h +++ b/Source/Debug/AsyncDisplayKit+Debug.h @@ -2,17 +2,9 @@ // AsyncDisplayKit+Debug.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Debug/AsyncDisplayKit+Debug.m b/Source/Debug/AsyncDisplayKit+Debug.m index 10081b43bb..50dc802400 100644 --- a/Source/Debug/AsyncDisplayKit+Debug.m +++ b/Source/Debug/AsyncDisplayKit+Debug.m @@ -2,17 +2,9 @@ // AsyncDisplayKit+Debug.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Debug/AsyncDisplayKit+Tips.h b/Source/Debug/AsyncDisplayKit+Tips.h index 33f5707a98..6232746a57 100644 --- a/Source/Debug/AsyncDisplayKit+Tips.h +++ b/Source/Debug/AsyncDisplayKit+Tips.h @@ -2,17 +2,9 @@ // AsyncDisplayKit+Tips.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Debug/AsyncDisplayKit+Tips.m b/Source/Debug/AsyncDisplayKit+Tips.m index 3b1f461a22..19a955b68c 100644 --- a/Source/Debug/AsyncDisplayKit+Tips.m +++ b/Source/Debug/AsyncDisplayKit+Tips.m @@ -2,17 +2,9 @@ // AsyncDisplayKit+Tips.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AsyncDisplayKit+Tips.h" diff --git a/Source/Details/ASAbstractLayoutController.h b/Source/Details/ASAbstractLayoutController.h index c5ffc740e0..6de7801fb6 100644 --- a/Source/Details/ASAbstractLayoutController.h +++ b/Source/Details/ASAbstractLayoutController.h @@ -2,17 +2,9 @@ // ASAbstractLayoutController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASAbstractLayoutController.mm b/Source/Details/ASAbstractLayoutController.mm index 391c381f2d..f63a3ca86c 100644 --- a/Source/Details/ASAbstractLayoutController.mm +++ b/Source/Details/ASAbstractLayoutController.mm @@ -2,17 +2,9 @@ // ASAbstractLayoutController.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASBasicImageDownloader.h b/Source/Details/ASBasicImageDownloader.h index 5d9a7b3847..7667bf8f9c 100644 --- a/Source/Details/ASBasicImageDownloader.h +++ b/Source/Details/ASBasicImageDownloader.h @@ -2,17 +2,9 @@ // ASBasicImageDownloader.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASBasicImageDownloader.mm b/Source/Details/ASBasicImageDownloader.mm index b98feb31f5..24ccf95bfd 100644 --- a/Source/Details/ASBasicImageDownloader.mm +++ b/Source/Details/ASBasicImageDownloader.mm @@ -2,17 +2,9 @@ // ASBasicImageDownloader.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASBatchContext.h b/Source/Details/ASBatchContext.h index 695d8c6574..2c71e03f86 100644 --- a/Source/Details/ASBatchContext.h +++ b/Source/Details/ASBatchContext.h @@ -2,17 +2,9 @@ // ASBatchContext.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASBatchContext.m b/Source/Details/ASBatchContext.m index 5ac780ddcd..c05f58f00c 100644 --- a/Source/Details/ASBatchContext.m +++ b/Source/Details/ASBatchContext.m @@ -2,17 +2,9 @@ // ASBatchContext.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASBatchFetchingDelegate.h b/Source/Details/ASBatchFetchingDelegate.h index 972a03b182..3b35115026 100644 --- a/Source/Details/ASBatchFetchingDelegate.h +++ b/Source/Details/ASBatchFetchingDelegate.h @@ -2,12 +2,8 @@ // ASBatchFetchingDelegate.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionElement.h b/Source/Details/ASCollectionElement.h index 1c159094e7..b128dd66fe 100644 --- a/Source/Details/ASCollectionElement.h +++ b/Source/Details/ASCollectionElement.h @@ -2,17 +2,9 @@ // ASCollectionElement.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionElement.mm b/Source/Details/ASCollectionElement.mm index 4265098edd..dcf2b92bb5 100644 --- a/Source/Details/ASCollectionElement.mm +++ b/Source/Details/ASCollectionElement.mm @@ -2,17 +2,9 @@ // ASCollectionElement.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionFlowLayoutDelegate.h b/Source/Details/ASCollectionFlowLayoutDelegate.h index f68cc74fb3..d22e9bbaab 100644 --- a/Source/Details/ASCollectionFlowLayoutDelegate.h +++ b/Source/Details/ASCollectionFlowLayoutDelegate.h @@ -2,17 +2,9 @@ // ASCollectionFlowLayoutDelegate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionFlowLayoutDelegate.m b/Source/Details/ASCollectionFlowLayoutDelegate.m index cbcdbe048d..746875155a 100644 --- a/Source/Details/ASCollectionFlowLayoutDelegate.m +++ b/Source/Details/ASCollectionFlowLayoutDelegate.m @@ -2,17 +2,9 @@ // ASCollectionFlowLayoutDelegate.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionGalleryLayoutDelegate.h b/Source/Details/ASCollectionGalleryLayoutDelegate.h index 99958d1c97..064891c54d 100644 --- a/Source/Details/ASCollectionGalleryLayoutDelegate.h +++ b/Source/Details/ASCollectionGalleryLayoutDelegate.h @@ -2,12 +2,8 @@ // ASCollectionGalleryLayoutDelegate.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionGalleryLayoutDelegate.mm b/Source/Details/ASCollectionGalleryLayoutDelegate.mm index c6e818ab09..a67abd5394 100644 --- a/Source/Details/ASCollectionGalleryLayoutDelegate.mm +++ b/Source/Details/ASCollectionGalleryLayoutDelegate.mm @@ -2,12 +2,8 @@ // ASCollectionGalleryLayoutDelegate.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionInternal.h b/Source/Details/ASCollectionInternal.h index c8aee82913..0cd9e8db8e 100644 --- a/Source/Details/ASCollectionInternal.h +++ b/Source/Details/ASCollectionInternal.h @@ -2,17 +2,9 @@ // ASCollectionInternal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionInternal.m b/Source/Details/ASCollectionInternal.m index 5408f81d11..0d50fe3463 100644 --- a/Source/Details/ASCollectionInternal.m +++ b/Source/Details/ASCollectionInternal.m @@ -2,16 +2,8 @@ // ASCollectionInternal.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/Source/Details/ASCollectionLayoutContext.h b/Source/Details/ASCollectionLayoutContext.h index d063f3e4ab..4c25838d2f 100644 --- a/Source/Details/ASCollectionLayoutContext.h +++ b/Source/Details/ASCollectionLayoutContext.h @@ -2,17 +2,9 @@ // ASCollectionLayoutContext.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionLayoutContext.m b/Source/Details/ASCollectionLayoutContext.m index 06dcd08f96..1ee98e038e 100644 --- a/Source/Details/ASCollectionLayoutContext.m +++ b/Source/Details/ASCollectionLayoutContext.m @@ -2,12 +2,8 @@ // ASCollectionLayoutContext.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionLayoutDelegate.h b/Source/Details/ASCollectionLayoutDelegate.h index 4e75b25fcd..c53e22a0d4 100644 --- a/Source/Details/ASCollectionLayoutDelegate.h +++ b/Source/Details/ASCollectionLayoutDelegate.h @@ -2,17 +2,9 @@ // ASCollectionLayoutDelegate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionLayoutState.h b/Source/Details/ASCollectionLayoutState.h index ee32a863de..c3620330c9 100644 --- a/Source/Details/ASCollectionLayoutState.h +++ b/Source/Details/ASCollectionLayoutState.h @@ -2,17 +2,9 @@ // ASCollectionLayoutState.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionLayoutState.mm b/Source/Details/ASCollectionLayoutState.mm index bdfaa8a720..98a2d5a42e 100644 --- a/Source/Details/ASCollectionLayoutState.mm +++ b/Source/Details/ASCollectionLayoutState.mm @@ -2,12 +2,8 @@ // ASCollectionLayoutState.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionViewLayoutController.h b/Source/Details/ASCollectionViewLayoutController.h index 3ce99dedec..6311e0ad81 100644 --- a/Source/Details/ASCollectionViewLayoutController.h +++ b/Source/Details/ASCollectionViewLayoutController.h @@ -2,17 +2,9 @@ // ASCollectionViewLayoutController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionViewLayoutController.m b/Source/Details/ASCollectionViewLayoutController.m index 2590fe7a5b..46c869b8a9 100644 --- a/Source/Details/ASCollectionViewLayoutController.m +++ b/Source/Details/ASCollectionViewLayoutController.m @@ -2,17 +2,9 @@ // ASCollectionViewLayoutController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionViewLayoutInspector.h b/Source/Details/ASCollectionViewLayoutInspector.h index a3c283f562..a1ddb3474e 100644 --- a/Source/Details/ASCollectionViewLayoutInspector.h +++ b/Source/Details/ASCollectionViewLayoutInspector.h @@ -2,17 +2,9 @@ // ASCollectionViewLayoutInspector.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASCollectionViewLayoutInspector.m b/Source/Details/ASCollectionViewLayoutInspector.m index 9b8a302d99..2abab8de02 100644 --- a/Source/Details/ASCollectionViewLayoutInspector.m +++ b/Source/Details/ASCollectionViewLayoutInspector.m @@ -2,17 +2,9 @@ // ASCollectionViewLayoutInspector.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASDataController.h b/Source/Details/ASDataController.h index 7bb5e75e20..fbd48731e2 100644 --- a/Source/Details/ASDataController.h +++ b/Source/Details/ASDataController.h @@ -2,17 +2,9 @@ // ASDataController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Details/ASDataController.mm b/Source/Details/ASDataController.mm index 9ecfe2dc89..962e6b2b9f 100644 --- a/Source/Details/ASDataController.mm +++ b/Source/Details/ASDataController.mm @@ -2,17 +2,9 @@ // ASDataController.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASDelegateProxy.h b/Source/Details/ASDelegateProxy.h index 3161512865..7ed406b6db 100644 --- a/Source/Details/ASDelegateProxy.h +++ b/Source/Details/ASDelegateProxy.h @@ -2,17 +2,9 @@ // ASDelegateProxy.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASDelegateProxy.m b/Source/Details/ASDelegateProxy.m index e7f180fc1f..ba60c23b6b 100644 --- a/Source/Details/ASDelegateProxy.m +++ b/Source/Details/ASDelegateProxy.m @@ -2,17 +2,9 @@ // ASDelegateProxy.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASElementMap.h b/Source/Details/ASElementMap.h index a09206c783..bf5b259943 100644 --- a/Source/Details/ASElementMap.h +++ b/Source/Details/ASElementMap.h @@ -2,17 +2,9 @@ // ASElementMap.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASElementMap.m b/Source/Details/ASElementMap.m index f27ba1b574..edd036b05e 100644 --- a/Source/Details/ASElementMap.m +++ b/Source/Details/ASElementMap.m @@ -2,17 +2,9 @@ // ASElementMap.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASElementMap.h" diff --git a/Source/Details/ASEventLog.h b/Source/Details/ASEventLog.h index 379ae53a72..9a147f259d 100644 --- a/Source/Details/ASEventLog.h +++ b/Source/Details/ASEventLog.h @@ -2,17 +2,9 @@ // ASEventLog.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASEventLog.mm b/Source/Details/ASEventLog.mm index 1389f93577..00bdbb5581 100644 --- a/Source/Details/ASEventLog.mm +++ b/Source/Details/ASEventLog.mm @@ -2,17 +2,9 @@ // ASEventLog.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASGraphicsContext.h b/Source/Details/ASGraphicsContext.h index 336ebbc469..d22d3806b0 100644 --- a/Source/Details/ASGraphicsContext.h +++ b/Source/Details/ASGraphicsContext.h @@ -2,12 +2,8 @@ // ASGraphicsContext.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASGraphicsContext.m b/Source/Details/ASGraphicsContext.m index efe9658558..26255a58ae 100644 --- a/Source/Details/ASGraphicsContext.m +++ b/Source/Details/ASGraphicsContext.m @@ -2,12 +2,8 @@ // ASGraphicsContext.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASGraphicsContext.h" diff --git a/Source/Details/ASHashing.h b/Source/Details/ASHashing.h index 6177a74fe7..084d74078a 100644 --- a/Source/Details/ASHashing.h +++ b/Source/Details/ASHashing.h @@ -2,12 +2,8 @@ // ASHashing.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASHashing.m b/Source/Details/ASHashing.m index 9f6d0f2349..2863e2dc58 100644 --- a/Source/Details/ASHashing.m +++ b/Source/Details/ASHashing.m @@ -2,12 +2,8 @@ // ASHashing.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASHighlightOverlayLayer.h b/Source/Details/ASHighlightOverlayLayer.h index 2880abbd62..aff6694bf1 100644 --- a/Source/Details/ASHighlightOverlayLayer.h +++ b/Source/Details/ASHighlightOverlayLayer.h @@ -2,17 +2,9 @@ // ASHighlightOverlayLayer.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASHighlightOverlayLayer.mm b/Source/Details/ASHighlightOverlayLayer.mm index ac298308d2..03cf468165 100644 --- a/Source/Details/ASHighlightOverlayLayer.mm +++ b/Source/Details/ASHighlightOverlayLayer.mm @@ -2,17 +2,9 @@ // ASHighlightOverlayLayer.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASImageContainerProtocolCategories.h b/Source/Details/ASImageContainerProtocolCategories.h index 529056238c..44ddc354fd 100644 --- a/Source/Details/ASImageContainerProtocolCategories.h +++ b/Source/Details/ASImageContainerProtocolCategories.h @@ -2,17 +2,9 @@ // ASImageContainerProtocolCategories.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASImageContainerProtocolCategories.m b/Source/Details/ASImageContainerProtocolCategories.m index 546dc3fda5..1df6a9111f 100644 --- a/Source/Details/ASImageContainerProtocolCategories.m +++ b/Source/Details/ASImageContainerProtocolCategories.m @@ -2,17 +2,9 @@ // ASImageContainerProtocolCategories.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASImageProtocols.h b/Source/Details/ASImageProtocols.h index a686a7ace6..10ad85db35 100644 --- a/Source/Details/ASImageProtocols.h +++ b/Source/Details/ASImageProtocols.h @@ -2,17 +2,9 @@ // ASImageProtocols.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASIntegerMap.h b/Source/Details/ASIntegerMap.h index 75f6d0f610..ece6f5a8bf 100644 --- a/Source/Details/ASIntegerMap.h +++ b/Source/Details/ASIntegerMap.h @@ -2,12 +2,8 @@ // ASIntegerMap.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASIntegerMap.mm b/Source/Details/ASIntegerMap.mm index 6d542b2081..afdbc6eb12 100644 --- a/Source/Details/ASIntegerMap.mm +++ b/Source/Details/ASIntegerMap.mm @@ -2,12 +2,8 @@ // ASIntegerMap.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASIntegerMap.h" diff --git a/Source/Details/ASLayoutController.h b/Source/Details/ASLayoutController.h index 3e8aa6dce8..d0e2f60907 100644 --- a/Source/Details/ASLayoutController.h +++ b/Source/Details/ASLayoutController.h @@ -2,17 +2,9 @@ // ASLayoutController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASLayoutRangeType.h b/Source/Details/ASLayoutRangeType.h index 421dc995f6..d4af470c06 100644 --- a/Source/Details/ASLayoutRangeType.h +++ b/Source/Details/ASLayoutRangeType.h @@ -2,17 +2,9 @@ // ASLayoutRangeType.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASMainSerialQueue.h b/Source/Details/ASMainSerialQueue.h index e94451d64c..405164f75d 100644 --- a/Source/Details/ASMainSerialQueue.h +++ b/Source/Details/ASMainSerialQueue.h @@ -2,17 +2,9 @@ // ASMainSerialQueue.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASMainSerialQueue.mm b/Source/Details/ASMainSerialQueue.mm index 4a3d929c18..6a9baee50c 100644 --- a/Source/Details/ASMainSerialQueue.mm +++ b/Source/Details/ASMainSerialQueue.mm @@ -2,17 +2,9 @@ // ASMainSerialQueue.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASMutableAttributedStringBuilder.h b/Source/Details/ASMutableAttributedStringBuilder.h index c6ecbea75c..d531549a0e 100644 --- a/Source/Details/ASMutableAttributedStringBuilder.h +++ b/Source/Details/ASMutableAttributedStringBuilder.h @@ -2,17 +2,9 @@ // ASMutableAttributedStringBuilder.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASMutableAttributedStringBuilder.m b/Source/Details/ASMutableAttributedStringBuilder.m index 4137a92def..65a2333711 100644 --- a/Source/Details/ASMutableAttributedStringBuilder.m +++ b/Source/Details/ASMutableAttributedStringBuilder.m @@ -2,17 +2,9 @@ // ASMutableAttributedStringBuilder.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASObjectDescriptionHelpers.h b/Source/Details/ASObjectDescriptionHelpers.h index c3eb7053ec..5a2823bd99 100644 --- a/Source/Details/ASObjectDescriptionHelpers.h +++ b/Source/Details/ASObjectDescriptionHelpers.h @@ -2,17 +2,9 @@ // ASObjectDescriptionHelpers.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASObjectDescriptionHelpers.m b/Source/Details/ASObjectDescriptionHelpers.m index b34872868c..db69a7bf1b 100644 --- a/Source/Details/ASObjectDescriptionHelpers.m +++ b/Source/Details/ASObjectDescriptionHelpers.m @@ -2,17 +2,9 @@ // ASObjectDescriptionHelpers.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index 14b207dd9b..26567027e2 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -2,17 +2,9 @@ // ASPINRemoteImageDownloader.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index ead29fb850..571c5de578 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -2,17 +2,9 @@ // ASPINRemoteImageDownloader.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPageTable.h b/Source/Details/ASPageTable.h index bd5d467e57..9b1921bde0 100644 --- a/Source/Details/ASPageTable.h +++ b/Source/Details/ASPageTable.h @@ -2,12 +2,8 @@ // ASPageTable.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPageTable.m b/Source/Details/ASPageTable.m index 4e66fe9819..22a96870b2 100644 --- a/Source/Details/ASPageTable.m +++ b/Source/Details/ASPageTable.m @@ -2,12 +2,8 @@ // ASPageTable.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPhotosFrameworkImageRequest.h b/Source/Details/ASPhotosFrameworkImageRequest.h index 869f5e8102..2ca24bfbee 100644 --- a/Source/Details/ASPhotosFrameworkImageRequest.h +++ b/Source/Details/ASPhotosFrameworkImageRequest.h @@ -2,17 +2,9 @@ // ASPhotosFrameworkImageRequest.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASPhotosFrameworkImageRequest.m b/Source/Details/ASPhotosFrameworkImageRequest.m index 35487d535e..942000bb6f 100644 --- a/Source/Details/ASPhotosFrameworkImageRequest.m +++ b/Source/Details/ASPhotosFrameworkImageRequest.m @@ -2,17 +2,9 @@ // ASPhotosFrameworkImageRequest.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASRangeController.h b/Source/Details/ASRangeController.h index d9537c0d07..7b062c43eb 100644 --- a/Source/Details/ASRangeController.h +++ b/Source/Details/ASRangeController.h @@ -2,17 +2,9 @@ // ASRangeController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASRangeController.mm b/Source/Details/ASRangeController.mm index 1b141a3cd8..ff0176100b 100644 --- a/Source/Details/ASRangeController.mm +++ b/Source/Details/ASRangeController.mm @@ -2,17 +2,9 @@ // ASRangeController.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASRangeControllerUpdateRangeProtocol+Beta.h b/Source/Details/ASRangeControllerUpdateRangeProtocol+Beta.h index 6ab4e34cc0..4c5b08a912 100644 --- a/Source/Details/ASRangeControllerUpdateRangeProtocol+Beta.h +++ b/Source/Details/ASRangeControllerUpdateRangeProtocol+Beta.h @@ -2,17 +2,9 @@ // ASRangeControllerUpdateRangeProtocol+Beta.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASRecursiveUnfairLock.h b/Source/Details/ASRecursiveUnfairLock.h index 3b5ef11de7..48aab7f307 100644 --- a/Source/Details/ASRecursiveUnfairLock.h +++ b/Source/Details/ASRecursiveUnfairLock.h @@ -2,12 +2,8 @@ // ASRecursiveUnfairLock.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASRecursiveUnfairLock.m b/Source/Details/ASRecursiveUnfairLock.m index a07b751c4a..7e5cac3681 100644 --- a/Source/Details/ASRecursiveUnfairLock.m +++ b/Source/Details/ASRecursiveUnfairLock.m @@ -2,12 +2,8 @@ // ASRecursiveUnfairLock.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASRecursiveUnfairLock.h" diff --git a/Source/Details/ASScrollDirection.h b/Source/Details/ASScrollDirection.h index 6a89b6f09a..41538ed31b 100644 --- a/Source/Details/ASScrollDirection.h +++ b/Source/Details/ASScrollDirection.h @@ -2,17 +2,9 @@ // ASScrollDirection.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASScrollDirection.m b/Source/Details/ASScrollDirection.m index fa123c6a18..4edc8ec259 100644 --- a/Source/Details/ASScrollDirection.m +++ b/Source/Details/ASScrollDirection.m @@ -2,17 +2,9 @@ // ASScrollDirection.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASSectionContext.h b/Source/Details/ASSectionContext.h index 4352645f79..8112cb2213 100644 --- a/Source/Details/ASSectionContext.h +++ b/Source/Details/ASSectionContext.h @@ -2,17 +2,9 @@ // ASSectionContext.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASTableLayoutController.h b/Source/Details/ASTableLayoutController.h index 7d2d564f2a..385a6a4d2b 100644 --- a/Source/Details/ASTableLayoutController.h +++ b/Source/Details/ASTableLayoutController.h @@ -2,17 +2,9 @@ // ASTableLayoutController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASTableLayoutController.m b/Source/Details/ASTableLayoutController.m index 636be303cf..3ca3adee72 100644 --- a/Source/Details/ASTableLayoutController.m +++ b/Source/Details/ASTableLayoutController.m @@ -2,17 +2,9 @@ // ASTableLayoutController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASThread.h b/Source/Details/ASThread.h index 3ebf40654b..bdcfd26189 100644 --- a/Source/Details/ASThread.h +++ b/Source/Details/ASThread.h @@ -2,17 +2,9 @@ // ASThread.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASTraceEvent.h b/Source/Details/ASTraceEvent.h index 48c45cec6c..8ca7b32fa6 100644 --- a/Source/Details/ASTraceEvent.h +++ b/Source/Details/ASTraceEvent.h @@ -2,17 +2,9 @@ // ASTraceEvent.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASTraceEvent.m b/Source/Details/ASTraceEvent.m index d3d4ff6a5d..0325fbf901 100644 --- a/Source/Details/ASTraceEvent.m +++ b/Source/Details/ASTraceEvent.m @@ -2,17 +2,9 @@ // ASTraceEvent.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASTraitCollection.h b/Source/Details/ASTraitCollection.h index bd0ce1b9d6..72dedd616c 100644 --- a/Source/Details/ASTraitCollection.h +++ b/Source/Details/ASTraitCollection.h @@ -2,17 +2,9 @@ // ASTraitCollection.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/Source/Details/ASTraitCollection.m b/Source/Details/ASTraitCollection.m index e03db0f45d..56c29c5cbe 100644 --- a/Source/Details/ASTraitCollection.m +++ b/Source/Details/ASTraitCollection.m @@ -2,17 +2,9 @@ // ASTraitCollection.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASWeakProxy.h b/Source/Details/ASWeakProxy.h index 4a24905135..7396474b1c 100644 --- a/Source/Details/ASWeakProxy.h +++ b/Source/Details/ASWeakProxy.h @@ -2,17 +2,9 @@ // ASWeakProxy.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASWeakProxy.m b/Source/Details/ASWeakProxy.m index 721191bc0a..cfcb1aca5c 100644 --- a/Source/Details/ASWeakProxy.m +++ b/Source/Details/ASWeakProxy.m @@ -2,17 +2,9 @@ // ASWeakProxy.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASWeakSet.h b/Source/Details/ASWeakSet.h index 7d6b8d8d05..cc435dec0e 100644 --- a/Source/Details/ASWeakSet.h +++ b/Source/Details/ASWeakSet.h @@ -2,17 +2,9 @@ // ASWeakSet.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/ASWeakSet.m b/Source/Details/ASWeakSet.m index 82d5014891..7d05dbed6e 100644 --- a/Source/Details/ASWeakSet.m +++ b/Source/Details/ASWeakSet.m @@ -2,17 +2,9 @@ // ASWeakSet.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/CoreGraphics+ASConvenience.h b/Source/Details/CoreGraphics+ASConvenience.h index 9eeef3192f..a0805f1701 100644 --- a/Source/Details/CoreGraphics+ASConvenience.h +++ b/Source/Details/CoreGraphics+ASConvenience.h @@ -2,17 +2,9 @@ // CoreGraphics+ASConvenience.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/CoreGraphics+ASConvenience.m b/Source/Details/CoreGraphics+ASConvenience.m index 92169ffe4e..0f78cf1bee 100644 --- a/Source/Details/CoreGraphics+ASConvenience.m +++ b/Source/Details/CoreGraphics+ASConvenience.m @@ -2,17 +2,9 @@ // CoreGraphics+ASConvenience.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/NSArray+Diffing.h b/Source/Details/NSArray+Diffing.h index 3fd83806e2..c463903144 100644 --- a/Source/Details/NSArray+Diffing.h +++ b/Source/Details/NSArray+Diffing.h @@ -2,17 +2,9 @@ // NSArray+Diffing.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/NSArray+Diffing.mm b/Source/Details/NSArray+Diffing.mm index 64063ff71b..83d32fea68 100644 --- a/Source/Details/NSArray+Diffing.mm +++ b/Source/Details/NSArray+Diffing.mm @@ -1,18 +1,10 @@ // -// NSArray+Diffing.m +// NSArray+Diffing.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/NSIndexSet+ASHelpers.h b/Source/Details/NSIndexSet+ASHelpers.h index 2ac42f96b4..cab7c94310 100644 --- a/Source/Details/NSIndexSet+ASHelpers.h +++ b/Source/Details/NSIndexSet+ASHelpers.h @@ -2,17 +2,9 @@ // NSIndexSet+ASHelpers.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/NSIndexSet+ASHelpers.m b/Source/Details/NSIndexSet+ASHelpers.m index cc097e15e5..c38cb4c1b5 100644 --- a/Source/Details/NSIndexSet+ASHelpers.m +++ b/Source/Details/NSIndexSet+ASHelpers.m @@ -2,17 +2,9 @@ // NSIndexSet+ASHelpers.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // // UIKit indexPath helpers diff --git a/Source/Details/NSMutableAttributedString+TextKitAdditions.h b/Source/Details/NSMutableAttributedString+TextKitAdditions.h index 49ff968194..afb96722c6 100644 --- a/Source/Details/NSMutableAttributedString+TextKitAdditions.h +++ b/Source/Details/NSMutableAttributedString+TextKitAdditions.h @@ -2,17 +2,9 @@ // NSMutableAttributedString+TextKitAdditions.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/NSMutableAttributedString+TextKitAdditions.m b/Source/Details/NSMutableAttributedString+TextKitAdditions.m index aff849ae17..85c59b2af4 100644 --- a/Source/Details/NSMutableAttributedString+TextKitAdditions.m +++ b/Source/Details/NSMutableAttributedString+TextKitAdditions.m @@ -2,17 +2,9 @@ // NSMutableAttributedString+TextKitAdditions.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/Transactions/_ASAsyncTransaction.h b/Source/Details/Transactions/_ASAsyncTransaction.h index f22de659bc..245c62b295 100644 --- a/Source/Details/Transactions/_ASAsyncTransaction.h +++ b/Source/Details/Transactions/_ASAsyncTransaction.h @@ -2,17 +2,9 @@ // _ASAsyncTransaction.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/Transactions/_ASAsyncTransaction.mm b/Source/Details/Transactions/_ASAsyncTransaction.mm index cdec27c3e4..b4b8adf6a9 100644 --- a/Source/Details/Transactions/_ASAsyncTransaction.mm +++ b/Source/Details/Transactions/_ASAsyncTransaction.mm @@ -2,17 +2,9 @@ // _ASAsyncTransaction.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // // We need this import for UITrackingRunLoopMode diff --git a/Source/Details/Transactions/_ASAsyncTransactionContainer+Private.h b/Source/Details/Transactions/_ASAsyncTransactionContainer+Private.h index 8dd3c8d509..003184c586 100644 --- a/Source/Details/Transactions/_ASAsyncTransactionContainer+Private.h +++ b/Source/Details/Transactions/_ASAsyncTransactionContainer+Private.h @@ -2,17 +2,9 @@ // _ASAsyncTransactionContainer+Private.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/Transactions/_ASAsyncTransactionContainer.h b/Source/Details/Transactions/_ASAsyncTransactionContainer.h index 83610c046b..53fe40f809 100644 --- a/Source/Details/Transactions/_ASAsyncTransactionContainer.h +++ b/Source/Details/Transactions/_ASAsyncTransactionContainer.h @@ -2,17 +2,9 @@ // _ASAsyncTransactionContainer.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Details/Transactions/_ASAsyncTransactionContainer.m b/Source/Details/Transactions/_ASAsyncTransactionContainer.m index 6f216145a2..4a77b06705 100644 --- a/Source/Details/Transactions/_ASAsyncTransactionContainer.m +++ b/Source/Details/Transactions/_ASAsyncTransactionContainer.m @@ -2,17 +2,9 @@ // _ASAsyncTransactionContainer.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/Transactions/_ASAsyncTransactionGroup.h b/Source/Details/Transactions/_ASAsyncTransactionGroup.h index b6aeafc3b6..cd0b216c06 100644 --- a/Source/Details/Transactions/_ASAsyncTransactionGroup.h +++ b/Source/Details/Transactions/_ASAsyncTransactionGroup.h @@ -2,17 +2,9 @@ // _ASAsyncTransactionGroup.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/Transactions/_ASAsyncTransactionGroup.m b/Source/Details/Transactions/_ASAsyncTransactionGroup.m index dd2f04be27..f9b1b9e017 100644 --- a/Source/Details/Transactions/_ASAsyncTransactionGroup.m +++ b/Source/Details/Transactions/_ASAsyncTransactionGroup.m @@ -2,17 +2,9 @@ // _ASAsyncTransactionGroup.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/UICollectionViewLayout+ASConvenience.h b/Source/Details/UICollectionViewLayout+ASConvenience.h index ae5d9e5247..78e55a17bd 100644 --- a/Source/Details/UICollectionViewLayout+ASConvenience.h +++ b/Source/Details/UICollectionViewLayout+ASConvenience.h @@ -2,17 +2,9 @@ // UICollectionViewLayout+ASConvenience.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/UICollectionViewLayout+ASConvenience.m b/Source/Details/UICollectionViewLayout+ASConvenience.m index 7053727f03..16a5054820 100644 --- a/Source/Details/UICollectionViewLayout+ASConvenience.m +++ b/Source/Details/UICollectionViewLayout+ASConvenience.m @@ -2,17 +2,9 @@ // UICollectionViewLayout+ASConvenience.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/UIView+ASConvenience.h b/Source/Details/UIView+ASConvenience.h index 9d9f64ae33..30d58a07a0 100644 --- a/Source/Details/UIView+ASConvenience.h +++ b/Source/Details/UIView+ASConvenience.h @@ -2,17 +2,9 @@ // UIView+ASConvenience.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASCollectionReusableView.h b/Source/Details/_ASCollectionReusableView.h index 6569f4b93a..fdef359524 100644 --- a/Source/Details/_ASCollectionReusableView.h +++ b/Source/Details/_ASCollectionReusableView.h @@ -2,17 +2,9 @@ // _ASCollectionReusableView.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASCollectionReusableView.m b/Source/Details/_ASCollectionReusableView.m index 4929866d49..2576edae36 100644 --- a/Source/Details/_ASCollectionReusableView.m +++ b/Source/Details/_ASCollectionReusableView.m @@ -2,17 +2,9 @@ // _ASCollectionReusableView.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "_ASCollectionReusableView.h" diff --git a/Source/Details/_ASCollectionViewCell.h b/Source/Details/_ASCollectionViewCell.h index 47e5bbea2c..94672a9625 100644 --- a/Source/Details/_ASCollectionViewCell.h +++ b/Source/Details/_ASCollectionViewCell.h @@ -2,17 +2,9 @@ // _ASCollectionViewCell.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASCollectionViewCell.m b/Source/Details/_ASCollectionViewCell.m index b9165d5aa4..837069e1be 100644 --- a/Source/Details/_ASCollectionViewCell.m +++ b/Source/Details/_ASCollectionViewCell.m @@ -2,17 +2,9 @@ // _ASCollectionViewCell.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "_ASCollectionViewCell.h" diff --git a/Source/Details/_ASDisplayLayer.h b/Source/Details/_ASDisplayLayer.h index 1fbeede745..e69ab71fd0 100644 --- a/Source/Details/_ASDisplayLayer.h +++ b/Source/Details/_ASDisplayLayer.h @@ -2,17 +2,9 @@ // _ASDisplayLayer.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASDisplayLayer.mm b/Source/Details/_ASDisplayLayer.mm index ba8b02ab4f..96eda9e1ff 100644 --- a/Source/Details/_ASDisplayLayer.mm +++ b/Source/Details/_ASDisplayLayer.mm @@ -2,17 +2,9 @@ // _ASDisplayLayer.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASDisplayView.h b/Source/Details/_ASDisplayView.h index 36f3a00d6d..519fde85fa 100644 --- a/Source/Details/_ASDisplayView.h +++ b/Source/Details/_ASDisplayView.h @@ -2,17 +2,9 @@ // _ASDisplayView.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASDisplayView.mm b/Source/Details/_ASDisplayView.mm index 92907152a2..1cc3695c70 100644 --- a/Source/Details/_ASDisplayView.mm +++ b/Source/Details/_ASDisplayView.mm @@ -2,17 +2,9 @@ // _ASDisplayView.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASDisplayViewAccessiblity.h b/Source/Details/_ASDisplayViewAccessiblity.h index d697943282..9d0bf0719a 100644 --- a/Source/Details/_ASDisplayViewAccessiblity.h +++ b/Source/Details/_ASDisplayViewAccessiblity.h @@ -2,17 +2,9 @@ // _ASDisplayViewAccessiblity.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Details/_ASDisplayViewAccessiblity.mm b/Source/Details/_ASDisplayViewAccessiblity.mm index ff812e4ea2..284eacb3ae 100644 --- a/Source/Details/_ASDisplayViewAccessiblity.mm +++ b/Source/Details/_ASDisplayViewAccessiblity.mm @@ -2,17 +2,9 @@ // _ASDisplayViewAccessiblity.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #ifndef ASDK_ACCESSIBILITY_DISABLE diff --git a/Source/IGListAdapter+AsyncDisplayKit.h b/Source/IGListAdapter+AsyncDisplayKit.h index b5de9a7901..76b53c1933 100644 --- a/Source/IGListAdapter+AsyncDisplayKit.h +++ b/Source/IGListAdapter+AsyncDisplayKit.h @@ -2,17 +2,9 @@ // IGListAdapter+AsyncDisplayKit.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/IGListAdapter+AsyncDisplayKit.m b/Source/IGListAdapter+AsyncDisplayKit.m index 8f64ee0358..757a96d560 100644 --- a/Source/IGListAdapter+AsyncDisplayKit.m +++ b/Source/IGListAdapter+AsyncDisplayKit.m @@ -2,17 +2,9 @@ // IGListAdapter+AsyncDisplayKit.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASAbsoluteLayoutElement.h b/Source/Layout/ASAbsoluteLayoutElement.h index e2227ecbbd..109816de20 100644 --- a/Source/Layout/ASAbsoluteLayoutElement.h +++ b/Source/Layout/ASAbsoluteLayoutElement.h @@ -2,17 +2,9 @@ // ASAbsoluteLayoutElement.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASAbsoluteLayoutSpec.h b/Source/Layout/ASAbsoluteLayoutSpec.h index b518af4d0a..61bfbf8cd5 100644 --- a/Source/Layout/ASAbsoluteLayoutSpec.h +++ b/Source/Layout/ASAbsoluteLayoutSpec.h @@ -2,17 +2,9 @@ // ASAbsoluteLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASAbsoluteLayoutSpec.mm b/Source/Layout/ASAbsoluteLayoutSpec.mm index eede9ab766..b91b5d4ef6 100644 --- a/Source/Layout/ASAbsoluteLayoutSpec.mm +++ b/Source/Layout/ASAbsoluteLayoutSpec.mm @@ -2,17 +2,9 @@ // ASAbsoluteLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASAsciiArtBoxCreator.h b/Source/Layout/ASAsciiArtBoxCreator.h index 2eca66e52a..83c7bec414 100644 --- a/Source/Layout/ASAsciiArtBoxCreator.h +++ b/Source/Layout/ASAsciiArtBoxCreator.h @@ -2,17 +2,9 @@ // ASAsciiArtBoxCreator.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASAsciiArtBoxCreator.m b/Source/Layout/ASAsciiArtBoxCreator.m index e018978bd1..5b2488648e 100644 --- a/Source/Layout/ASAsciiArtBoxCreator.m +++ b/Source/Layout/ASAsciiArtBoxCreator.m @@ -2,17 +2,9 @@ // ASAsciiArtBoxCreator.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASBackgroundLayoutSpec.h b/Source/Layout/ASBackgroundLayoutSpec.h index 883a9256bf..032a240bbd 100644 --- a/Source/Layout/ASBackgroundLayoutSpec.h +++ b/Source/Layout/ASBackgroundLayoutSpec.h @@ -2,17 +2,9 @@ // ASBackgroundLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASBackgroundLayoutSpec.mm b/Source/Layout/ASBackgroundLayoutSpec.mm index 1cdf270a75..7f969215c0 100644 --- a/Source/Layout/ASBackgroundLayoutSpec.mm +++ b/Source/Layout/ASBackgroundLayoutSpec.mm @@ -2,17 +2,9 @@ // ASBackgroundLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASCenterLayoutSpec.h b/Source/Layout/ASCenterLayoutSpec.h index 132bd5edc7..dd1f99aa5a 100644 --- a/Source/Layout/ASCenterLayoutSpec.h +++ b/Source/Layout/ASCenterLayoutSpec.h @@ -2,17 +2,9 @@ // ASCenterLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASCenterLayoutSpec.mm b/Source/Layout/ASCenterLayoutSpec.mm index 230768faa3..107f317c0c 100644 --- a/Source/Layout/ASCenterLayoutSpec.mm +++ b/Source/Layout/ASCenterLayoutSpec.mm @@ -2,17 +2,9 @@ // ASCenterLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASCornerLayoutSpec.h b/Source/Layout/ASCornerLayoutSpec.h index 0ce9f3cee2..799c9c28c3 100644 --- a/Source/Layout/ASCornerLayoutSpec.h +++ b/Source/Layout/ASCornerLayoutSpec.h @@ -2,12 +2,8 @@ // ASCornerLayoutSpec.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASCornerLayoutSpec.mm b/Source/Layout/ASCornerLayoutSpec.mm index d2b88c70b9..6663b28935 100644 --- a/Source/Layout/ASCornerLayoutSpec.mm +++ b/Source/Layout/ASCornerLayoutSpec.mm @@ -2,12 +2,8 @@ // ASCornerLayoutSpec.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASDimension.h b/Source/Layout/ASDimension.h index 462406eedb..0cad40d278 100644 --- a/Source/Layout/ASDimension.h +++ b/Source/Layout/ASDimension.h @@ -2,17 +2,9 @@ // ASDimension.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Layout/ASDimension.mm b/Source/Layout/ASDimension.mm index 4fd0e18001..4f581d7efd 100644 --- a/Source/Layout/ASDimension.mm +++ b/Source/Layout/ASDimension.mm @@ -2,17 +2,9 @@ // ASDimension.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASDimensionInternal.h b/Source/Layout/ASDimensionInternal.h index c853f425b2..df8f05600c 100644 --- a/Source/Layout/ASDimensionInternal.h +++ b/Source/Layout/ASDimensionInternal.h @@ -2,17 +2,9 @@ // ASDimensionInternal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASDimensionInternal.mm b/Source/Layout/ASDimensionInternal.mm index 1774a99367..8af3555252 100644 --- a/Source/Layout/ASDimensionInternal.mm +++ b/Source/Layout/ASDimensionInternal.mm @@ -2,17 +2,9 @@ // ASDimensionInternal.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASInsetLayoutSpec.h b/Source/Layout/ASInsetLayoutSpec.h index a4bee3a764..8e22fe9bd2 100644 --- a/Source/Layout/ASInsetLayoutSpec.h +++ b/Source/Layout/ASInsetLayoutSpec.h @@ -2,17 +2,9 @@ // ASInsetLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASInsetLayoutSpec.mm b/Source/Layout/ASInsetLayoutSpec.mm index 23e0feace5..450480f1c4 100644 --- a/Source/Layout/ASInsetLayoutSpec.mm +++ b/Source/Layout/ASInsetLayoutSpec.mm @@ -2,17 +2,9 @@ // ASInsetLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayout+IGListKit.h b/Source/Layout/ASLayout+IGListKit.h index 65c45a0298..6f6753da2c 100644 --- a/Source/Layout/ASLayout+IGListKit.h +++ b/Source/Layout/ASLayout+IGListKit.h @@ -1,13 +1,9 @@ // -// ASLayout+IGListKit.mm +// ASLayout+IGListKit.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #if AS_IG_LIST_KIT diff --git a/Source/Layout/ASLayout+IGListKit.mm b/Source/Layout/ASLayout+IGListKit.mm index 438689153e..f9cc139e9c 100644 --- a/Source/Layout/ASLayout+IGListKit.mm +++ b/Source/Layout/ASLayout+IGListKit.mm @@ -2,12 +2,8 @@ // ASLayout+IGListKit.mm // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import #if AS_IG_LIST_KIT diff --git a/Source/Layout/ASLayout.h b/Source/Layout/ASLayout.h index 886756bb43..af4ecd9847 100644 --- a/Source/Layout/ASLayout.h +++ b/Source/Layout/ASLayout.h @@ -2,17 +2,9 @@ // ASLayout.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 21c94fb114..1c83433886 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -2,17 +2,9 @@ // ASLayout.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutElement.h b/Source/Layout/ASLayoutElement.h index 417550aa01..c4ba689cfc 100644 --- a/Source/Layout/ASLayoutElement.h +++ b/Source/Layout/ASLayoutElement.h @@ -2,17 +2,9 @@ // ASLayoutElement.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutElement.mm b/Source/Layout/ASLayoutElement.mm index bd17461a63..ace1103da1 100644 --- a/Source/Layout/ASLayoutElement.mm +++ b/Source/Layout/ASLayoutElement.mm @@ -2,17 +2,9 @@ // ASLayoutElement.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutElementExtensibility.h b/Source/Layout/ASLayoutElementExtensibility.h index 1afddd9c91..f46b63e812 100644 --- a/Source/Layout/ASLayoutElementExtensibility.h +++ b/Source/Layout/ASLayoutElementExtensibility.h @@ -2,17 +2,9 @@ // ASLayoutElementExtensibility.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutElementPrivate.h b/Source/Layout/ASLayoutElementPrivate.h index 263b2f84de..cf699f42a2 100644 --- a/Source/Layout/ASLayoutElementPrivate.h +++ b/Source/Layout/ASLayoutElementPrivate.h @@ -2,17 +2,9 @@ // ASLayoutElementPrivate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutSpec+Subclasses.h b/Source/Layout/ASLayoutSpec+Subclasses.h index 17ddc20bdc..34bf6e069f 100644 --- a/Source/Layout/ASLayoutSpec+Subclasses.h +++ b/Source/Layout/ASLayoutSpec+Subclasses.h @@ -2,17 +2,9 @@ // ASLayoutSpec+Subclasses.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutSpec+Subclasses.mm b/Source/Layout/ASLayoutSpec+Subclasses.mm index 9e98806152..17ff53e6c5 100644 --- a/Source/Layout/ASLayoutSpec+Subclasses.mm +++ b/Source/Layout/ASLayoutSpec+Subclasses.mm @@ -2,17 +2,9 @@ // ASLayoutSpec+Subclasses.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutSpec.h b/Source/Layout/ASLayoutSpec.h index 7bc7f3ef4c..c7aa01c386 100644 --- a/Source/Layout/ASLayoutSpec.h +++ b/Source/Layout/ASLayoutSpec.h @@ -2,17 +2,9 @@ // ASLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASLayoutSpec.mm b/Source/Layout/ASLayoutSpec.mm index 010eee43e7..4bebb094b5 100644 --- a/Source/Layout/ASLayoutSpec.mm +++ b/Source/Layout/ASLayoutSpec.mm @@ -2,17 +2,9 @@ // ASLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASOverlayLayoutSpec.h b/Source/Layout/ASOverlayLayoutSpec.h index b40c9d4e02..a29a72b750 100644 --- a/Source/Layout/ASOverlayLayoutSpec.h +++ b/Source/Layout/ASOverlayLayoutSpec.h @@ -2,17 +2,9 @@ // ASOverlayLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASOverlayLayoutSpec.mm b/Source/Layout/ASOverlayLayoutSpec.mm index 77f8239da9..84ca72a9c3 100644 --- a/Source/Layout/ASOverlayLayoutSpec.mm +++ b/Source/Layout/ASOverlayLayoutSpec.mm @@ -2,17 +2,9 @@ // ASOverlayLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASRatioLayoutSpec.h b/Source/Layout/ASRatioLayoutSpec.h index bc3e6edbec..b70e6fe7fb 100644 --- a/Source/Layout/ASRatioLayoutSpec.h +++ b/Source/Layout/ASRatioLayoutSpec.h @@ -2,17 +2,9 @@ // ASRatioLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASRatioLayoutSpec.mm b/Source/Layout/ASRatioLayoutSpec.mm index 194eed20c3..38987402c4 100644 --- a/Source/Layout/ASRatioLayoutSpec.mm +++ b/Source/Layout/ASRatioLayoutSpec.mm @@ -2,17 +2,9 @@ // ASRatioLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASRelativeLayoutSpec.h b/Source/Layout/ASRelativeLayoutSpec.h index a4f7774b47..9b260d9ccc 100644 --- a/Source/Layout/ASRelativeLayoutSpec.h +++ b/Source/Layout/ASRelativeLayoutSpec.h @@ -2,17 +2,9 @@ // ASRelativeLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASRelativeLayoutSpec.mm b/Source/Layout/ASRelativeLayoutSpec.mm index b14795d27f..f096ce51d4 100644 --- a/Source/Layout/ASRelativeLayoutSpec.mm +++ b/Source/Layout/ASRelativeLayoutSpec.mm @@ -2,17 +2,9 @@ // ASRelativeLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASStackLayoutDefines.h b/Source/Layout/ASStackLayoutDefines.h index 8490a5389a..8a86be1b5a 100644 --- a/Source/Layout/ASStackLayoutDefines.h +++ b/Source/Layout/ASStackLayoutDefines.h @@ -2,17 +2,9 @@ // ASStackLayoutDefines.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASStackLayoutElement.h b/Source/Layout/ASStackLayoutElement.h index 9288b71b7b..46b263b4ff 100644 --- a/Source/Layout/ASStackLayoutElement.h +++ b/Source/Layout/ASStackLayoutElement.h @@ -2,17 +2,9 @@ // ASStackLayoutElement.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASStackLayoutSpec.h b/Source/Layout/ASStackLayoutSpec.h index 65788a2f5a..535758ac7b 100644 --- a/Source/Layout/ASStackLayoutSpec.h +++ b/Source/Layout/ASStackLayoutSpec.h @@ -2,17 +2,9 @@ // ASStackLayoutSpec.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASStackLayoutSpec.mm b/Source/Layout/ASStackLayoutSpec.mm index f7ace8cd1e..1cf9ce3d0e 100644 --- a/Source/Layout/ASStackLayoutSpec.mm +++ b/Source/Layout/ASStackLayoutSpec.mm @@ -2,17 +2,9 @@ // ASStackLayoutSpec.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASYogaUtilities.h b/Source/Layout/ASYogaUtilities.h index aac1eaf240..cad80ecb0f 100644 --- a/Source/Layout/ASYogaUtilities.h +++ b/Source/Layout/ASYogaUtilities.h @@ -2,12 +2,8 @@ // ASYogaUtilities.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Layout/ASYogaUtilities.mm b/Source/Layout/ASYogaUtilities.mm index 47a6119a8a..2cca2307c3 100644 --- a/Source/Layout/ASYogaUtilities.mm +++ b/Source/Layout/ASYogaUtilities.mm @@ -2,12 +2,8 @@ // ASYogaUtilities.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASBasicImageDownloaderInternal.h b/Source/Private/ASBasicImageDownloaderInternal.h index 6d9fb5b61a..ba06e0bc81 100644 --- a/Source/Private/ASBasicImageDownloaderInternal.h +++ b/Source/Private/ASBasicImageDownloaderInternal.h @@ -2,17 +2,9 @@ // ASBasicImageDownloaderInternal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @interface ASBasicImageDownloaderContext : NSObject diff --git a/Source/Private/ASBatchFetching.h b/Source/Private/ASBatchFetching.h index 39d18353da..15d5a98c33 100644 --- a/Source/Private/ASBatchFetching.h +++ b/Source/Private/ASBatchFetching.h @@ -2,17 +2,9 @@ // ASBatchFetching.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASBatchFetching.m b/Source/Private/ASBatchFetching.m index e983ac49f8..9ca28cb752 100644 --- a/Source/Private/ASBatchFetching.m +++ b/Source/Private/ASBatchFetching.m @@ -2,17 +2,9 @@ // ASBatchFetching.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCellNode+Internal.h b/Source/Private/ASCellNode+Internal.h index a33147809f..f18101f400 100644 --- a/Source/Private/ASCellNode+Internal.h +++ b/Source/Private/ASCellNode+Internal.h @@ -2,17 +2,9 @@ // ASCellNode+Internal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayout.h b/Source/Private/ASCollectionLayout.h index 1c4d156325..c31114e691 100644 --- a/Source/Private/ASCollectionLayout.h +++ b/Source/Private/ASCollectionLayout.h @@ -2,12 +2,8 @@ // ASCollectionLayout.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayout.mm b/Source/Private/ASCollectionLayout.mm index eafc445a85..d6b27b1782 100644 --- a/Source/Private/ASCollectionLayout.mm +++ b/Source/Private/ASCollectionLayout.mm @@ -2,17 +2,9 @@ // ASCollectionLayout.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutCache.h b/Source/Private/ASCollectionLayoutCache.h index 1bf336b610..3efad85d77 100644 --- a/Source/Private/ASCollectionLayoutCache.h +++ b/Source/Private/ASCollectionLayoutCache.h @@ -2,12 +2,8 @@ // ASCollectionLayoutCache.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutCache.mm b/Source/Private/ASCollectionLayoutCache.mm index 102f516188..d67e3636d0 100644 --- a/Source/Private/ASCollectionLayoutCache.mm +++ b/Source/Private/ASCollectionLayoutCache.mm @@ -2,12 +2,8 @@ // ASCollectionLayoutCache.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutContext+Private.h b/Source/Private/ASCollectionLayoutContext+Private.h index 9cdffadef8..12e1d9db8c 100644 --- a/Source/Private/ASCollectionLayoutContext+Private.h +++ b/Source/Private/ASCollectionLayoutContext+Private.h @@ -2,17 +2,9 @@ // ASCollectionLayoutContext+Private.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutDefines.h b/Source/Private/ASCollectionLayoutDefines.h index 3c05cae4ae..61a8ac4e88 100644 --- a/Source/Private/ASCollectionLayoutDefines.h +++ b/Source/Private/ASCollectionLayoutDefines.h @@ -2,12 +2,8 @@ // ASCollectionLayoutDefines.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutDefines.m b/Source/Private/ASCollectionLayoutDefines.m index ba1abb0b8f..0087af536a 100644 --- a/Source/Private/ASCollectionLayoutDefines.m +++ b/Source/Private/ASCollectionLayoutDefines.m @@ -2,12 +2,8 @@ // ASCollectionLayoutDefines.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionLayoutState+Private.h b/Source/Private/ASCollectionLayoutState+Private.h index 97304b4afb..c964cf392b 100644 --- a/Source/Private/ASCollectionLayoutState+Private.h +++ b/Source/Private/ASCollectionLayoutState+Private.h @@ -2,12 +2,8 @@ // ASCollectionLayoutState+Private.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionView+Undeprecated.h b/Source/Private/ASCollectionView+Undeprecated.h index 99814bdf0b..0a9e0d9689 100644 --- a/Source/Private/ASCollectionView+Undeprecated.h +++ b/Source/Private/ASCollectionView+Undeprecated.h @@ -2,17 +2,9 @@ // ASCollectionView+Undeprecated.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionViewFlowLayoutInspector.h b/Source/Private/ASCollectionViewFlowLayoutInspector.h index 185f80ca58..0272da1550 100644 --- a/Source/Private/ASCollectionViewFlowLayoutInspector.h +++ b/Source/Private/ASCollectionViewFlowLayoutInspector.h @@ -2,17 +2,9 @@ // ASCollectionViewFlowLayoutInspector.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASCollectionViewFlowLayoutInspector.m b/Source/Private/ASCollectionViewFlowLayoutInspector.m index d206663ae6..b36e188268 100644 --- a/Source/Private/ASCollectionViewFlowLayoutInspector.m +++ b/Source/Private/ASCollectionViewFlowLayoutInspector.m @@ -2,17 +2,9 @@ // ASCollectionViewFlowLayoutInspector.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASControlNode+Private.h b/Source/Private/ASControlNode+Private.h index f3249c11c9..02f54a20ec 100644 --- a/Source/Private/ASControlNode+Private.h +++ b/Source/Private/ASControlNode+Private.h @@ -2,17 +2,9 @@ // ASControlNode+Private.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASControlTargetAction.h b/Source/Private/ASControlTargetAction.h index 6ec5be8896..5a3595c5d3 100644 --- a/Source/Private/ASControlTargetAction.h +++ b/Source/Private/ASControlTargetAction.h @@ -2,17 +2,9 @@ // ASControlTargetAction.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASControlTargetAction.m b/Source/Private/ASControlTargetAction.m index d3e18fb558..ea822db2fc 100644 --- a/Source/Private/ASControlTargetAction.m +++ b/Source/Private/ASControlTargetAction.m @@ -2,17 +2,9 @@ // ASControlTargetAction.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDefaultPlayButton.h b/Source/Private/ASDefaultPlayButton.h index 3295fc2bbd..e3bc15246d 100644 --- a/Source/Private/ASDefaultPlayButton.h +++ b/Source/Private/ASDefaultPlayButton.h @@ -2,17 +2,9 @@ // ASDefaultPlayButton.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDefaultPlayButton.m b/Source/Private/ASDefaultPlayButton.m index 4cef2b35f3..133db9a7e2 100644 --- a/Source/Private/ASDefaultPlayButton.m +++ b/Source/Private/ASDefaultPlayButton.m @@ -2,17 +2,9 @@ // ASDefaultPlayButton.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDefaultPlaybackButton.h b/Source/Private/ASDefaultPlaybackButton.h index 869d9cd3ea..ae7e245dc0 100644 --- a/Source/Private/ASDefaultPlaybackButton.h +++ b/Source/Private/ASDefaultPlaybackButton.h @@ -2,17 +2,9 @@ // ASDefaultPlaybackButton.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDefaultPlaybackButton.m b/Source/Private/ASDefaultPlaybackButton.m index bb5c8f539e..ecc276069c 100644 --- a/Source/Private/ASDefaultPlaybackButton.m +++ b/Source/Private/ASDefaultPlaybackButton.m @@ -2,17 +2,9 @@ // ASDefaultPlaybackButton.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDispatch.h b/Source/Private/ASDispatch.h index 22893aba09..e20941806f 100644 --- a/Source/Private/ASDispatch.h +++ b/Source/Private/ASDispatch.h @@ -2,17 +2,9 @@ // ASDispatch.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDispatch.m b/Source/Private/ASDispatch.m index 14c60eb6d3..f73281dfda 100644 --- a/Source/Private/ASDispatch.m +++ b/Source/Private/ASDispatch.m @@ -2,12 +2,8 @@ // ASDispatch.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNode+AsyncDisplay.mm b/Source/Private/ASDisplayNode+AsyncDisplay.mm index 2cf772aecf..d473780e4f 100644 --- a/Source/Private/ASDisplayNode+AsyncDisplay.mm +++ b/Source/Private/ASDisplayNode+AsyncDisplay.mm @@ -2,17 +2,9 @@ // ASDisplayNode+AsyncDisplay.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNode+DebugTiming.h b/Source/Private/ASDisplayNode+DebugTiming.h index e8f9c42a9b..f6935224a9 100644 --- a/Source/Private/ASDisplayNode+DebugTiming.h +++ b/Source/Private/ASDisplayNode+DebugTiming.h @@ -2,17 +2,9 @@ // ASDisplayNode+DebugTiming.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNode+DebugTiming.mm b/Source/Private/ASDisplayNode+DebugTiming.mm index 39620295bb..d9311a10d9 100644 --- a/Source/Private/ASDisplayNode+DebugTiming.mm +++ b/Source/Private/ASDisplayNode+DebugTiming.mm @@ -2,17 +2,9 @@ // ASDisplayNode+DebugTiming.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNode+FrameworkPrivate.h b/Source/Private/ASDisplayNode+FrameworkPrivate.h index 95a1e8dc35..3f5ca1dde5 100644 --- a/Source/Private/ASDisplayNode+FrameworkPrivate.h +++ b/Source/Private/ASDisplayNode+FrameworkPrivate.h @@ -2,17 +2,9 @@ // ASDisplayNode+FrameworkPrivate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // // diff --git a/Source/Private/ASDisplayNode+UIViewBridge.mm b/Source/Private/ASDisplayNode+UIViewBridge.mm index 4a597b0dce..acb821801e 100644 --- a/Source/Private/ASDisplayNode+UIViewBridge.mm +++ b/Source/Private/ASDisplayNode+UIViewBridge.mm @@ -2,17 +2,9 @@ // ASDisplayNode+UIViewBridge.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNodeCornerLayerDelegate.h b/Source/Private/ASDisplayNodeCornerLayerDelegate.h index f1f0fb9b35..cb95e9fbf6 100644 --- a/Source/Private/ASDisplayNodeCornerLayerDelegate.h +++ b/Source/Private/ASDisplayNodeCornerLayerDelegate.h @@ -2,17 +2,9 @@ // ASDisplayNodeCornerLayerDelegate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNodeCornerLayerDelegate.m b/Source/Private/ASDisplayNodeCornerLayerDelegate.m index b01723dd47..8973570224 100644 --- a/Source/Private/ASDisplayNodeCornerLayerDelegate.m +++ b/Source/Private/ASDisplayNodeCornerLayerDelegate.m @@ -2,17 +2,9 @@ // ASDisplayNodeCornerLayerDelegate.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASDisplayNodeCornerLayerDelegate.h" diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 9275137549..1844796941 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -2,17 +2,9 @@ // ASDisplayNodeInternal.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // // diff --git a/Source/Private/ASDisplayNodeLayout.h b/Source/Private/ASDisplayNodeLayout.h index 45d15230a0..272e10776d 100644 --- a/Source/Private/ASDisplayNodeLayout.h +++ b/Source/Private/ASDisplayNodeLayout.h @@ -2,17 +2,9 @@ // ASDisplayNodeLayout.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Private/ASDisplayNodeLayout.mm b/Source/Private/ASDisplayNodeLayout.mm index 15d51fd490..6dc433d51c 100644 --- a/Source/Private/ASDisplayNodeLayout.mm +++ b/Source/Private/ASDisplayNodeLayout.mm @@ -2,17 +2,9 @@ // ASDisplayNodeLayout.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNodeTipState.h b/Source/Private/ASDisplayNodeTipState.h index 7b195934dc..1e1ef20726 100644 --- a/Source/Private/ASDisplayNodeTipState.h +++ b/Source/Private/ASDisplayNodeTipState.h @@ -2,17 +2,9 @@ // ASDisplayNodeTipState.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASDisplayNodeTipState.m b/Source/Private/ASDisplayNodeTipState.m index 430dce5d36..8050d27346 100644 --- a/Source/Private/ASDisplayNodeTipState.m +++ b/Source/Private/ASDisplayNodeTipState.m @@ -2,17 +2,9 @@ // ASDisplayNodeTipState.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASDisplayNodeTipState.h" diff --git a/Source/Private/ASIGListAdapterBasedDataSource.h b/Source/Private/ASIGListAdapterBasedDataSource.h index c46eca4b55..44380bc070 100644 --- a/Source/Private/ASIGListAdapterBasedDataSource.h +++ b/Source/Private/ASIGListAdapterBasedDataSource.h @@ -2,17 +2,9 @@ // ASIGListAdapterBasedDataSource.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASIGListAdapterBasedDataSource.m b/Source/Private/ASIGListAdapterBasedDataSource.m index dc63e53b78..a489acf950 100644 --- a/Source/Private/ASIGListAdapterBasedDataSource.m +++ b/Source/Private/ASIGListAdapterBasedDataSource.m @@ -2,17 +2,9 @@ // ASIGListAdapterBasedDataSource.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASImageNode+AnimatedImagePrivate.h b/Source/Private/ASImageNode+AnimatedImagePrivate.h index c6a2f1771f..1ecfbf2856 100644 --- a/Source/Private/ASImageNode+AnimatedImagePrivate.h +++ b/Source/Private/ASImageNode+AnimatedImagePrivate.h @@ -2,17 +2,9 @@ // ASImageNode+AnimatedImagePrivate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASImageNode+CGExtras.h b/Source/Private/ASImageNode+CGExtras.h index 187f4833b4..01b546443b 100644 --- a/Source/Private/ASImageNode+CGExtras.h +++ b/Source/Private/ASImageNode+CGExtras.h @@ -2,17 +2,9 @@ // ASImageNode+CGExtras.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASImageNode+CGExtras.m b/Source/Private/ASImageNode+CGExtras.m index f8c118ea05..acbd6857e1 100644 --- a/Source/Private/ASImageNode+CGExtras.m +++ b/Source/Private/ASImageNode+CGExtras.m @@ -2,17 +2,9 @@ // ASImageNode+CGExtras.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASImageNode+Private.h b/Source/Private/ASImageNode+Private.h index a4fbfcd62c..8de78c8784 100644 --- a/Source/Private/ASImageNode+Private.h +++ b/Source/Private/ASImageNode+Private.h @@ -2,17 +2,9 @@ // ASImageNode+Private.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Private/ASInternalHelpers.h b/Source/Private/ASInternalHelpers.h index 537ba4a619..e6d3811c79 100644 --- a/Source/Private/ASInternalHelpers.h +++ b/Source/Private/ASInternalHelpers.h @@ -2,17 +2,9 @@ // ASInternalHelpers.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASAvailability.h" diff --git a/Source/Private/ASInternalHelpers.m b/Source/Private/ASInternalHelpers.m index d34f15d352..3dd8f0c57b 100644 --- a/Source/Private/ASInternalHelpers.m +++ b/Source/Private/ASInternalHelpers.m @@ -2,17 +2,9 @@ // ASInternalHelpers.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASLayerBackingTipProvider.h b/Source/Private/ASLayerBackingTipProvider.h index f2be45eb44..0cc3d03b61 100644 --- a/Source/Private/ASLayerBackingTipProvider.h +++ b/Source/Private/ASLayerBackingTipProvider.h @@ -2,17 +2,9 @@ // ASLayerBackingTipProvider.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTipProvider.h" diff --git a/Source/Private/ASLayerBackingTipProvider.m b/Source/Private/ASLayerBackingTipProvider.m index c2d0f5aa22..9a5932faa8 100644 --- a/Source/Private/ASLayerBackingTipProvider.m +++ b/Source/Private/ASLayerBackingTipProvider.m @@ -2,17 +2,9 @@ // ASLayerBackingTipProvider.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayerBackingTipProvider.h" diff --git a/Source/Private/ASLayoutTransition.h b/Source/Private/ASLayoutTransition.h index 91007800d4..6be60836e5 100644 --- a/Source/Private/ASLayoutTransition.h +++ b/Source/Private/ASLayoutTransition.h @@ -2,17 +2,9 @@ // ASLayoutTransition.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index a50e9eda8a..32eaa3229e 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -2,17 +2,9 @@ // ASLayoutTransition.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASMutableElementMap.h b/Source/Private/ASMutableElementMap.h index a4c3b3e025..1ca182931f 100644 --- a/Source/Private/ASMutableElementMap.h +++ b/Source/Private/ASMutableElementMap.h @@ -2,17 +2,9 @@ // ASMutableElementMap.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASMutableElementMap.m b/Source/Private/ASMutableElementMap.m index a5b40d0518..97cfe34d41 100644 --- a/Source/Private/ASMutableElementMap.m +++ b/Source/Private/ASMutableElementMap.m @@ -2,17 +2,9 @@ // ASMutableElementMap.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASMutableElementMap.h" diff --git a/Source/Private/ASNetworkImageLoadInfo+Private.h b/Source/Private/ASNetworkImageLoadInfo+Private.h index a77d48af6a..36e423b535 100644 --- a/Source/Private/ASNetworkImageLoadInfo+Private.h +++ b/Source/Private/ASNetworkImageLoadInfo+Private.h @@ -2,12 +2,8 @@ // ASNetworkImageLoadInfo+Private.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASPendingStateController.h b/Source/Private/ASPendingStateController.h index 259bf75c7c..b50a7c1f94 100644 --- a/Source/Private/ASPendingStateController.h +++ b/Source/Private/ASPendingStateController.h @@ -2,17 +2,9 @@ // ASPendingStateController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASPendingStateController.mm b/Source/Private/ASPendingStateController.mm index 187078d14b..89dedfa597 100644 --- a/Source/Private/ASPendingStateController.mm +++ b/Source/Private/ASPendingStateController.mm @@ -2,17 +2,9 @@ // ASPendingStateController.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASRectMap.h b/Source/Private/ASRectMap.h index e4b05d7cb0..88e8c8a2de 100644 --- a/Source/Private/ASRectMap.h +++ b/Source/Private/ASRectMap.h @@ -2,12 +2,8 @@ // ASRectMap.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASRectMap.mm b/Source/Private/ASRectMap.mm index 14c3754808..ed7b82ba0c 100644 --- a/Source/Private/ASRectMap.mm +++ b/Source/Private/ASRectMap.mm @@ -2,12 +2,8 @@ // ASRectMap.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASRectMap.h" diff --git a/Source/Private/ASResponderChainEnumerator.h b/Source/Private/ASResponderChainEnumerator.h index df548136b3..dcd2e1c4c4 100644 --- a/Source/Private/ASResponderChainEnumerator.h +++ b/Source/Private/ASResponderChainEnumerator.h @@ -2,17 +2,9 @@ // ASResponderChainEnumerator.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASResponderChainEnumerator.m b/Source/Private/ASResponderChainEnumerator.m index 35b16db0ba..a127c64c1e 100644 --- a/Source/Private/ASResponderChainEnumerator.m +++ b/Source/Private/ASResponderChainEnumerator.m @@ -2,17 +2,9 @@ // ASResponderChainEnumerator.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASResponderChainEnumerator.h" diff --git a/Source/Private/ASSection.h b/Source/Private/ASSection.h index 268a2009c9..6058ff4804 100644 --- a/Source/Private/ASSection.h +++ b/Source/Private/ASSection.h @@ -2,17 +2,9 @@ // ASSection.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASSection.m b/Source/Private/ASSection.m index bb300b6014..68b4ced300 100644 --- a/Source/Private/ASSection.m +++ b/Source/Private/ASSection.m @@ -2,17 +2,9 @@ // ASSection.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTableView+Undeprecated.h b/Source/Private/ASTableView+Undeprecated.h index 4ca5b35088..46c54368a6 100644 --- a/Source/Private/ASTableView+Undeprecated.h +++ b/Source/Private/ASTableView+Undeprecated.h @@ -2,17 +2,9 @@ // ASTableView+Undeprecated.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTip.h b/Source/Private/ASTip.h index d6aed639a9..5ac6ac18bc 100644 --- a/Source/Private/ASTip.h +++ b/Source/Private/ASTip.h @@ -2,17 +2,9 @@ // ASTip.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTip.m b/Source/Private/ASTip.m index c96723b9ab..fde1bbc587 100644 --- a/Source/Private/ASTip.m +++ b/Source/Private/ASTip.m @@ -2,17 +2,9 @@ // ASTip.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTip.h" diff --git a/Source/Private/ASTipNode.h b/Source/Private/ASTipNode.h index e5942142b2..d01637d869 100644 --- a/Source/Private/ASTipNode.h +++ b/Source/Private/ASTipNode.h @@ -2,17 +2,9 @@ // ASTipNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTipNode.m b/Source/Private/ASTipNode.m index 9eadb04691..a4fe4bf4e5 100644 --- a/Source/Private/ASTipNode.m +++ b/Source/Private/ASTipNode.m @@ -2,17 +2,9 @@ // ASTipNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTipNode.h" diff --git a/Source/Private/ASTipProvider.h b/Source/Private/ASTipProvider.h index 93855bcd8b..e2aba6c5d9 100644 --- a/Source/Private/ASTipProvider.h +++ b/Source/Private/ASTipProvider.h @@ -2,17 +2,9 @@ // ASTipProvider.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTipProvider.m b/Source/Private/ASTipProvider.m index a6a40457b9..7787997376 100644 --- a/Source/Private/ASTipProvider.m +++ b/Source/Private/ASTipProvider.m @@ -2,17 +2,9 @@ // ASTipProvider.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTipProvider.h" diff --git a/Source/Private/ASTipsController.h b/Source/Private/ASTipsController.h index 959d464384..fceeb92f60 100644 --- a/Source/Private/ASTipsController.h +++ b/Source/Private/ASTipsController.h @@ -2,17 +2,9 @@ // ASTipsController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTipsController.m b/Source/Private/ASTipsController.m index b3d67e7bb7..d12b3189bf 100644 --- a/Source/Private/ASTipsController.m +++ b/Source/Private/ASTipsController.m @@ -2,17 +2,9 @@ // ASTipsController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTipsController.h" diff --git a/Source/Private/ASTipsWindow.h b/Source/Private/ASTipsWindow.h index 339071f2f3..fab52510fc 100644 --- a/Source/Private/ASTipsWindow.h +++ b/Source/Private/ASTipsWindow.h @@ -2,17 +2,9 @@ // ASTipsWindow.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTipsWindow.m b/Source/Private/ASTipsWindow.m index 19d26edbe7..a330fc7d59 100644 --- a/Source/Private/ASTipsWindow.m +++ b/Source/Private/ASTipsWindow.m @@ -2,17 +2,9 @@ // ASTipsWindow.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTipsWindow.h" diff --git a/Source/Private/ASTwoDimensionalArrayUtils.h b/Source/Private/ASTwoDimensionalArrayUtils.h index ac9c9d92b1..6a3c9bb5ce 100644 --- a/Source/Private/ASTwoDimensionalArrayUtils.h +++ b/Source/Private/ASTwoDimensionalArrayUtils.h @@ -2,17 +2,9 @@ // ASTwoDimensionalArrayUtils.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASTwoDimensionalArrayUtils.m b/Source/Private/ASTwoDimensionalArrayUtils.m index 7b7b80431a..c9c2b658d8 100644 --- a/Source/Private/ASTwoDimensionalArrayUtils.m +++ b/Source/Private/ASTwoDimensionalArrayUtils.m @@ -2,17 +2,9 @@ // ASTwoDimensionalArrayUtils.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASWeakMap.h b/Source/Private/ASWeakMap.h index 1a0b372667..1f413ca7ae 100644 --- a/Source/Private/ASWeakMap.h +++ b/Source/Private/ASWeakMap.h @@ -2,17 +2,9 @@ // ASWeakMap.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/ASWeakMap.m b/Source/Private/ASWeakMap.m index 4ca09c953e..42f192f9c6 100644 --- a/Source/Private/ASWeakMap.m +++ b/Source/Private/ASWeakMap.m @@ -2,17 +2,9 @@ // ASWeakMap.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASLayoutElementStylePrivate.h b/Source/Private/Layout/ASLayoutElementStylePrivate.h index 55675dc1b1..375be772e9 100644 --- a/Source/Private/Layout/ASLayoutElementStylePrivate.h +++ b/Source/Private/Layout/ASLayoutElementStylePrivate.h @@ -2,17 +2,9 @@ // ASLayoutElementStylePrivate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/Private/Layout/ASLayoutSpecPrivate.h b/Source/Private/Layout/ASLayoutSpecPrivate.h index f8813afebc..0a4a39b5d5 100644 --- a/Source/Private/Layout/ASLayoutSpecPrivate.h +++ b/Source/Private/Layout/ASLayoutSpecPrivate.h @@ -2,17 +2,9 @@ // ASLayoutSpecPrivate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASLayoutSpecUtilities.h b/Source/Private/Layout/ASLayoutSpecUtilities.h index 7bef9a98d1..62a3d9177b 100644 --- a/Source/Private/Layout/ASLayoutSpecUtilities.h +++ b/Source/Private/Layout/ASLayoutSpecUtilities.h @@ -2,17 +2,9 @@ // ASLayoutSpecUtilities.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASStackLayoutSpecUtilities.h b/Source/Private/Layout/ASStackLayoutSpecUtilities.h index dbb2c74352..6c708e0408 100644 --- a/Source/Private/Layout/ASStackLayoutSpecUtilities.h +++ b/Source/Private/Layout/ASStackLayoutSpecUtilities.h @@ -2,17 +2,9 @@ // ASStackLayoutSpecUtilities.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASStackPositionedLayout.h b/Source/Private/Layout/ASStackPositionedLayout.h index c9ed7fafdf..103ec3a280 100644 --- a/Source/Private/Layout/ASStackPositionedLayout.h +++ b/Source/Private/Layout/ASStackPositionedLayout.h @@ -2,17 +2,9 @@ // ASStackPositionedLayout.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASStackPositionedLayout.mm b/Source/Private/Layout/ASStackPositionedLayout.mm index 9b1ba020a7..727db5d2dd 100644 --- a/Source/Private/Layout/ASStackPositionedLayout.mm +++ b/Source/Private/Layout/ASStackPositionedLayout.mm @@ -2,17 +2,9 @@ // ASStackPositionedLayout.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASStackUnpositionedLayout.h b/Source/Private/Layout/ASStackUnpositionedLayout.h index 4347a4b0c9..989b4c2f11 100644 --- a/Source/Private/Layout/ASStackUnpositionedLayout.h +++ b/Source/Private/Layout/ASStackUnpositionedLayout.h @@ -2,17 +2,9 @@ // ASStackUnpositionedLayout.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/Layout/ASStackUnpositionedLayout.mm b/Source/Private/Layout/ASStackUnpositionedLayout.mm index 1dff933485..47141a7f7b 100644 --- a/Source/Private/Layout/ASStackUnpositionedLayout.mm +++ b/Source/Private/Layout/ASStackUnpositionedLayout.mm @@ -2,17 +2,9 @@ // ASStackUnpositionedLayout.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextDebugOption.h b/Source/Private/TextExperiment/Component/ASTextDebugOption.h old mode 100755 new mode 100644 index c5d18d74bb..efa7808c87 --- a/Source/Private/TextExperiment/Component/ASTextDebugOption.h +++ b/Source/Private/TextExperiment/Component/ASTextDebugOption.h @@ -1,12 +1,9 @@ // // ASTextDebugOption.h -// Modified from YYText +// Texture // -// Created by ibireme on 15/4/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextDebugOption.m b/Source/Private/TextExperiment/Component/ASTextDebugOption.m old mode 100755 new mode 100644 index 2e0a706eaa..6b74b0990b --- a/Source/Private/TextExperiment/Component/ASTextDebugOption.m +++ b/Source/Private/TextExperiment/Component/ASTextDebugOption.m @@ -1,12 +1,9 @@ // // ASTextDebugOption.m -// Modified from YYText +// Texture // -// Created by ibireme on 15/4/8. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTextDebugOption.h" diff --git a/Source/Private/TextExperiment/Component/ASTextInput.h b/Source/Private/TextExperiment/Component/ASTextInput.h old mode 100755 new mode 100644 index f3bdb03d96..9a6cbd13d1 --- a/Source/Private/TextExperiment/Component/ASTextInput.h +++ b/Source/Private/TextExperiment/Component/ASTextInput.h @@ -2,17 +2,9 @@ // ASTextInput.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextInput.m b/Source/Private/TextExperiment/Component/ASTextInput.m old mode 100755 new mode 100644 index a56426b161..07bc6cb6d5 --- a/Source/Private/TextExperiment/Component/ASTextInput.m +++ b/Source/Private/TextExperiment/Component/ASTextInput.m @@ -2,17 +2,9 @@ // ASTextInput.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.h b/Source/Private/TextExperiment/Component/ASTextLayout.h old mode 100755 new mode 100644 index c78f4271f3..46bc8ccf52 --- a/Source/Private/TextExperiment/Component/ASTextLayout.h +++ b/Source/Private/TextExperiment/Component/ASTextLayout.h @@ -2,17 +2,9 @@ // ASTextLayout.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextLayout.m b/Source/Private/TextExperiment/Component/ASTextLayout.m old mode 100755 new mode 100644 index 4b3ba691f8..5c0b0cda53 --- a/Source/Private/TextExperiment/Component/ASTextLayout.m +++ b/Source/Private/TextExperiment/Component/ASTextLayout.m @@ -2,17 +2,9 @@ // ASTextLayout.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextLine.h b/Source/Private/TextExperiment/Component/ASTextLine.h old mode 100755 new mode 100644 index af0a394ebf..acb02e991b --- a/Source/Private/TextExperiment/Component/ASTextLine.h +++ b/Source/Private/TextExperiment/Component/ASTextLine.h @@ -2,17 +2,9 @@ // ASTextLine.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Component/ASTextLine.m b/Source/Private/TextExperiment/Component/ASTextLine.m old mode 100755 new mode 100644 index e1adec8fe8..672b18c7a9 --- a/Source/Private/TextExperiment/Component/ASTextLine.m +++ b/Source/Private/TextExperiment/Component/ASTextLine.m @@ -2,17 +2,9 @@ // ASTextLine.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/String/ASTextAttribute.h b/Source/Private/TextExperiment/String/ASTextAttribute.h old mode 100755 new mode 100644 index 49e868131b..2d9e3771a0 --- a/Source/Private/TextExperiment/String/ASTextAttribute.h +++ b/Source/Private/TextExperiment/String/ASTextAttribute.h @@ -2,17 +2,9 @@ // ASTextAttribute.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/String/ASTextAttribute.m b/Source/Private/TextExperiment/String/ASTextAttribute.m old mode 100755 new mode 100644 index f5bb64224c..fb4b01b6f2 --- a/Source/Private/TextExperiment/String/ASTextAttribute.m +++ b/Source/Private/TextExperiment/String/ASTextAttribute.m @@ -2,17 +2,9 @@ // ASTextAttribute.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTextAttribute.h" diff --git a/Source/Private/TextExperiment/String/ASTextRunDelegate.h b/Source/Private/TextExperiment/String/ASTextRunDelegate.h old mode 100755 new mode 100644 index 62683420b5..3d3bf11c2c --- a/Source/Private/TextExperiment/String/ASTextRunDelegate.h +++ b/Source/Private/TextExperiment/String/ASTextRunDelegate.h @@ -1,12 +1,9 @@ // // ASTextRunDelegate.h -// ASText +// Texture // -// Created by ibireme on 14/10/14. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/String/ASTextRunDelegate.m b/Source/Private/TextExperiment/String/ASTextRunDelegate.m old mode 100755 new mode 100644 index f7739f0c8d..aa4154a91c --- a/Source/Private/TextExperiment/String/ASTextRunDelegate.m +++ b/Source/Private/TextExperiment/String/ASTextRunDelegate.m @@ -1,12 +1,9 @@ // // ASTextRunDelegate.m -// ASText +// Texture // -// Created by ibireme on 14/10/14. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Utility/ASTextUtilities.h b/Source/Private/TextExperiment/Utility/ASTextUtilities.h old mode 100755 new mode 100644 index 024fb269c4..f21a931ba8 --- a/Source/Private/TextExperiment/Utility/ASTextUtilities.h +++ b/Source/Private/TextExperiment/Utility/ASTextUtilities.h @@ -1,12 +1,9 @@ // // ASTextUtilities.h -// Modified from YYText +// Texture // -// Created by ibireme on 15/4/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Utility/ASTextUtilities.m b/Source/Private/TextExperiment/Utility/ASTextUtilities.m old mode 100755 new mode 100644 index 17e6971355..624f73e924 --- a/Source/Private/TextExperiment/Utility/ASTextUtilities.m +++ b/Source/Private/TextExperiment/Utility/ASTextUtilities.m @@ -1,12 +1,9 @@ // // ASTextUtilities.m -// Modified from YYText +// Texture // -// Created by ibireme on 15/4/6. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTextUtilities.h" diff --git a/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.h b/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.h old mode 100755 new mode 100644 index dfae840d32..ef44fb4f35 --- a/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.h +++ b/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.h @@ -1,12 +1,9 @@ // // NSAttributedString+ASText.h -// Modified from YYText +// Texture // -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.m b/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.m old mode 100755 new mode 100644 index 1b05bbf73a..134effc161 --- a/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.m +++ b/Source/Private/TextExperiment/Utility/NSAttributedString+ASText.m @@ -1,12 +1,9 @@ // // NSAttributedString+ASText.m -// Modified from YYText +// Texture // -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.h b/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.h old mode 100755 new mode 100644 index b7c21f8121..a7c0aec5ff --- a/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.h +++ b/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.h @@ -1,12 +1,9 @@ // // NSParagraphStyle+ASText.h -// Modified from YYText +// Texture // -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.m b/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.m old mode 100755 new mode 100644 index 2374e4021a..94680d3f00 --- a/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.m +++ b/Source/Private/TextExperiment/Utility/NSParagraphStyle+ASText.m @@ -1,12 +1,9 @@ // // NSParagraphStyle+ASText.m -// Modified from YYText +// Texture // -// Created by ibireme on 14/10/7. -// Copyright (c) 2015 ibireme. -// -// This source code is licensed under the MIT-style license found in the -// LICENSE file in the root directory of this source tree. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCollectionGalleryLayoutInfo.h b/Source/Private/_ASCollectionGalleryLayoutInfo.h index 72dfc7db62..6d7c91e5e5 100644 --- a/Source/Private/_ASCollectionGalleryLayoutInfo.h +++ b/Source/Private/_ASCollectionGalleryLayoutInfo.h @@ -2,12 +2,8 @@ // _ASCollectionGalleryLayoutInfo.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCollectionGalleryLayoutInfo.m b/Source/Private/_ASCollectionGalleryLayoutInfo.m index 4dc9209d0b..8cca556bac 100644 --- a/Source/Private/_ASCollectionGalleryLayoutInfo.m +++ b/Source/Private/_ASCollectionGalleryLayoutInfo.m @@ -2,12 +2,8 @@ // _ASCollectionGalleryLayoutInfo.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCollectionGalleryLayoutItem.h b/Source/Private/_ASCollectionGalleryLayoutItem.h index cbcf495d6d..ce071bb371 100644 --- a/Source/Private/_ASCollectionGalleryLayoutItem.h +++ b/Source/Private/_ASCollectionGalleryLayoutItem.h @@ -2,12 +2,8 @@ // _ASCollectionGalleryLayoutItem.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCollectionGalleryLayoutItem.mm b/Source/Private/_ASCollectionGalleryLayoutItem.mm index 32479d1ce3..5733702992 100644 --- a/Source/Private/_ASCollectionGalleryLayoutItem.mm +++ b/Source/Private/_ASCollectionGalleryLayoutItem.mm @@ -2,12 +2,8 @@ // _ASCollectionGalleryLayoutItem.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCoreAnimationExtras.h b/Source/Private/_ASCoreAnimationExtras.h index e4a15ddf3e..5937f3012c 100644 --- a/Source/Private/_ASCoreAnimationExtras.h +++ b/Source/Private/_ASCoreAnimationExtras.h @@ -2,17 +2,9 @@ // _ASCoreAnimationExtras.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASCoreAnimationExtras.mm b/Source/Private/_ASCoreAnimationExtras.mm index 48d3ee05e2..bac2f44ba7 100644 --- a/Source/Private/_ASCoreAnimationExtras.mm +++ b/Source/Private/_ASCoreAnimationExtras.mm @@ -2,17 +2,9 @@ // _ASCoreAnimationExtras.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASHierarchyChangeSet.h b/Source/Private/_ASHierarchyChangeSet.h index cfd6a0ecc5..c617c58fd1 100644 --- a/Source/Private/_ASHierarchyChangeSet.h +++ b/Source/Private/_ASHierarchyChangeSet.h @@ -2,17 +2,9 @@ // _ASHierarchyChangeSet.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASHierarchyChangeSet.mm b/Source/Private/_ASHierarchyChangeSet.mm index e3b7ab94e6..57f70c461d 100644 --- a/Source/Private/_ASHierarchyChangeSet.mm +++ b/Source/Private/_ASHierarchyChangeSet.mm @@ -2,17 +2,9 @@ // _ASHierarchyChangeSet.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASPendingState.h b/Source/Private/_ASPendingState.h index 246e892a7e..0a96e7a8ad 100644 --- a/Source/Private/_ASPendingState.h +++ b/Source/Private/_ASPendingState.h @@ -2,17 +2,9 @@ // _ASPendingState.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASPendingState.mm b/Source/Private/_ASPendingState.mm index 3565aa8353..a38185e006 100644 --- a/Source/Private/_ASPendingState.mm +++ b/Source/Private/_ASPendingState.mm @@ -2,17 +2,9 @@ // _ASPendingState.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/Private/_ASScopeTimer.h b/Source/Private/_ASScopeTimer.h index 9e4af4c7b7..543e7c2f12 100644 --- a/Source/Private/_ASScopeTimer.h +++ b/Source/Private/_ASScopeTimer.h @@ -2,17 +2,9 @@ // _ASScopeTimer.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/TextKit/ASLayoutManager.h b/Source/TextKit/ASLayoutManager.h index 6d0b21b118..1396bf203e 100644 --- a/Source/TextKit/ASLayoutManager.h +++ b/Source/TextKit/ASLayoutManager.h @@ -2,17 +2,9 @@ // ASLayoutManager.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASLayoutManager.m b/Source/TextKit/ASLayoutManager.m index b603f654e7..08370a4bfb 100644 --- a/Source/TextKit/ASLayoutManager.m +++ b/Source/TextKit/ASLayoutManager.m @@ -2,17 +2,9 @@ // ASLayoutManager.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitAttributes.h b/Source/TextKit/ASTextKitAttributes.h old mode 100755 new mode 100644 index 6398c9f846..7f9fbd9b65 --- a/Source/TextKit/ASTextKitAttributes.h +++ b/Source/TextKit/ASTextKitAttributes.h @@ -2,17 +2,9 @@ // ASTextKitAttributes.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/TextKit/ASTextKitAttributes.mm b/Source/TextKit/ASTextKitAttributes.mm old mode 100755 new mode 100644 index abe55c81d7..131771ab63 --- a/Source/TextKit/ASTextKitAttributes.mm +++ b/Source/TextKit/ASTextKitAttributes.mm @@ -2,17 +2,9 @@ // ASTextKitAttributes.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitComponents.h b/Source/TextKit/ASTextKitComponents.h index 2460b8c48a..e5b516d1b3 100644 --- a/Source/TextKit/ASTextKitComponents.h +++ b/Source/TextKit/ASTextKitComponents.h @@ -2,17 +2,9 @@ // ASTextKitComponents.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitComponents.mm b/Source/TextKit/ASTextKitComponents.mm index 23bf1f5f1b..eeff17607d 100644 --- a/Source/TextKit/ASTextKitComponents.mm +++ b/Source/TextKit/ASTextKitComponents.mm @@ -2,17 +2,9 @@ // ASTextKitComponents.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitContext.h b/Source/TextKit/ASTextKitContext.h old mode 100755 new mode 100644 index 8de63a1bf1..bed137434a --- a/Source/TextKit/ASTextKitContext.h +++ b/Source/TextKit/ASTextKitContext.h @@ -2,17 +2,9 @@ // ASTextKitContext.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitContext.mm b/Source/TextKit/ASTextKitContext.mm old mode 100755 new mode 100644 index f8b3d15655..012619c2ec --- a/Source/TextKit/ASTextKitContext.mm +++ b/Source/TextKit/ASTextKitContext.mm @@ -2,17 +2,9 @@ // ASTextKitContext.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitCoreTextAdditions.h b/Source/TextKit/ASTextKitCoreTextAdditions.h index 4579d5c118..117a89ed34 100644 --- a/Source/TextKit/ASTextKitCoreTextAdditions.h +++ b/Source/TextKit/ASTextKitCoreTextAdditions.h @@ -2,17 +2,9 @@ // ASTextKitCoreTextAdditions.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitCoreTextAdditions.m b/Source/TextKit/ASTextKitCoreTextAdditions.m index 012d02a885..9b8de67a63 100644 --- a/Source/TextKit/ASTextKitCoreTextAdditions.m +++ b/Source/TextKit/ASTextKitCoreTextAdditions.m @@ -2,17 +2,9 @@ // ASTextKitCoreTextAdditions.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitEntityAttribute.h b/Source/TextKit/ASTextKitEntityAttribute.h old mode 100755 new mode 100644 index 23e9983fd2..ddaf586a07 --- a/Source/TextKit/ASTextKitEntityAttribute.h +++ b/Source/TextKit/ASTextKitEntityAttribute.h @@ -2,17 +2,9 @@ // ASTextKitEntityAttribute.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitEntityAttribute.m b/Source/TextKit/ASTextKitEntityAttribute.m old mode 100755 new mode 100644 index 4664b24980..fde0621cf5 --- a/Source/TextKit/ASTextKitEntityAttribute.m +++ b/Source/TextKit/ASTextKitEntityAttribute.m @@ -2,17 +2,9 @@ // ASTextKitEntityAttribute.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitFontSizeAdjuster.h b/Source/TextKit/ASTextKitFontSizeAdjuster.h index 2a647e3306..ca2c2338d5 100644 --- a/Source/TextKit/ASTextKitFontSizeAdjuster.h +++ b/Source/TextKit/ASTextKitFontSizeAdjuster.h @@ -2,17 +2,9 @@ // ASTextKitFontSizeAdjuster.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitFontSizeAdjuster.mm b/Source/TextKit/ASTextKitFontSizeAdjuster.mm index 13d3e92965..3837771239 100644 --- a/Source/TextKit/ASTextKitFontSizeAdjuster.mm +++ b/Source/TextKit/ASTextKitFontSizeAdjuster.mm @@ -2,17 +2,9 @@ // ASTextKitFontSizeAdjuster.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/Source/TextKit/ASTextKitRenderer+Positioning.h b/Source/TextKit/ASTextKitRenderer+Positioning.h old mode 100755 new mode 100644 index 3ee402f224..ebcf229671 --- a/Source/TextKit/ASTextKitRenderer+Positioning.h +++ b/Source/TextKit/ASTextKitRenderer+Positioning.h @@ -2,17 +2,9 @@ // ASTextKitRenderer+Positioning.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitRenderer+Positioning.mm b/Source/TextKit/ASTextKitRenderer+Positioning.mm old mode 100755 new mode 100644 index b0f6c39b16..a97e189b41 --- a/Source/TextKit/ASTextKitRenderer+Positioning.mm +++ b/Source/TextKit/ASTextKitRenderer+Positioning.mm @@ -2,17 +2,9 @@ // ASTextKitRenderer+Positioning.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitRenderer+TextChecking.h b/Source/TextKit/ASTextKitRenderer+TextChecking.h old mode 100755 new mode 100644 index 107209dcc1..b1d1cab8c3 --- a/Source/TextKit/ASTextKitRenderer+TextChecking.h +++ b/Source/TextKit/ASTextKitRenderer+TextChecking.h @@ -2,17 +2,9 @@ // ASTextKitRenderer+TextChecking.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitRenderer+TextChecking.mm b/Source/TextKit/ASTextKitRenderer+TextChecking.mm old mode 100755 new mode 100644 index ff3d57a935..527f82af28 --- a/Source/TextKit/ASTextKitRenderer+TextChecking.mm +++ b/Source/TextKit/ASTextKitRenderer+TextChecking.mm @@ -2,17 +2,9 @@ // ASTextKitRenderer+TextChecking.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitRenderer.h b/Source/TextKit/ASTextKitRenderer.h old mode 100755 new mode 100644 index 995d47898c..e6ea9eefaf --- a/Source/TextKit/ASTextKitRenderer.h +++ b/Source/TextKit/ASTextKitRenderer.h @@ -2,17 +2,9 @@ // ASTextKitRenderer.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitRenderer.mm b/Source/TextKit/ASTextKitRenderer.mm old mode 100755 new mode 100644 index 0f5e8ac99e..a11283bd86 --- a/Source/TextKit/ASTextKitRenderer.mm +++ b/Source/TextKit/ASTextKitRenderer.mm @@ -2,17 +2,9 @@ // ASTextKitRenderer.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitShadower.h b/Source/TextKit/ASTextKitShadower.h old mode 100755 new mode 100644 index f8adad41c5..1bec5aff80 --- a/Source/TextKit/ASTextKitShadower.h +++ b/Source/TextKit/ASTextKitShadower.h @@ -2,17 +2,9 @@ // ASTextKitShadower.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitShadower.mm b/Source/TextKit/ASTextKitShadower.mm old mode 100755 new mode 100644 index 2715438252..714d93a0e7 --- a/Source/TextKit/ASTextKitShadower.mm +++ b/Source/TextKit/ASTextKitShadower.mm @@ -2,17 +2,9 @@ // ASTextKitShadower.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitTailTruncater.h b/Source/TextKit/ASTextKitTailTruncater.h old mode 100755 new mode 100644 index 26f2fb127a..027a27e405 --- a/Source/TextKit/ASTextKitTailTruncater.h +++ b/Source/TextKit/ASTextKitTailTruncater.h @@ -2,17 +2,9 @@ // ASTextKitTailTruncater.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitTailTruncater.mm b/Source/TextKit/ASTextKitTailTruncater.mm old mode 100755 new mode 100644 index b160fbb1e2..1c4d73f496 --- a/Source/TextKit/ASTextKitTailTruncater.mm +++ b/Source/TextKit/ASTextKitTailTruncater.mm @@ -2,17 +2,9 @@ // ASTextKitTailTruncater.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextKitTruncating.h b/Source/TextKit/ASTextKitTruncating.h old mode 100755 new mode 100644 index 04005be0f6..8374f37b18 --- a/Source/TextKit/ASTextKitTruncating.h +++ b/Source/TextKit/ASTextKitTruncating.h @@ -2,17 +2,9 @@ // ASTextKitTruncating.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextNodeTypes.h b/Source/TextKit/ASTextNodeTypes.h index 2e70b0c1e7..694d9ca7fa 100644 --- a/Source/TextKit/ASTextNodeTypes.h +++ b/Source/TextKit/ASTextNodeTypes.h @@ -2,17 +2,9 @@ // ASTextNodeTypes.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #pragma once diff --git a/Source/TextKit/ASTextNodeWordKerner.h b/Source/TextKit/ASTextNodeWordKerner.h index b5c1923882..855cddbd54 100644 --- a/Source/TextKit/ASTextNodeWordKerner.h +++ b/Source/TextKit/ASTextNodeWordKerner.h @@ -2,17 +2,9 @@ // ASTextNodeWordKerner.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/TextKit/ASTextNodeWordKerner.m b/Source/TextKit/ASTextNodeWordKerner.m index d9f6fba02c..fc577d51a4 100644 --- a/Source/TextKit/ASTextNodeWordKerner.m +++ b/Source/TextKit/ASTextNodeWordKerner.m @@ -2,17 +2,9 @@ // ASTextNodeWordKerner.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/UIImage+ASConvenience.h b/Source/UIImage+ASConvenience.h index 7b02d13328..b24c97d1c5 100644 --- a/Source/UIImage+ASConvenience.h +++ b/Source/UIImage+ASConvenience.h @@ -2,17 +2,9 @@ // UIImage+ASConvenience.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/UIImage+ASConvenience.m b/Source/UIImage+ASConvenience.m index c1d0751e39..557049d311 100644 --- a/Source/UIImage+ASConvenience.m +++ b/Source/UIImage+ASConvenience.m @@ -2,17 +2,9 @@ // UIImage+ASConvenience.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/UIResponder+AsyncDisplayKit.h b/Source/UIResponder+AsyncDisplayKit.h index 42dbe49402..17afab3ae2 100644 --- a/Source/UIResponder+AsyncDisplayKit.h +++ b/Source/UIResponder+AsyncDisplayKit.h @@ -2,17 +2,9 @@ // UIResponder+AsyncDisplayKit.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/UIResponder+AsyncDisplayKit.m b/Source/UIResponder+AsyncDisplayKit.m index a80544d686..8c3ec24de3 100644 --- a/Source/UIResponder+AsyncDisplayKit.m +++ b/Source/UIResponder+AsyncDisplayKit.m @@ -2,17 +2,9 @@ // UIResponder+AsyncDisplayKit.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "UIResponder+AsyncDisplayKit.h" diff --git a/Source/_ASTransitionContext.h b/Source/_ASTransitionContext.h index 54d72397ca..44c4906c39 100644 --- a/Source/_ASTransitionContext.h +++ b/Source/_ASTransitionContext.h @@ -2,17 +2,9 @@ // _ASTransitionContext.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/_ASTransitionContext.m b/Source/_ASTransitionContext.m index b796d7a72d..a75a3ca434 100644 --- a/Source/_ASTransitionContext.m +++ b/Source/_ASTransitionContext.m @@ -2,17 +2,9 @@ // _ASTransitionContext.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/tvOS/ASControlNode+tvOS.m b/Source/tvOS/ASControlNode+tvOS.m index 77e5418629..8a878eb235 100644 --- a/Source/tvOS/ASControlNode+tvOS.m +++ b/Source/tvOS/ASControlNode+tvOS.m @@ -2,17 +2,9 @@ // ASControlNode+tvOS.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Source/tvOS/ASImageNode+tvOS.m b/Source/tvOS/ASImageNode+tvOS.m index 9482fdc8c1..1bd1ef4599 100644 --- a/Source/tvOS/ASImageNode+tvOS.m +++ b/Source/tvOS/ASImageNode+tvOS.m @@ -2,17 +2,9 @@ // ASImageNode+tvOS.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.h index d14c9eef90..c3cdab0bad 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.h @@ -2,17 +2,9 @@ // ASListKitTestAdapterDataSource.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.m index b9a86160a4..b0cd9a8a6d 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTestAdapterDataSource.m @@ -2,17 +2,9 @@ // ASListKitTestAdapterDataSource.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListKitTestAdapterDataSource.h" diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTests.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTests.m index 28b6205d7f..1bb2c6fed0 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTests.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListKitTests.m @@ -2,17 +2,9 @@ // ASListKitTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.h index d9d4c44ac4..e0a4ad7f44 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.h @@ -2,17 +2,9 @@ // ASListTestCellNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.m index 4963f36280..cd3bfb3a8d 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestCellNode.m @@ -2,17 +2,9 @@ // ASListTestCellNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListTestCellNode.h" diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.h index a4dbf7c047..1362ebf560 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.h @@ -2,17 +2,9 @@ // ASListTestObject.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.m index 4b815361b9..64cd83649b 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestObject.m @@ -2,17 +2,9 @@ // ASListTestObject.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListTestObject.h" diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.h index 6e21457f90..d62e21b1f6 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.h @@ -2,17 +2,9 @@ // ASListTestSection.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.m index 1d17605de4..edf939b7c0 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSection.m @@ -2,17 +2,9 @@ // ASListTestSection.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListTestSection.h" diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.h index 7ec2b83609..c4f40e4ab7 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.h @@ -2,17 +2,9 @@ // ASListTestSupplementaryNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.m index 367200b77e..a10f6a8f69 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementaryNode.m @@ -2,17 +2,9 @@ // ASListTestSupplementaryNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListTestSupplementaryNode.h" diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.h b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.h index 37cb4816f4..acdec1ef94 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.h +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.h @@ -2,17 +2,9 @@ // ASListTestSupplementarySource.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.m b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.m index 30e44749a1..07410131e2 100644 --- a/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.m +++ b/SubspecWorkspaces/ASDKListKit/ASDKListKitTests/ASListTestSupplementarySource.m @@ -2,17 +2,9 @@ // ASListTestSupplementarySource.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASListTestSupplementarySource.h" diff --git a/Tests/ASAbsoluteLayoutSpecSnapshotTests.m b/Tests/ASAbsoluteLayoutSpecSnapshotTests.m index c78dca2a49..2715872cdc 100644 --- a/Tests/ASAbsoluteLayoutSpecSnapshotTests.m +++ b/Tests/ASAbsoluteLayoutSpecSnapshotTests.m @@ -2,19 +2,9 @@ // ASAbsoluteLayoutSpecSnapshotTests.m // Texture // -// Created by Huy Nguyen on 18/10/15. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASBackgroundLayoutSpecSnapshotTests.mm b/Tests/ASBackgroundLayoutSpecSnapshotTests.mm index 6429447331..1a6b4fc7c8 100644 --- a/Tests/ASBackgroundLayoutSpecSnapshotTests.mm +++ b/Tests/ASBackgroundLayoutSpecSnapshotTests.mm @@ -1,18 +1,10 @@ // -// ASOverlayLayoutSpecSnapshotTests.mm +// ASBackgroundLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASBasicImageDownloaderContextTests.m b/Tests/ASBasicImageDownloaderContextTests.m index c92149234b..8414abf007 100644 --- a/Tests/ASBasicImageDownloaderContextTests.m +++ b/Tests/ASBasicImageDownloaderContextTests.m @@ -2,17 +2,9 @@ // ASBasicImageDownloaderContextTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASBasicImageDownloaderTests.m b/Tests/ASBasicImageDownloaderTests.m index 6144b5c253..5eb6da503b 100644 --- a/Tests/ASBasicImageDownloaderTests.m +++ b/Tests/ASBasicImageDownloaderTests.m @@ -2,19 +2,9 @@ // ASBasicImageDownloaderTests.m // Texture // -// Created by Victor Mayorov on 10/06/15. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASBatchFetchingTests.m b/Tests/ASBatchFetchingTests.m index 97eab3576c..76cc6455ba 100644 --- a/Tests/ASBatchFetchingTests.m +++ b/Tests/ASBatchFetchingTests.m @@ -2,17 +2,9 @@ // ASBatchFetchingTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASBridgedPropertiesTests.mm b/Tests/ASBridgedPropertiesTests.mm index 82b5d3350c..8e4a202eb8 100644 --- a/Tests/ASBridgedPropertiesTests.mm +++ b/Tests/ASBridgedPropertiesTests.mm @@ -2,19 +2,9 @@ // ASBridgedPropertiesTests.mm // Texture // -// Created by Adlai Holler on 1/7/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCALayerTests.m b/Tests/ASCALayerTests.m index 1ff20d396c..3527a272bb 100644 --- a/Tests/ASCALayerTests.m +++ b/Tests/ASCALayerTests.m @@ -2,17 +2,9 @@ // ASCALayerTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCenterLayoutSpecSnapshotTests.mm b/Tests/ASCenterLayoutSpecSnapshotTests.mm index 2275b14ce1..d0352bb446 100644 --- a/Tests/ASCenterLayoutSpecSnapshotTests.mm +++ b/Tests/ASCenterLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASCenterLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASCollectionModernDataSourceTests.m b/Tests/ASCollectionModernDataSourceTests.m index 046b6a374f..d13db9e6cd 100644 --- a/Tests/ASCollectionModernDataSourceTests.m +++ b/Tests/ASCollectionModernDataSourceTests.m @@ -2,12 +2,8 @@ // ASCollectionModernDataSourceTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCollectionViewFlowLayoutInspectorTests.m b/Tests/ASCollectionViewFlowLayoutInspectorTests.m index f24a1b0f54..c90270df08 100644 --- a/Tests/ASCollectionViewFlowLayoutInspectorTests.m +++ b/Tests/ASCollectionViewFlowLayoutInspectorTests.m @@ -2,17 +2,9 @@ // ASCollectionViewFlowLayoutInspectorTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCollectionViewTests.mm b/Tests/ASCollectionViewTests.mm index 8ed0994779..372e258f20 100644 --- a/Tests/ASCollectionViewTests.mm +++ b/Tests/ASCollectionViewTests.mm @@ -2,17 +2,9 @@ // ASCollectionViewTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCollectionsTests.m b/Tests/ASCollectionsTests.m index 17857a6e47..348798e6d3 100644 --- a/Tests/ASCollectionsTests.m +++ b/Tests/ASCollectionsTests.m @@ -2,12 +2,8 @@ // ASCollectionsTests.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASConfigurationTests.m b/Tests/ASConfigurationTests.m index cd7ed1034e..c16cb79e0f 100644 --- a/Tests/ASConfigurationTests.m +++ b/Tests/ASConfigurationTests.m @@ -2,12 +2,8 @@ // ASConfigurationTests.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASControlNodeTests.m b/Tests/ASControlNodeTests.m index 1961037e2f..95207ce9d6 100644 --- a/Tests/ASControlNodeTests.m +++ b/Tests/ASControlNodeTests.m @@ -2,17 +2,9 @@ // ASControlNodeTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASCornerLayoutSpecSnapshotTests.mm b/Tests/ASCornerLayoutSpecSnapshotTests.mm index a9e20f7c5f..2c496cd595 100644 --- a/Tests/ASCornerLayoutSpecSnapshotTests.mm +++ b/Tests/ASCornerLayoutSpecSnapshotTests.mm @@ -2,12 +2,8 @@ // ASCornerLayoutSpecSnapshotTests.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASDimensionTests.mm b/Tests/ASDimensionTests.mm index 6832dc5e88..4cc64f2f6b 100644 --- a/Tests/ASDimensionTests.mm +++ b/Tests/ASDimensionTests.mm @@ -2,17 +2,9 @@ // ASDimensionTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDispatchTests.m b/Tests/ASDispatchTests.m index f159f5e9da..64c3412f35 100644 --- a/Tests/ASDispatchTests.m +++ b/Tests/ASDispatchTests.m @@ -2,17 +2,9 @@ // ASDispatchTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayLayerTests.m b/Tests/ASDisplayLayerTests.m index e462e0a4a6..b65dc3fc4a 100644 --- a/Tests/ASDisplayLayerTests.m +++ b/Tests/ASDisplayLayerTests.m @@ -2,17 +2,9 @@ // ASDisplayLayerTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeAppearanceTests.m b/Tests/ASDisplayNodeAppearanceTests.m index f636e7830e..70f9265da7 100644 --- a/Tests/ASDisplayNodeAppearanceTests.m +++ b/Tests/ASDisplayNodeAppearanceTests.m @@ -2,17 +2,9 @@ // ASDisplayNodeAppearanceTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeExtrasTests.m b/Tests/ASDisplayNodeExtrasTests.m index bd8e2556f9..8635118388 100644 --- a/Tests/ASDisplayNodeExtrasTests.m +++ b/Tests/ASDisplayNodeExtrasTests.m @@ -2,8 +2,8 @@ // ASDisplayNodeExtrasTests.m // Texture // -// Created by Kiel Gillard on 27/06/2016. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeImplicitHierarchyTests.m b/Tests/ASDisplayNodeImplicitHierarchyTests.m index 5d305ceb87..d856002bed 100644 --- a/Tests/ASDisplayNodeImplicitHierarchyTests.m +++ b/Tests/ASDisplayNodeImplicitHierarchyTests.m @@ -2,17 +2,9 @@ // ASDisplayNodeImplicitHierarchyTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeLayoutTests.mm b/Tests/ASDisplayNodeLayoutTests.mm index 00512e8012..0165f45754 100644 --- a/Tests/ASDisplayNodeLayoutTests.mm +++ b/Tests/ASDisplayNodeLayoutTests.mm @@ -2,17 +2,9 @@ // ASDisplayNodeLayoutTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASXCTExtensions.h" diff --git a/Tests/ASDisplayNodeSnapshotTests.m b/Tests/ASDisplayNodeSnapshotTests.m index 4062be015e..8d67e3cd08 100644 --- a/Tests/ASDisplayNodeSnapshotTests.m +++ b/Tests/ASDisplayNodeSnapshotTests.m @@ -2,8 +2,8 @@ // ASDisplayNodeSnapshotTests.m // Texture // -// Created by Adlai Holler on 8/16/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASSnapshotTestCase.h" diff --git a/Tests/ASDisplayNodeTests.mm b/Tests/ASDisplayNodeTests.mm index 55585eec91..f1618e4968 100644 --- a/Tests/ASDisplayNodeTests.mm +++ b/Tests/ASDisplayNodeTests.mm @@ -2,17 +2,9 @@ // ASDisplayNodeTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeTestsHelper.h b/Tests/ASDisplayNodeTestsHelper.h index 2d071bcf83..4e884f4428 100644 --- a/Tests/ASDisplayNodeTestsHelper.h +++ b/Tests/ASDisplayNodeTestsHelper.h @@ -2,17 +2,9 @@ // ASDisplayNodeTestsHelper.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASDisplayNodeTestsHelper.m b/Tests/ASDisplayNodeTestsHelper.m index 6dbd9b7945..3d625414e5 100644 --- a/Tests/ASDisplayNodeTestsHelper.m +++ b/Tests/ASDisplayNodeTestsHelper.m @@ -2,17 +2,9 @@ // ASDisplayNodeTestsHelper.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASDisplayNodeTestsHelper.h" diff --git a/Tests/ASEditableTextNodeTests.m b/Tests/ASEditableTextNodeTests.m index abeb63426e..a7bbad223a 100644 --- a/Tests/ASEditableTextNodeTests.m +++ b/Tests/ASEditableTextNodeTests.m @@ -2,19 +2,9 @@ // ASEditableTextNodeTests.m // Texture // -// Created by Michael Schneider on 5/31/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASImageNodeSnapshotTests.m b/Tests/ASImageNodeSnapshotTests.m index c3bdb8cd36..f9c0ca71f9 100644 --- a/Tests/ASImageNodeSnapshotTests.m +++ b/Tests/ASImageNodeSnapshotTests.m @@ -2,17 +2,9 @@ // ASImageNodeSnapshotTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASSnapshotTestCase.h" diff --git a/Tests/ASInsetLayoutSpecSnapshotTests.mm b/Tests/ASInsetLayoutSpecSnapshotTests.mm index 275b7cde03..d6047d35f3 100644 --- a/Tests/ASInsetLayoutSpecSnapshotTests.mm +++ b/Tests/ASInsetLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASInsetLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASIntegerMapTests.m b/Tests/ASIntegerMapTests.m index 7afdccf1c3..a79086a614 100644 --- a/Tests/ASIntegerMapTests.m +++ b/Tests/ASIntegerMapTests.m @@ -2,12 +2,8 @@ // ASIntegerMapTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTestCase.h" diff --git a/Tests/ASLayoutElementStyleTests.m b/Tests/ASLayoutElementStyleTests.m index ebec4bbd53..4afd67ec4c 100644 --- a/Tests/ASLayoutElementStyleTests.m +++ b/Tests/ASLayoutElementStyleTests.m @@ -1,18 +1,10 @@ // -// ASLayoutElementStyleTests.mm +// ASLayoutElementStyleTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASLayoutEngineTests.mm b/Tests/ASLayoutEngineTests.mm index 6b864c4da0..76d0a7e6ff 100644 --- a/Tests/ASLayoutEngineTests.mm +++ b/Tests/ASLayoutEngineTests.mm @@ -2,12 +2,8 @@ // ASLayoutEngineTests.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTestCase.h" diff --git a/Tests/ASLayoutFlatteningTests.m b/Tests/ASLayoutFlatteningTests.m index fb04a95090..fb9870c03d 100644 --- a/Tests/ASLayoutFlatteningTests.m +++ b/Tests/ASLayoutFlatteningTests.m @@ -2,12 +2,8 @@ // ASLayoutFlatteningTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASLayoutSpecSnapshotTestsHelper.h b/Tests/ASLayoutSpecSnapshotTestsHelper.h index cfea40af36..740017ee9e 100644 --- a/Tests/ASLayoutSpecSnapshotTestsHelper.h +++ b/Tests/ASLayoutSpecSnapshotTestsHelper.h @@ -2,17 +2,9 @@ // ASLayoutSpecSnapshotTestsHelper.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASSnapshotTestCase.h" diff --git a/Tests/ASLayoutSpecSnapshotTestsHelper.m b/Tests/ASLayoutSpecSnapshotTestsHelper.m index bc3fde6b3f..d7385cda95 100644 --- a/Tests/ASLayoutSpecSnapshotTestsHelper.m +++ b/Tests/ASLayoutSpecSnapshotTestsHelper.m @@ -2,17 +2,9 @@ // ASLayoutSpecSnapshotTestsHelper.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASLayoutSpecTests.m b/Tests/ASLayoutSpecTests.m index cb67b99ac9..257e645499 100644 --- a/Tests/ASLayoutSpecTests.m +++ b/Tests/ASLayoutSpecTests.m @@ -2,17 +2,9 @@ // ASLayoutSpecTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASLayoutTestNode.h b/Tests/ASLayoutTestNode.h index 8bdd0f28cc..231447abe1 100644 --- a/Tests/ASLayoutTestNode.h +++ b/Tests/ASLayoutTestNode.h @@ -2,12 +2,8 @@ // ASLayoutTestNode.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASLayoutTestNode.mm b/Tests/ASLayoutTestNode.mm index 3b064b814f..8367c09938 100644 --- a/Tests/ASLayoutTestNode.mm +++ b/Tests/ASLayoutTestNode.mm @@ -2,12 +2,8 @@ // ASLayoutTestNode.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutTestNode.h" diff --git a/Tests/ASMultiplexImageNodeTests.m b/Tests/ASMultiplexImageNodeTests.m index 71b1fe05e4..56e3b11199 100644 --- a/Tests/ASMultiplexImageNodeTests.m +++ b/Tests/ASMultiplexImageNodeTests.m @@ -2,17 +2,9 @@ // ASMultiplexImageNodeTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASMutableAttributedStringBuilderTests.m b/Tests/ASMutableAttributedStringBuilderTests.m index dd98130fef..9999b6d4b4 100644 --- a/Tests/ASMutableAttributedStringBuilderTests.m +++ b/Tests/ASMutableAttributedStringBuilderTests.m @@ -2,17 +2,9 @@ // ASMutableAttributedStringBuilderTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASNavigationControllerTests.m b/Tests/ASNavigationControllerTests.m index 80f6ba87fa..b964029b83 100644 --- a/Tests/ASNavigationControllerTests.m +++ b/Tests/ASNavigationControllerTests.m @@ -2,12 +2,8 @@ // ASNavigationControllerTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASNetworkImageNodeTests.m b/Tests/ASNetworkImageNodeTests.m index 13959fdfe1..1dcc363e09 100644 --- a/Tests/ASNetworkImageNodeTests.m +++ b/Tests/ASNetworkImageNodeTests.m @@ -2,12 +2,8 @@ // ASNetworkImageNodeTests.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASOverlayLayoutSpecSnapshotTests.mm b/Tests/ASOverlayLayoutSpecSnapshotTests.mm index 9b9cc68277..a50baa9ef4 100644 --- a/Tests/ASOverlayLayoutSpecSnapshotTests.mm +++ b/Tests/ASOverlayLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASOverlayLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASPagerNodeTests.m b/Tests/ASPagerNodeTests.m index f34b57f56b..76ea96c53b 100644 --- a/Tests/ASPagerNodeTests.m +++ b/Tests/ASPagerNodeTests.m @@ -2,17 +2,9 @@ // ASPagerNodeTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASPerformanceTestContext.h b/Tests/ASPerformanceTestContext.h index d60f53b1ae..49196d451c 100644 --- a/Tests/ASPerformanceTestContext.h +++ b/Tests/ASPerformanceTestContext.h @@ -2,12 +2,8 @@ // ASPerformanceTestContext.h // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASPerformanceTestContext.m b/Tests/ASPerformanceTestContext.m index 94f5dba204..6064a8af9c 100644 --- a/Tests/ASPerformanceTestContext.m +++ b/Tests/ASPerformanceTestContext.m @@ -2,17 +2,9 @@ // ASPerformanceTestContext.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASPhotosFrameworkImageRequestTests.m b/Tests/ASPhotosFrameworkImageRequestTests.m index 0a2c7870ec..6e9c2f570d 100644 --- a/Tests/ASPhotosFrameworkImageRequestTests.m +++ b/Tests/ASPhotosFrameworkImageRequestTests.m @@ -2,19 +2,9 @@ // ASPhotosFrameworkImageRequestTests.m // Texture // -// Created by Adlai Holler on 9/25/15. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASRatioLayoutSpecSnapshotTests.mm b/Tests/ASRatioLayoutSpecSnapshotTests.mm index 8aafa6610b..f5bad2723f 100644 --- a/Tests/ASRatioLayoutSpecSnapshotTests.mm +++ b/Tests/ASRatioLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASRatioLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASRectMapTests.m b/Tests/ASRectMapTests.m index 357f3879a6..be5e2ef3df 100644 --- a/Tests/ASRectMapTests.m +++ b/Tests/ASRectMapTests.m @@ -2,8 +2,8 @@ // ASRectMapTests.m // Texture // -// Created by Adlai Holler on 2/24/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASRecursiveUnfairLockTests.m b/Tests/ASRecursiveUnfairLockTests.m index 56c0245b44..38ba7d57d8 100644 --- a/Tests/ASRecursiveUnfairLockTests.m +++ b/Tests/ASRecursiveUnfairLockTests.m @@ -2,12 +2,8 @@ // ASRecursiveUnfairLockTests.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTestCase.h" diff --git a/Tests/ASRelativeLayoutSpecSnapshotTests.mm b/Tests/ASRelativeLayoutSpecSnapshotTests.mm index 8a11564c3b..93887a9ce8 100644 --- a/Tests/ASRelativeLayoutSpecSnapshotTests.mm +++ b/Tests/ASRelativeLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASRelativeLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASRunLoopQueueTests.m b/Tests/ASRunLoopQueueTests.m index b355094163..89eff024fe 100644 --- a/Tests/ASRunLoopQueueTests.m +++ b/Tests/ASRunLoopQueueTests.m @@ -2,12 +2,8 @@ // ASRunLoopQueueTests.m // Texture // -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTestCase.h" diff --git a/Tests/ASScrollNodeTests.m b/Tests/ASScrollNodeTests.m index 56b3fd731b..f0d8fe2079 100644 --- a/Tests/ASScrollNodeTests.m +++ b/Tests/ASScrollNodeTests.m @@ -2,12 +2,8 @@ // ASScrollNodeTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASSnapshotTestCase.h b/Tests/ASSnapshotTestCase.h index 580b487b9a..f2b3d99e0c 100644 --- a/Tests/ASSnapshotTestCase.h +++ b/Tests/ASSnapshotTestCase.h @@ -2,17 +2,9 @@ // ASSnapshotTestCase.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASSnapshotTestCase.m b/Tests/ASSnapshotTestCase.m index a929bb1594..9fc4e8fd09 100644 --- a/Tests/ASSnapshotTestCase.m +++ b/Tests/ASSnapshotTestCase.m @@ -2,17 +2,9 @@ // ASSnapshotTestCase.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASSnapshotTestCase.h" diff --git a/Tests/ASStackLayoutSpecSnapshotTests.mm b/Tests/ASStackLayoutSpecSnapshotTests.mm index 7f4c3251f6..ac6a2a254d 100644 --- a/Tests/ASStackLayoutSpecSnapshotTests.mm +++ b/Tests/ASStackLayoutSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASStackLayoutSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASLayoutSpecSnapshotTestsHelper.h" diff --git a/Tests/ASTLayoutFixture.h b/Tests/ASTLayoutFixture.h index e9395dd372..ed97169168 100644 --- a/Tests/ASTLayoutFixture.h +++ b/Tests/ASTLayoutFixture.h @@ -2,12 +2,8 @@ // ASTLayoutFixture.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTLayoutFixture.mm b/Tests/ASTLayoutFixture.mm index 7e4878cf29..694f03e4e8 100644 --- a/Tests/ASTLayoutFixture.mm +++ b/Tests/ASTLayoutFixture.mm @@ -2,12 +2,8 @@ // ASTLayoutFixture.mm // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTLayoutFixture.h" diff --git a/Tests/ASTabBarControllerTests.m b/Tests/ASTabBarControllerTests.m index 0e6d9b3d31..b933222c9f 100644 --- a/Tests/ASTabBarControllerTests.m +++ b/Tests/ASTabBarControllerTests.m @@ -2,12 +2,8 @@ // ASTabBarControllerTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTableViewTests.mm b/Tests/ASTableViewTests.mm index dbd5672cf0..afb412c7bc 100644 --- a/Tests/ASTableViewTests.mm +++ b/Tests/ASTableViewTests.mm @@ -2,17 +2,9 @@ // ASTableViewTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTableViewThrashTests.m b/Tests/ASTableViewThrashTests.m index 3c76390ac8..df17ca4ba7 100644 --- a/Tests/ASTableViewThrashTests.m +++ b/Tests/ASTableViewThrashTests.m @@ -2,17 +2,9 @@ // ASTableViewThrashTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextKitCoreTextAdditionsTests.m b/Tests/ASTextKitCoreTextAdditionsTests.m index fbf4a5ded3..4a17e0660d 100644 --- a/Tests/ASTextKitCoreTextAdditionsTests.m +++ b/Tests/ASTextKitCoreTextAdditionsTests.m @@ -2,17 +2,9 @@ // ASTextKitCoreTextAdditionsTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextKitFontSizeAdjusterTests.mm b/Tests/ASTextKitFontSizeAdjusterTests.mm index 937028d3f5..2f9cc0157f 100644 --- a/Tests/ASTextKitFontSizeAdjusterTests.mm +++ b/Tests/ASTextKitFontSizeAdjusterTests.mm @@ -2,12 +2,8 @@ // ASTextKitFontSizeAdjusterTests.mm // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextKitTests.mm b/Tests/ASTextKitTests.mm index 6872061787..1d765efe4c 100644 --- a/Tests/ASTextKitTests.mm +++ b/Tests/ASTextKitTests.mm @@ -2,17 +2,9 @@ // ASTextKitTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextKitTruncationTests.mm b/Tests/ASTextKitTruncationTests.mm index 9b0a39f99c..647c31867a 100644 --- a/Tests/ASTextKitTruncationTests.mm +++ b/Tests/ASTextKitTruncationTests.mm @@ -2,17 +2,9 @@ // ASTextKitTruncationTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextNode2SnapshotTests.m b/Tests/ASTextNode2SnapshotTests.m index 680433e971..aba895c323 100644 --- a/Tests/ASTextNode2SnapshotTests.m +++ b/Tests/ASTextNode2SnapshotTests.m @@ -1,13 +1,9 @@ // -// ASTextNode2SnapshotTests.mm +// ASTextNode2SnapshotTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/Tests/ASTextNodePerformanceTests.m b/Tests/ASTextNodePerformanceTests.m index f5c62e53a5..ac22bf5bb8 100644 --- a/Tests/ASTextNodePerformanceTests.m +++ b/Tests/ASTextNodePerformanceTests.m @@ -2,12 +2,8 @@ // ASTextNodePerformanceTests.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextNodeSnapshotTests.m b/Tests/ASTextNodeSnapshotTests.m index 1d705f77b7..068c3896b3 100644 --- a/Tests/ASTextNodeSnapshotTests.m +++ b/Tests/ASTextNodeSnapshotTests.m @@ -2,18 +2,9 @@ // ASTextNodeSnapshotTests.m // Texture // -// Created by Garrett Moon on 8/12/16. -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASSnapshotTestCase.h" diff --git a/Tests/ASTextNodeTests.m b/Tests/ASTextNodeTests.m index c6ec58d204..daf8cf7d79 100644 --- a/Tests/ASTextNodeTests.m +++ b/Tests/ASTextNodeTests.m @@ -2,17 +2,9 @@ // ASTextNodeTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTextNodeWordKernerTests.mm b/Tests/ASTextNodeWordKernerTests.mm index b4c760de7d..7b9773574b 100644 --- a/Tests/ASTextNodeWordKernerTests.mm +++ b/Tests/ASTextNodeWordKernerTests.mm @@ -2,17 +2,9 @@ // ASTextNodeWordKernerTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASTraitCollectionTests.m b/Tests/ASTraitCollectionTests.m index aa106d75ec..ab201b16d4 100644 --- a/Tests/ASTraitCollectionTests.m +++ b/Tests/ASTraitCollectionTests.m @@ -2,12 +2,8 @@ // ASTraitCollectionTests.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASUICollectionViewTests.m b/Tests/ASUICollectionViewTests.m index ec7a51fa2d..8d8a9b9d38 100644 --- a/Tests/ASUICollectionViewTests.m +++ b/Tests/ASUICollectionViewTests.m @@ -2,17 +2,9 @@ // ASUICollectionViewTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASVideoNodeTests.m b/Tests/ASVideoNodeTests.m index 57e9be4826..6a4311cfce 100644 --- a/Tests/ASVideoNodeTests.m +++ b/Tests/ASVideoNodeTests.m @@ -2,17 +2,9 @@ // ASVideoNodeTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASViewControllerTests.m b/Tests/ASViewControllerTests.m index 3fa91d87f5..df050da613 100644 --- a/Tests/ASViewControllerTests.m +++ b/Tests/ASViewControllerTests.m @@ -2,17 +2,9 @@ // ASViewControllerTests.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASWeakMapTests.m b/Tests/ASWeakMapTests.m index 21e2dde8a7..4158f0e88c 100644 --- a/Tests/ASWeakMapTests.m +++ b/Tests/ASWeakMapTests.m @@ -2,19 +2,9 @@ // ASWeakMapTests.m // Texture // -// Created by Chris Danford on 7/23/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASWeakSetTests.m b/Tests/ASWeakSetTests.m index 59b3f577d9..6f64372e3d 100644 --- a/Tests/ASWeakSetTests.m +++ b/Tests/ASWeakSetTests.m @@ -2,19 +2,9 @@ // ASWeakSetTests.m // Texture // -// Created by Adlai Holler on 1/7/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/ASWrapperSpecSnapshotTests.mm b/Tests/ASWrapperSpecSnapshotTests.mm index 5f8e0e88b9..91ddd45fe5 100644 --- a/Tests/ASWrapperSpecSnapshotTests.mm +++ b/Tests/ASWrapperSpecSnapshotTests.mm @@ -2,17 +2,9 @@ // ASWrapperSpecSnapshotTests.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/Tests/ArrayDiffingTests.m b/Tests/ArrayDiffingTests.m index b9af5681aa..45010ffc07 100644 --- a/Tests/ArrayDiffingTests.m +++ b/Tests/ArrayDiffingTests.m @@ -2,19 +2,9 @@ // ArrayDiffingTests.m // Texture // -// Created by Levi McCallum on 1/29/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/Common/ASDisplayNode+OCMock.m b/Tests/Common/ASDisplayNode+OCMock.m index 4fd0db028b..051ae9e807 100644 --- a/Tests/Common/ASDisplayNode+OCMock.m +++ b/Tests/Common/ASDisplayNode+OCMock.m @@ -2,12 +2,8 @@ // ASDisplayNode+OCMock.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/Common/ASTestCase.h b/Tests/Common/ASTestCase.h index bbcf073362..4e8850c247 100644 --- a/Tests/Common/ASTestCase.h +++ b/Tests/Common/ASTestCase.h @@ -2,17 +2,9 @@ // ASTestCase.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/Common/ASTestCase.m b/Tests/Common/ASTestCase.m index 9a2f7d1d71..7e9d20bf2f 100644 --- a/Tests/Common/ASTestCase.m +++ b/Tests/Common/ASTestCase.m @@ -2,17 +2,9 @@ // ASTestCase.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASTestCase.h" diff --git a/Tests/Common/ASXCTExtensions.h b/Tests/Common/ASXCTExtensions.h index 574b7a7175..2d882f922a 100644 --- a/Tests/Common/ASXCTExtensions.h +++ b/Tests/Common/ASXCTExtensions.h @@ -1,10 +1,10 @@ -/** - * XCTest extensions for CGGeometry. - * - * Prefer these to XCTAssert(CGRectEqualToRect(...)) because you get output - * that tells you what went wrong. - * Could use NSValue, but using strings makes the description messages shorter. - */ +// +// ASXCTExtensions.h +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #import diff --git a/Tests/Common/NSInvocation+ASTestHelpers.h b/Tests/Common/NSInvocation+ASTestHelpers.h index da64096e32..3248cdd283 100644 --- a/Tests/Common/NSInvocation+ASTestHelpers.h +++ b/Tests/Common/NSInvocation+ASTestHelpers.h @@ -2,12 +2,8 @@ // NSInvocation+ASTestHelpers.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/Common/NSInvocation+ASTestHelpers.m b/Tests/Common/NSInvocation+ASTestHelpers.m index d442a2011e..5fe505c1f7 100644 --- a/Tests/Common/NSInvocation+ASTestHelpers.m +++ b/Tests/Common/NSInvocation+ASTestHelpers.m @@ -2,12 +2,8 @@ // NSInvocation+ASTestHelpers.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "NSInvocation+ASTestHelpers.h" diff --git a/Tests/Common/OCMockObject+ASAdditions.h b/Tests/Common/OCMockObject+ASAdditions.h index 49c3503060..2ad99e676e 100644 --- a/Tests/Common/OCMockObject+ASAdditions.h +++ b/Tests/Common/OCMockObject+ASAdditions.h @@ -2,12 +2,8 @@ // OCMockObject+ASAdditions.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/Common/OCMockObject+ASAdditions.m b/Tests/Common/OCMockObject+ASAdditions.m index 50fabd5eb6..3ed0930244 100644 --- a/Tests/Common/OCMockObject+ASAdditions.m +++ b/Tests/Common/OCMockObject+ASAdditions.m @@ -2,12 +2,8 @@ // OCMockObject+ASAdditions.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OCMockObject+ASAdditions.h" diff --git a/Tests/Common/debugbreak.h b/Tests/Common/debugbreak.h index 5405e40de7..96f1e9e59a 100644 --- a/Tests/Common/debugbreak.h +++ b/Tests/Common/debugbreak.h @@ -2,12 +2,8 @@ // debugbreak.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // /* Copyright (c) 2011-2015, Scott Tsai diff --git a/Tests/TestHost/AppDelegate.h b/Tests/TestHost/AppDelegate.h index d9bc76ef51..1cdc488736 100644 --- a/Tests/TestHost/AppDelegate.h +++ b/Tests/TestHost/AppDelegate.h @@ -2,17 +2,9 @@ // AppDelegate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Tests/TestHost/AppDelegate.m b/Tests/TestHost/AppDelegate.m index 51bf905c2f..bf5baf6f9e 100644 --- a/Tests/TestHost/AppDelegate.m +++ b/Tests/TestHost/AppDelegate.m @@ -1,18 +1,10 @@ // -// AppDelegate.mm +// AppDelegate.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/Tests/TestHost/main.m b/Tests/TestHost/main.m index 27c659b765..65850400e4 100644 --- a/Tests/TestHost/main.m +++ b/Tests/TestHost/main.m @@ -2,17 +2,9 @@ // main.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/Texture.podspec b/Texture.podspec index 455cb080a5..0ec19ce157 100644 --- a/Texture.podspec +++ b/Texture.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |spec| spec.name = 'Texture' spec.version = '2.7' - spec.license = { :type => 'BSD and Apache 2', } + spec.license = { :type => 'Apache 2', } spec.homepage = 'http://texturegroup.org' spec.authors = { 'Huy Nguyen' => 'huy@pinterest.com', 'Garrett Moon' => 'garrett@excitedpixel.com', 'Scott Goodson' => 'scottgoodson@gmail.com', 'Michael Schneider' => 'schneider@pinterest.com', 'Adlai Holler' => 'adlai@pinterest.com' } spec.summary = 'Smooth asynchronous user interfaces for iOS apps.' diff --git a/examples/ASCollectionView/Sample/AppDelegate.h b/examples/ASCollectionView/Sample/AppDelegate.h index b977c7498f..db20870a31 100644 --- a/examples/ASCollectionView/Sample/AppDelegate.h +++ b/examples/ASCollectionView/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASCollectionView/Sample/AppDelegate.m b/examples/ASCollectionView/Sample/AppDelegate.m index 393711a864..ad36676ae0 100644 --- a/examples/ASCollectionView/Sample/AppDelegate.m +++ b/examples/ASCollectionView/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASCollectionView/Sample/ItemNode.h b/examples/ASCollectionView/Sample/ItemNode.h index e50983f7e5..73eb2629e6 100644 --- a/examples/ASCollectionView/Sample/ItemNode.h +++ b/examples/ASCollectionView/Sample/ItemNode.h @@ -1,18 +1,10 @@ // // ItemNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASCollectionView/Sample/ItemNode.m b/examples/ASCollectionView/Sample/ItemNode.m index 2f61c4ff46..b9850a4b9e 100644 --- a/examples/ASCollectionView/Sample/ItemNode.m +++ b/examples/ASCollectionView/Sample/ItemNode.m @@ -1,18 +1,10 @@ // // ItemNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ItemNode.h" diff --git a/examples/ASCollectionView/Sample/PresentingViewController.h b/examples/ASCollectionView/Sample/PresentingViewController.h index f0c2a76e37..44c07c6a76 100644 --- a/examples/ASCollectionView/Sample/PresentingViewController.h +++ b/examples/ASCollectionView/Sample/PresentingViewController.h @@ -1,20 +1,10 @@ // // PresentingViewController.h -// Sample +// Texture // -// Created by Tom King on 12/23/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASCollectionView/Sample/PresentingViewController.m b/examples/ASCollectionView/Sample/PresentingViewController.m index 38a34fc357..b2d1d5e812 100644 --- a/examples/ASCollectionView/Sample/PresentingViewController.m +++ b/examples/ASCollectionView/Sample/PresentingViewController.m @@ -1,20 +1,10 @@ // // PresentingViewController.m -// Sample +// Texture // -// Created by Tom King on 12/23/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PresentingViewController.h" diff --git a/examples/ASCollectionView/Sample/SupplementaryNode.h b/examples/ASCollectionView/Sample/SupplementaryNode.h index 906fc50bdc..b29ec002b2 100644 --- a/examples/ASCollectionView/Sample/SupplementaryNode.h +++ b/examples/ASCollectionView/Sample/SupplementaryNode.h @@ -1,18 +1,10 @@ // // SupplementaryNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASCollectionView/Sample/SupplementaryNode.m b/examples/ASCollectionView/Sample/SupplementaryNode.m index b1b1b905c9..f4847ff00b 100644 --- a/examples/ASCollectionView/Sample/SupplementaryNode.m +++ b/examples/ASCollectionView/Sample/SupplementaryNode.m @@ -1,18 +1,10 @@ // // SupplementaryNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "SupplementaryNode.h" diff --git a/examples/ASCollectionView/Sample/ViewController.h b/examples/ASCollectionView/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples/ASCollectionView/Sample/ViewController.h +++ b/examples/ASCollectionView/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASCollectionView/Sample/ViewController.m b/examples/ASCollectionView/Sample/ViewController.m index 10c974776f..687635ee68 100644 --- a/examples/ASCollectionView/Sample/ViewController.m +++ b/examples/ASCollectionView/Sample/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/ASCollectionView/Sample/main.m b/examples/ASCollectionView/Sample/main.m index d5794dca4c..65850400e4 100644 --- a/examples/ASCollectionView/Sample/main.m +++ b/examples/ASCollectionView/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKLayoutTransition/Sample/AppDelegate.h b/examples/ASDKLayoutTransition/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/ASDKLayoutTransition/Sample/AppDelegate.h +++ b/examples/ASDKLayoutTransition/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKLayoutTransition/Sample/AppDelegate.m b/examples/ASDKLayoutTransition/Sample/AppDelegate.m index c62355c06c..d0fd66f775 100644 --- a/examples/ASDKLayoutTransition/Sample/AppDelegate.m +++ b/examples/ASDKLayoutTransition/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASDKLayoutTransition/Sample/ViewController.h b/examples/ASDKLayoutTransition/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples/ASDKLayoutTransition/Sample/ViewController.h +++ b/examples/ASDKLayoutTransition/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKLayoutTransition/Sample/ViewController.m b/examples/ASDKLayoutTransition/Sample/ViewController.m index dd8d375d13..e5d019b1d1 100644 --- a/examples/ASDKLayoutTransition/Sample/ViewController.m +++ b/examples/ASDKLayoutTransition/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/ASDKLayoutTransition/Sample/main.m b/examples/ASDKLayoutTransition/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/ASDKLayoutTransition/Sample/main.m +++ b/examples/ASDKLayoutTransition/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/AppDelegate.h b/examples/ASDKTube/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/ASDKTube/Sample/AppDelegate.h +++ b/examples/ASDKTube/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/AppDelegate.m b/examples/ASDKTube/Sample/AppDelegate.m index 738b215110..9ceabb213e 100644 --- a/examples/ASDKTube/Sample/AppDelegate.m +++ b/examples/ASDKTube/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h index 3ac85916a1..131bb38ef7 100644 --- a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h +++ b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.h @@ -1,20 +1,10 @@ // // VideoFeedNodeController.h -// Sample +// Texture // -// Created by Erekle on 5/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m index af5770f5c2..b6e53ba7a5 100644 --- a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m +++ b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m @@ -1,20 +1,10 @@ // // VideoFeedNodeController.m -// Sample +// Texture // -// Created by Erekle on 5/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "VideoFeedNodeController.h" diff --git a/examples/ASDKTube/Sample/Models/Utilities.h b/examples/ASDKTube/Sample/Models/Utilities.h index 9bcb5deee1..4fd689f18b 100644 --- a/examples/ASDKTube/Sample/Models/Utilities.h +++ b/examples/ASDKTube/Sample/Models/Utilities.h @@ -1,20 +1,10 @@ // // Utilities.h -// Sample +// Texture // -// Created by Hannah Troisi on 3/9/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #include @interface UIColor (Additions) @@ -48,4 +38,4 @@ color:(UIColor *)color firstWordColor:(UIColor *)firstWordColor; -@end \ No newline at end of file +@end diff --git a/examples/ASDKTube/Sample/Models/Utilities.m b/examples/ASDKTube/Sample/Models/Utilities.m index e28bf22736..c9998154c8 100644 --- a/examples/ASDKTube/Sample/Models/Utilities.m +++ b/examples/ASDKTube/Sample/Models/Utilities.m @@ -1,20 +1,10 @@ // // Utilities.m -// Sample +// Texture // -// Created by Hannah Troisi on 3/9/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "Utilities.h" diff --git a/examples/ASDKTube/Sample/Models/VideoModel.h b/examples/ASDKTube/Sample/Models/VideoModel.h index 11efb81ef2..c912ab45fe 100644 --- a/examples/ASDKTube/Sample/Models/VideoModel.h +++ b/examples/ASDKTube/Sample/Models/VideoModel.h @@ -1,20 +1,10 @@ // // VideoModel.h -// Sample +// Texture // -// Created by Erekle on 5/14/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/Models/VideoModel.m b/examples/ASDKTube/Sample/Models/VideoModel.m index ee82898cbd..46cd7f3da1 100644 --- a/examples/ASDKTube/Sample/Models/VideoModel.m +++ b/examples/ASDKTube/Sample/Models/VideoModel.m @@ -1,20 +1,10 @@ // // VideoModel.m -// Sample +// Texture // -// Created by Erekle on 5/14/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "VideoModel.h" diff --git a/examples/ASDKTube/Sample/Nodes/VideoContentCell.h b/examples/ASDKTube/Sample/Nodes/VideoContentCell.h index 598f8f9950..2a386f9241 100644 --- a/examples/ASDKTube/Sample/Nodes/VideoContentCell.h +++ b/examples/ASDKTube/Sample/Nodes/VideoContentCell.h @@ -1,20 +1,10 @@ // // VideoContentCell.h -// Sample +// Texture // -// Created by Erekle on 5/14/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/Nodes/VideoContentCell.m b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m index dac4ce77ce..fac4e389db 100644 --- a/examples/ASDKTube/Sample/Nodes/VideoContentCell.m +++ b/examples/ASDKTube/Sample/Nodes/VideoContentCell.m @@ -1,20 +1,10 @@ // // VideoContentCell.m -// Sample +// Texture // -// Created by Erekle on 5/14/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "VideoContentCell.h" diff --git a/examples/ASDKTube/Sample/ViewController.h b/examples/ASDKTube/Sample/ViewController.h index db689fe324..560b6a2d03 100644 --- a/examples/ASDKTube/Sample/ViewController.h +++ b/examples/ASDKTube/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/ViewController.m b/examples/ASDKTube/Sample/ViewController.m index 9cd1e72d98..0fe3274501 100644 --- a/examples/ASDKTube/Sample/ViewController.m +++ b/examples/ASDKTube/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h index 51c3bc26ef..025f3ba4fe 100644 --- a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h +++ b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.h @@ -1,20 +1,10 @@ // // WindowWithStatusBarUnderlay.h -// Sample +// Texture // -// Created by Hannah Troisi on 4/10/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m index d153a30cea..944e5307b5 100644 --- a/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m +++ b/examples/ASDKTube/Sample/WindowWithStatusBarUnderlay.m @@ -1,20 +1,10 @@ // // WindowWithStatusBarUnderlay.m -// Sample +// Texture // -// Created by Erekle on 5/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "WindowWithStatusBarUnderlay.h" diff --git a/examples/ASDKTube/Sample/main.m b/examples/ASDKTube/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/ASDKTube/Sample/main.m +++ b/examples/ASDKTube/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/ASCollectionSectionController.h b/examples/ASDKgram/Sample/ASCollectionSectionController.h index f69791bc76..1a3a8443c9 100644 --- a/examples/ASDKgram/Sample/ASCollectionSectionController.h +++ b/examples/ASDKgram/Sample/ASCollectionSectionController.h @@ -1,9 +1,9 @@ // // ASCollectionSectionController.h -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/ASCollectionSectionController.m b/examples/ASDKgram/Sample/ASCollectionSectionController.m index 2e5b657773..c1ddb42d41 100644 --- a/examples/ASDKgram/Sample/ASCollectionSectionController.m +++ b/examples/ASDKgram/Sample/ASCollectionSectionController.m @@ -1,9 +1,9 @@ // // ASCollectionSectionController.m -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ASCollectionSectionController.h" diff --git a/examples/ASDKgram/Sample/AppDelegate.h b/examples/ASDKgram/Sample/AppDelegate.h index f5a8485f9b..169cc651b5 100644 --- a/examples/ASDKgram/Sample/AppDelegate.h +++ b/examples/ASDKgram/Sample/AppDelegate.h @@ -1,20 +1,10 @@ // // AppDelegate.h -// Sample +// Texture // -// Created by Hannah Troisi on 2/16/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @interface AppDelegate : UIResponder diff --git a/examples/ASDKgram/Sample/AppDelegate.m b/examples/ASDKgram/Sample/AppDelegate.m index e1dd507baa..019c6a71b2 100644 --- a/examples/ASDKgram/Sample/AppDelegate.m +++ b/examples/ASDKgram/Sample/AppDelegate.m @@ -2,17 +2,9 @@ // AppDelegate.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASDKgram/Sample/FeedHeaderNode.h b/examples/ASDKgram/Sample/FeedHeaderNode.h index b440a05f52..13e6b16d6f 100644 --- a/examples/ASDKgram/Sample/FeedHeaderNode.h +++ b/examples/ASDKgram/Sample/FeedHeaderNode.h @@ -1,9 +1,9 @@ // // FeedHeaderNode.h -// Sample +// Texture // -// Created by Adlai Holler on 1/23/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/FeedHeaderNode.m b/examples/ASDKgram/Sample/FeedHeaderNode.m index e0c8798aa2..f620fa5087 100644 --- a/examples/ASDKgram/Sample/FeedHeaderNode.m +++ b/examples/ASDKgram/Sample/FeedHeaderNode.m @@ -1,9 +1,9 @@ // // FeedHeaderNode.m -// Sample +// Texture // -// Created by Adlai Holler on 1/23/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "FeedHeaderNode.h" diff --git a/examples/ASDKgram/Sample/ImageURLModel.h b/examples/ASDKgram/Sample/ImageURLModel.h index 88381fde8f..16828a2dac 100644 --- a/examples/ASDKgram/Sample/ImageURLModel.h +++ b/examples/ASDKgram/Sample/ImageURLModel.h @@ -1,20 +1,10 @@ // // ImageURLModel.h -// Sample +// Texture // -// Created by Hannah Troisi on 3/11/16. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @interface ImageURLModel : NSObject diff --git a/examples/ASDKgram/Sample/ImageURLModel.m b/examples/ASDKgram/Sample/ImageURLModel.m index 78c4b43714..671027db5e 100644 --- a/examples/ASDKgram/Sample/ImageURLModel.m +++ b/examples/ASDKgram/Sample/ImageURLModel.m @@ -1,20 +1,10 @@ // // ImageURLModel.m -// Sample +// Texture // -// Created by Hannah Troisi on 3/11/16. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ImageURLModel.h" diff --git a/examples/ASDKgram/Sample/PhotoCellNode.h b/examples/ASDKgram/Sample/PhotoCellNode.h index b3135a1529..7724970252 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.h +++ b/examples/ASDKgram/Sample/PhotoCellNode.h @@ -2,17 +2,9 @@ // PhotoCellNode.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoCellNode.m b/examples/ASDKgram/Sample/PhotoCellNode.m index a7bb214d21..b020db9e64 100644 --- a/examples/ASDKgram/Sample/PhotoCellNode.m +++ b/examples/ASDKgram/Sample/PhotoCellNode.m @@ -2,17 +2,9 @@ // PhotoCellNode.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoCellNode.h" diff --git a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h index 717f575609..d277b5a571 100644 --- a/examples/ASDKgram/Sample/PhotoCollectionViewCell.h +++ b/examples/ASDKgram/Sample/PhotoCollectionViewCell.h @@ -1,20 +1,10 @@ // // PhotoCollectionViewCell.h -// Sample +// Texture // -// Created by Hannah Troisi on 3/2/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoCollectionViewCell.m b/examples/ASDKgram/Sample/PhotoCollectionViewCell.m index 3f9dfe8d27..d04fe1ca5d 100644 --- a/examples/ASDKgram/Sample/PhotoCollectionViewCell.m +++ b/examples/ASDKgram/Sample/PhotoCollectionViewCell.m @@ -1,20 +1,10 @@ // // PhotoCollectionViewCell.m -// Sample +// Texture // -// Created by Hannah Troisi on 3/2/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoCollectionViewCell.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedBaseController.h b/examples/ASDKgram/Sample/PhotoFeedBaseController.h index 649494c915..b40a5946c8 100644 --- a/examples/ASDKgram/Sample/PhotoFeedBaseController.h +++ b/examples/ASDKgram/Sample/PhotoFeedBaseController.h @@ -2,17 +2,9 @@ // PhotoFeedBaseController.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/PhotoFeedBaseController.m b/examples/ASDKgram/Sample/PhotoFeedBaseController.m index d4fd574fbb..473f2fc2e3 100644 --- a/examples/ASDKgram/Sample/PhotoFeedBaseController.m +++ b/examples/ASDKgram/Sample/PhotoFeedBaseController.m @@ -2,17 +2,9 @@ // PhotoFeedBaseController.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedBaseController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedControllerProtocol.h b/examples/ASDKgram/Sample/PhotoFeedControllerProtocol.h index e7c5be3689..df5832939b 100644 --- a/examples/ASDKgram/Sample/PhotoFeedControllerProtocol.h +++ b/examples/ASDKgram/Sample/PhotoFeedControllerProtocol.h @@ -1,9 +1,9 @@ // // PhotoFeedControllerProtocol.h -// Sample +// Texture // -// Created by Michael Schneider on 2/12/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/PhotoFeedListKitViewController.h b/examples/ASDKgram/Sample/PhotoFeedListKitViewController.h index 0720363a4c..a1e3e6a338 100644 --- a/examples/ASDKgram/Sample/PhotoFeedListKitViewController.h +++ b/examples/ASDKgram/Sample/PhotoFeedListKitViewController.h @@ -1,9 +1,9 @@ // // PhotoFeedListKitViewController.h -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/PhotoFeedListKitViewController.m b/examples/ASDKgram/Sample/PhotoFeedListKitViewController.m index f01f8c8eea..950458e197 100644 --- a/examples/ASDKgram/Sample/PhotoFeedListKitViewController.m +++ b/examples/ASDKgram/Sample/PhotoFeedListKitViewController.m @@ -1,9 +1,9 @@ // // PhotoFeedListKitViewController.m -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedListKitViewController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedModel.h b/examples/ASDKgram/Sample/PhotoFeedModel.h index 97591bf79e..a71b830b37 100644 --- a/examples/ASDKgram/Sample/PhotoFeedModel.h +++ b/examples/ASDKgram/Sample/PhotoFeedModel.h @@ -2,17 +2,9 @@ // PhotoFeedModel.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedModel.m b/examples/ASDKgram/Sample/PhotoFeedModel.m index 8f7eef961e..6548f9d373 100644 --- a/examples/ASDKgram/Sample/PhotoFeedModel.m +++ b/examples/ASDKgram/Sample/PhotoFeedModel.m @@ -2,17 +2,9 @@ // PhotoFeedModel.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedModel.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.h b/examples/ASDKgram/Sample/PhotoFeedNodeController.h index c97576b7bc..e4b8553c08 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.h +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.h @@ -1,20 +1,10 @@ // // PhotoFeedNodeController.h -// Sample +// Texture // -// Created by Hannah Troisi on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedBaseController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedNodeController.m b/examples/ASDKgram/Sample/PhotoFeedNodeController.m index 9eac3e5f72..8abc80bb53 100644 --- a/examples/ASDKgram/Sample/PhotoFeedNodeController.m +++ b/examples/ASDKgram/Sample/PhotoFeedNodeController.m @@ -1,20 +1,10 @@ // // PhotoFeedNodeController.m -// Sample +// Texture // -// Created by Hannah Troisi on 2/17/16. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedNodeController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedSectionController.h b/examples/ASDKgram/Sample/PhotoFeedSectionController.h index 0da1836a68..f7d820d6e5 100644 --- a/examples/ASDKgram/Sample/PhotoFeedSectionController.h +++ b/examples/ASDKgram/Sample/PhotoFeedSectionController.h @@ -1,9 +1,9 @@ // // PhotoFeedSectionController.h -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/PhotoFeedSectionController.m b/examples/ASDKgram/Sample/PhotoFeedSectionController.m index 190a817853..b621b02525 100644 --- a/examples/ASDKgram/Sample/PhotoFeedSectionController.m +++ b/examples/ASDKgram/Sample/PhotoFeedSectionController.m @@ -1,9 +1,9 @@ // // PhotoFeedSectionController.m -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedSectionController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.h b/examples/ASDKgram/Sample/PhotoFeedViewController.h index 3733fde82b..14295d0bbc 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.h +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.h @@ -1,20 +1,10 @@ // // PhotoFeedViewController.h -// Sample +// Texture // -// Created by Hannah Troisi on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedBaseController.h" diff --git a/examples/ASDKgram/Sample/PhotoFeedViewController.m b/examples/ASDKgram/Sample/PhotoFeedViewController.m index 5f78eb1bfb..c3f9a4aefe 100644 --- a/examples/ASDKgram/Sample/PhotoFeedViewController.m +++ b/examples/ASDKgram/Sample/PhotoFeedViewController.m @@ -2,17 +2,9 @@ // PhotoFeedViewController.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoFeedViewController.h" diff --git a/examples/ASDKgram/Sample/PhotoModel.h b/examples/ASDKgram/Sample/PhotoModel.h index bc5950437f..95c1a8130c 100644 --- a/examples/ASDKgram/Sample/PhotoModel.h +++ b/examples/ASDKgram/Sample/PhotoModel.h @@ -2,17 +2,9 @@ // PhotoModel.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "UserModel.h" diff --git a/examples/ASDKgram/Sample/PhotoModel.m b/examples/ASDKgram/Sample/PhotoModel.m index b1c39f5083..0662e71ae5 100644 --- a/examples/ASDKgram/Sample/PhotoModel.m +++ b/examples/ASDKgram/Sample/PhotoModel.m @@ -2,17 +2,9 @@ // PhotoModel.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.h b/examples/ASDKgram/Sample/PhotoTableViewCell.h index 5e0620f2e2..47e8e913f7 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.h +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.h @@ -2,17 +2,9 @@ // PhotoTableViewCell.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoModel.h" diff --git a/examples/ASDKgram/Sample/PhotoTableViewCell.m b/examples/ASDKgram/Sample/PhotoTableViewCell.m index 3fea610f01..9cc5fa785b 100644 --- a/examples/ASDKgram/Sample/PhotoTableViewCell.m +++ b/examples/ASDKgram/Sample/PhotoTableViewCell.m @@ -2,17 +2,9 @@ // PhotoTableViewCell.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PhotoTableViewCell.h" diff --git a/examples/ASDKgram/Sample/RefreshingSectionControllerType.h b/examples/ASDKgram/Sample/RefreshingSectionControllerType.h index 892a3a32ce..169a996012 100644 --- a/examples/ASDKgram/Sample/RefreshingSectionControllerType.h +++ b/examples/ASDKgram/Sample/RefreshingSectionControllerType.h @@ -1,9 +1,9 @@ // // RefreshingSectionControllerType.h -// Sample +// Texture // -// Created by Adlai Holler on 12/29/16. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/TailLoadingNode.h b/examples/ASDKgram/Sample/TailLoadingNode.h index 177a938e10..ae514231f6 100644 --- a/examples/ASDKgram/Sample/TailLoadingNode.h +++ b/examples/ASDKgram/Sample/TailLoadingNode.h @@ -1,9 +1,9 @@ // // TailLoadingNode.h -// Sample +// Texture // -// Created by Adlai Holler on 1/3/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/TailLoadingNode.m b/examples/ASDKgram/Sample/TailLoadingNode.m index 9f096db706..9211ac4c13 100644 --- a/examples/ASDKgram/Sample/TailLoadingNode.m +++ b/examples/ASDKgram/Sample/TailLoadingNode.m @@ -1,9 +1,9 @@ // // TailLoadingNode.m -// Sample +// Texture // -// Created by Adlai Holler on 1/3/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TailLoadingNode.h" diff --git a/examples/ASDKgram/Sample/TextureConfigDelegate.m b/examples/ASDKgram/Sample/TextureConfigDelegate.m index 0905a646ef..b6a2ae9717 100644 --- a/examples/ASDKgram/Sample/TextureConfigDelegate.m +++ b/examples/ASDKgram/Sample/TextureConfigDelegate.m @@ -2,12 +2,8 @@ // TextureConfigDelegate.m // Texture // -// Copyright (c) 2018-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASDKgram/Sample/UserModel.h b/examples/ASDKgram/Sample/UserModel.h index 5b57c13e14..299ddb1869 100644 --- a/examples/ASDKgram/Sample/UserModel.h +++ b/examples/ASDKgram/Sample/UserModel.h @@ -2,17 +2,9 @@ // UserModel.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @interface UserModel : NSObject diff --git a/examples/ASDKgram/Sample/UserModel.m b/examples/ASDKgram/Sample/UserModel.m index e428ad3c22..53e3626026 100644 --- a/examples/ASDKgram/Sample/UserModel.m +++ b/examples/ASDKgram/Sample/UserModel.m @@ -2,17 +2,9 @@ // UserModel.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "UserModel.h" diff --git a/examples/ASDKgram/Sample/Utilities.h b/examples/ASDKgram/Sample/Utilities.h index 7e9e16cd08..63f2ab0553 100644 --- a/examples/ASDKgram/Sample/Utilities.h +++ b/examples/ASDKgram/Sample/Utilities.h @@ -1,20 +1,10 @@ // // Utilities.h -// Sample +// Texture // -// Created by Hannah Troisi on 3/9/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @interface UIColor (Additions) @@ -47,4 +37,4 @@ color:(UIColor *)color firstWordColor:(UIColor *)firstWordColor; -@end \ No newline at end of file +@end diff --git a/examples/ASDKgram/Sample/Utilities.m b/examples/ASDKgram/Sample/Utilities.m index 556a3a2d2c..732c5f8171 100644 --- a/examples/ASDKgram/Sample/Utilities.m +++ b/examples/ASDKgram/Sample/Utilities.m @@ -1,20 +1,10 @@ // // Utilities.m -// Sample +// Texture // -// Created by Hannah Troisi on 3/9/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "Utilities.h" diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h index b12509a43b..d9fb31778d 100644 --- a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.h @@ -1,20 +1,10 @@ // // WindowWithStatusBarUnderlay.h -// Sample +// Texture // -// Created by Hannah Troisi on 4/10/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m index c98fcf4d0e..91670c2985 100644 --- a/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m +++ b/examples/ASDKgram/Sample/WindowWithStatusBarUnderlay.m @@ -1,20 +1,10 @@ // // WindowWithStatusBarUnderlay.m -// Sample +// Texture // -// Created by Hannah Troisi on 4/10/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "WindowWithStatusBarUnderlay.h" diff --git a/examples/ASDKgram/Sample/main.m b/examples/ASDKgram/Sample/main.m index 89f1d26c20..fb6be69952 100644 --- a/examples/ASDKgram/Sample/main.m +++ b/examples/ASDKgram/Sample/main.m @@ -1,20 +1,10 @@ // // main.m -// Sample +// Texture // -// Created by Hannah Troisi on 2/16/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASMapNode/Sample/AppDelegate.h b/examples/ASMapNode/Sample/AppDelegate.h index 4591d34854..8d58a13cbe 100644 --- a/examples/ASMapNode/Sample/AppDelegate.h +++ b/examples/ASMapNode/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASMapNode/Sample/AppDelegate.m b/examples/ASMapNode/Sample/AppDelegate.m index 7cf75f8bb7..cae730c64e 100644 --- a/examples/ASMapNode/Sample/AppDelegate.m +++ b/examples/ASMapNode/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASMapNode/Sample/CustomMapAnnotation.h b/examples/ASMapNode/Sample/CustomMapAnnotation.h index d94f0153f4..22e62ab7e4 100644 --- a/examples/ASMapNode/Sample/CustomMapAnnotation.h +++ b/examples/ASMapNode/Sample/CustomMapAnnotation.h @@ -1,18 +1,10 @@ // // CustomMapAnnotation.h -// ASDKMapTest +// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASMapNode/Sample/CustomMapAnnotation.m b/examples/ASMapNode/Sample/CustomMapAnnotation.m index a5da10ac94..c6843dcc3c 100644 --- a/examples/ASMapNode/Sample/CustomMapAnnotation.m +++ b/examples/ASMapNode/Sample/CustomMapAnnotation.m @@ -1,18 +1,10 @@ // // CustomMapAnnotation.m -// ASDKMapTest +// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "CustomMapAnnotation.h" diff --git a/examples/ASMapNode/Sample/MapHandlerNode.h b/examples/ASMapNode/Sample/MapHandlerNode.h index 29c77c7131..46a4d74686 100644 --- a/examples/ASMapNode/Sample/MapHandlerNode.h +++ b/examples/ASMapNode/Sample/MapHandlerNode.h @@ -2,17 +2,9 @@ // MapHandlerNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASMapNode/Sample/MapHandlerNode.m b/examples/ASMapNode/Sample/MapHandlerNode.m index 0f6f4a0e27..9226253a10 100644 --- a/examples/ASMapNode/Sample/MapHandlerNode.m +++ b/examples/ASMapNode/Sample/MapHandlerNode.m @@ -2,17 +2,9 @@ // MapHandlerNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "MapHandlerNode.h" diff --git a/examples/ASMapNode/Sample/ViewController.h b/examples/ASMapNode/Sample/ViewController.h index c2a4b5f166..7054e2d89c 100644 --- a/examples/ASMapNode/Sample/ViewController.h +++ b/examples/ASMapNode/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASMapNode/Sample/ViewController.m b/examples/ASMapNode/Sample/ViewController.m index 4dc690ae34..390532d662 100644 --- a/examples/ASMapNode/Sample/ViewController.m +++ b/examples/ASMapNode/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/ASMapNode/Sample/main.m b/examples/ASMapNode/Sample/main.m index 791ef4b743..0e5da05001 100644 --- a/examples/ASMapNode/Sample/main.m +++ b/examples/ASMapNode/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/AppDelegate.h b/examples/ASViewController/Sample/AppDelegate.h index 4591d34854..8d58a13cbe 100644 --- a/examples/ASViewController/Sample/AppDelegate.h +++ b/examples/ASViewController/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/AppDelegate.m b/examples/ASViewController/Sample/AppDelegate.m index 8e3f33a9dc..ed2724b182 100644 --- a/examples/ASViewController/Sample/AppDelegate.m +++ b/examples/ASViewController/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/ASViewController/Sample/DetailCellNode.h b/examples/ASViewController/Sample/DetailCellNode.h index e80b6dc6cb..d524ff1c02 100644 --- a/examples/ASViewController/Sample/DetailCellNode.h +++ b/examples/ASViewController/Sample/DetailCellNode.h @@ -1,18 +1,10 @@ // // DetailCellNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/DetailCellNode.m b/examples/ASViewController/Sample/DetailCellNode.m index d069f75c18..edc9932076 100644 --- a/examples/ASViewController/Sample/DetailCellNode.m +++ b/examples/ASViewController/Sample/DetailCellNode.m @@ -1,18 +1,10 @@ // // DetailCellNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "DetailCellNode.h" diff --git a/examples/ASViewController/Sample/DetailRootNode.h b/examples/ASViewController/Sample/DetailRootNode.h index a60ce8007b..648900b30e 100644 --- a/examples/ASViewController/Sample/DetailRootNode.h +++ b/examples/ASViewController/Sample/DetailRootNode.h @@ -1,18 +1,10 @@ // // DetailRootNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/DetailRootNode.m b/examples/ASViewController/Sample/DetailRootNode.m index 333af36e6c..5d478059d9 100644 --- a/examples/ASViewController/Sample/DetailRootNode.m +++ b/examples/ASViewController/Sample/DetailRootNode.m @@ -1,18 +1,10 @@ // // DetailRootNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "DetailRootNode.h" diff --git a/examples/ASViewController/Sample/DetailViewController.h b/examples/ASViewController/Sample/DetailViewController.h index f11bfaf42c..0c5eb85891 100644 --- a/examples/ASViewController/Sample/DetailViewController.h +++ b/examples/ASViewController/Sample/DetailViewController.h @@ -1,18 +1,10 @@ // // DetailViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/DetailViewController.m b/examples/ASViewController/Sample/DetailViewController.m index 494efd4ffd..2d6471cd5d 100644 --- a/examples/ASViewController/Sample/DetailViewController.m +++ b/examples/ASViewController/Sample/DetailViewController.m @@ -1,18 +1,10 @@ // // DetailViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "DetailViewController.h" diff --git a/examples/ASViewController/Sample/ViewController.h b/examples/ASViewController/Sample/ViewController.h index 9ece2de58d..f1700621f0 100644 --- a/examples/ASViewController/Sample/ViewController.h +++ b/examples/ASViewController/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/ASViewController/Sample/ViewController.m b/examples/ASViewController/Sample/ViewController.m index 9e70c99c54..f66c7add93 100644 --- a/examples/ASViewController/Sample/ViewController.m +++ b/examples/ASViewController/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/ASViewController/Sample/main.m b/examples/ASViewController/Sample/main.m index 791ef4b743..0e5da05001 100644 --- a/examples/ASViewController/Sample/main.m +++ b/examples/ASViewController/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h index b7889999d5..8d58a13cbe 100644 --- a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h +++ b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.h @@ -1,20 +1,10 @@ // // AppDelegate.h -// Sample +// Texture // -// Created by Garrett Moon on 3/22/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m index ae73c318d9..a21b00ffd1 100644 --- a/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m +++ b/examples/AnimatedGIF/ASAnimatedImage/AppDelegate.m @@ -1,20 +1,10 @@ // // AppDelegate.m -// Sample +// Texture // -// Created by Garrett Moon on 3/22/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/AnimatedGIF/ASAnimatedImage/ViewController.h b/examples/AnimatedGIF/ASAnimatedImage/ViewController.h index 73a4c39a3d..4627e29285 100644 --- a/examples/AnimatedGIF/ASAnimatedImage/ViewController.h +++ b/examples/AnimatedGIF/ASAnimatedImage/ViewController.h @@ -1,20 +1,10 @@ // // ViewController.h -// Sample +// Texture // -// Created by Garrett Moon on 3/22/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AnimatedGIF/ASAnimatedImage/ViewController.m b/examples/AnimatedGIF/ASAnimatedImage/ViewController.m index fe9b30bb33..6fd98321db 100644 --- a/examples/AnimatedGIF/ASAnimatedImage/ViewController.m +++ b/examples/AnimatedGIF/ASAnimatedImage/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/AnimatedGIF/ASAnimatedImage/main.m b/examples/AnimatedGIF/ASAnimatedImage/main.m index a07ed9d945..65850400e4 100644 --- a/examples/AnimatedGIF/ASAnimatedImage/main.m +++ b/examples/AnimatedGIF/ASAnimatedImage/main.m @@ -1,20 +1,10 @@ // // main.m -// Sample +// Texture // -// Created by Garrett Moon on 3/22/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h index c77e4095e2..8d58a13cbe 100644 --- a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h +++ b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.h @@ -1,20 +1,10 @@ // // AppDelegate.h -// Sample +// Texture // -// Created by Michael Schneider on 4/24/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m index ae97a27ae5..8221f4c755 100644 --- a/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m +++ b/examples/AsyncDisplayKitOverview/Sample/AppDelegate.m @@ -1,20 +1,10 @@ // // AppDelegate.m -// Sample +// Texture // -// Created by Michael Schneider on 4/24/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h index 6be9dfaa7a..8fc32e4e43 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.h @@ -1,20 +1,9 @@ // // OverviewASCollectionNode.h -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m index 78c8615ede..5d29eea95e 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASCollectionNode.m @@ -1,20 +1,9 @@ // // OverviewASCollectionNode.m -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewASCollectionNode.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h index 824d1fb5c0..dd6d09d014 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.h @@ -1,20 +1,9 @@ // // OverviewASPagerNode.h -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m index ac91a7a3d0..7e37448497 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASPagerNode.m @@ -1,20 +1,9 @@ // // OverviewASPagerNode.m -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewASPagerNode.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h index c2ba8e5323..f80af0d2c9 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.h @@ -1,20 +1,9 @@ // // OverviewASTableNode.h -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m index 1a94fdbf84..de050c3694 100644 --- a/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m +++ b/examples/AsyncDisplayKitOverview/Sample/Node Containers/OverviewASTableNode.m @@ -1,20 +1,9 @@ // // OverviewASTableNode.m -// Sample +// Texture // -// Created by Michael Schneider on 4/17/16. -// -// 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. -// -// 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. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewASTableNode.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h index 9e838b4fba..cae34ad209 100644 --- a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.h @@ -1,20 +1,10 @@ // // OverviewComponentsViewController.h -// Sample +// Texture // -// Created by Michael Schneider on 4/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m index c49f64cca2..740d975d2a 100644 --- a/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewComponentsViewController.m @@ -1,20 +1,10 @@ // // OverviewComponentsViewController.m -// Sample +// Texture // -// Created by Michael Schneider on 4/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewComponentsViewController.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h index b3fae243c5..8a006b4428 100644 --- a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.h @@ -1,20 +1,10 @@ // // OverviewDetailViewController.h -// Sample +// Texture // -// Created by Michael Schneider on 4/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m index af2a39cb6b..b81b307921 100644 --- a/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m +++ b/examples/AsyncDisplayKitOverview/Sample/OverviewDetailViewController.m @@ -1,20 +1,10 @@ // // OverviewDetailViewController.m -// Sample +// Texture // -// Created by Michael Schneider on 4/15/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewDetailViewController.h" diff --git a/examples/AsyncDisplayKitOverview/Sample/main.m b/examples/AsyncDisplayKitOverview/Sample/main.m index 63beb381e8..0e5da05001 100644 --- a/examples/AsyncDisplayKitOverview/Sample/main.m +++ b/examples/AsyncDisplayKitOverview/Sample/main.m @@ -1,20 +1,10 @@ // // main.m -// Sample +// Texture // -// Created by Michael Schneider on 4/24/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/AppDelegate.h b/examples/CatDealsCollectionView/Sample/AppDelegate.h index b977c7498f..db20870a31 100644 --- a/examples/CatDealsCollectionView/Sample/AppDelegate.h +++ b/examples/CatDealsCollectionView/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/AppDelegate.m b/examples/CatDealsCollectionView/Sample/AppDelegate.m index b30facbbb5..d626041192 100644 --- a/examples/CatDealsCollectionView/Sample/AppDelegate.m +++ b/examples/CatDealsCollectionView/Sample/AppDelegate.m @@ -2,17 +2,9 @@ // AppDelegate.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/CatDealsCollectionView/Sample/BlurbNode.h b/examples/CatDealsCollectionView/Sample/BlurbNode.h index e40f99d8a6..5451fb39f0 100644 --- a/examples/CatDealsCollectionView/Sample/BlurbNode.h +++ b/examples/CatDealsCollectionView/Sample/BlurbNode.h @@ -2,17 +2,9 @@ // BlurbNode.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/BlurbNode.m b/examples/CatDealsCollectionView/Sample/BlurbNode.m index 0b358273c0..9c72b6d573 100644 --- a/examples/CatDealsCollectionView/Sample/BlurbNode.m +++ b/examples/CatDealsCollectionView/Sample/BlurbNode.m @@ -2,17 +2,9 @@ // BlurbNode.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "BlurbNode.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemNode.h b/examples/CatDealsCollectionView/Sample/ItemNode.h index bb0f06857d..19bfec29cc 100644 --- a/examples/CatDealsCollectionView/Sample/ItemNode.h +++ b/examples/CatDealsCollectionView/Sample/ItemNode.h @@ -2,17 +2,9 @@ // ItemNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/ItemNode.m b/examples/CatDealsCollectionView/Sample/ItemNode.m index 4fd76e8a01..f118c282a2 100644 --- a/examples/CatDealsCollectionView/Sample/ItemNode.m +++ b/examples/CatDealsCollectionView/Sample/ItemNode.m @@ -2,17 +2,9 @@ // ItemNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ItemNode.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemStyles.h b/examples/CatDealsCollectionView/Sample/ItemStyles.h index 09d3b81c88..db4d0d08d5 100644 --- a/examples/CatDealsCollectionView/Sample/ItemStyles.h +++ b/examples/CatDealsCollectionView/Sample/ItemStyles.h @@ -2,17 +2,9 @@ // ItemStyles.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/ItemStyles.m b/examples/CatDealsCollectionView/Sample/ItemStyles.m index 690980d49c..1659341161 100644 --- a/examples/CatDealsCollectionView/Sample/ItemStyles.m +++ b/examples/CatDealsCollectionView/Sample/ItemStyles.m @@ -2,17 +2,9 @@ // ItemStyles.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ItemStyles.h" diff --git a/examples/CatDealsCollectionView/Sample/ItemViewModel.h b/examples/CatDealsCollectionView/Sample/ItemViewModel.h index 621b4060a9..489a10515b 100644 --- a/examples/CatDealsCollectionView/Sample/ItemViewModel.h +++ b/examples/CatDealsCollectionView/Sample/ItemViewModel.h @@ -2,17 +2,9 @@ // ItemViewModel.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/ItemViewModel.m b/examples/CatDealsCollectionView/Sample/ItemViewModel.m index 6206e399c2..8f60900c60 100644 --- a/examples/CatDealsCollectionView/Sample/ItemViewModel.m +++ b/examples/CatDealsCollectionView/Sample/ItemViewModel.m @@ -2,17 +2,9 @@ // ItemViewModel.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ItemViewModel.h" diff --git a/examples/CatDealsCollectionView/Sample/LoadingNode.h b/examples/CatDealsCollectionView/Sample/LoadingNode.h index 6c07157265..996a6798cf 100644 --- a/examples/CatDealsCollectionView/Sample/LoadingNode.h +++ b/examples/CatDealsCollectionView/Sample/LoadingNode.h @@ -2,17 +2,9 @@ // LoadingNode.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/LoadingNode.m b/examples/CatDealsCollectionView/Sample/LoadingNode.m index 03a6825c65..18681c011c 100644 --- a/examples/CatDealsCollectionView/Sample/LoadingNode.m +++ b/examples/CatDealsCollectionView/Sample/LoadingNode.m @@ -2,17 +2,9 @@ // LoadingNode.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "LoadingNode.h" diff --git a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h index 31470610bd..a18e17c9ea 100644 --- a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h +++ b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.h @@ -2,17 +2,9 @@ // PlaceholderNetworkImageNode.h // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m index e7f0de47f9..81129392a9 100644 --- a/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m +++ b/examples/CatDealsCollectionView/Sample/PlaceholderNetworkImageNode.m @@ -2,17 +2,9 @@ // PlaceholderNetworkImageNode.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PlaceholderNetworkImageNode.h" diff --git a/examples/CatDealsCollectionView/Sample/PresentingViewController.h b/examples/CatDealsCollectionView/Sample/PresentingViewController.h index f0c2a76e37..44c07c6a76 100644 --- a/examples/CatDealsCollectionView/Sample/PresentingViewController.h +++ b/examples/CatDealsCollectionView/Sample/PresentingViewController.h @@ -1,20 +1,10 @@ // // PresentingViewController.h -// Sample +// Texture // -// Created by Tom King on 12/23/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/PresentingViewController.m b/examples/CatDealsCollectionView/Sample/PresentingViewController.m index 53f297f9e3..216cf4dd28 100644 --- a/examples/CatDealsCollectionView/Sample/PresentingViewController.m +++ b/examples/CatDealsCollectionView/Sample/PresentingViewController.m @@ -1,20 +1,10 @@ // // PresentingViewController.m -// Sample +// Texture // -// Created by Tom King on 12/23/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PresentingViewController.h" diff --git a/examples/CatDealsCollectionView/Sample/ViewController.h b/examples/CatDealsCollectionView/Sample/ViewController.h index db689fe324..560b6a2d03 100644 --- a/examples/CatDealsCollectionView/Sample/ViewController.h +++ b/examples/CatDealsCollectionView/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CatDealsCollectionView/Sample/ViewController.m b/examples/CatDealsCollectionView/Sample/ViewController.m index 78b58d67a6..c1f9111ad0 100644 --- a/examples/CatDealsCollectionView/Sample/ViewController.m +++ b/examples/CatDealsCollectionView/Sample/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/CatDealsCollectionView/Sample/main.m b/examples/CatDealsCollectionView/Sample/main.m index d5794dca4c..65850400e4 100644 --- a/examples/CatDealsCollectionView/Sample/main.m +++ b/examples/CatDealsCollectionView/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView-Swift/Sample/AppDelegate.swift b/examples/CustomCollectionView-Swift/Sample/AppDelegate.swift index 7606d4f94e..5556f8c77e 100644 --- a/examples/CustomCollectionView-Swift/Sample/AppDelegate.swift +++ b/examples/CustomCollectionView-Swift/Sample/AppDelegate.swift @@ -1,23 +1,10 @@ // // AppDelegate.swift -// 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. -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/CustomCollectionView-Swift/Sample/ImageCellNode.swift b/examples/CustomCollectionView-Swift/Sample/ImageCellNode.swift index ecd0e358b1..70c1692679 100644 --- a/examples/CustomCollectionView-Swift/Sample/ImageCellNode.swift +++ b/examples/CustomCollectionView-Swift/Sample/ImageCellNode.swift @@ -1,23 +1,10 @@ // // ImageCellNode.swift -// 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. -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/CustomCollectionView-Swift/Sample/MosaicCollectionViewLayout.swift b/examples/CustomCollectionView-Swift/Sample/MosaicCollectionViewLayout.swift old mode 100755 new mode 100644 index 96c9eae851..976481c8d2 --- a/examples/CustomCollectionView-Swift/Sample/MosaicCollectionViewLayout.swift +++ b/examples/CustomCollectionView-Swift/Sample/MosaicCollectionViewLayout.swift @@ -1,23 +1,10 @@ // -// MosaicCollectionViewLayout -// Sample +// MosaicCollectionViewLayout.swift +// 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. -// 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 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples/CustomCollectionView-Swift/Sample/ViewController.swift b/examples/CustomCollectionView-Swift/Sample/ViewController.swift index a4ee85df93..24345cdcef 100644 --- a/examples/CustomCollectionView-Swift/Sample/ViewController.swift +++ b/examples/CustomCollectionView-Swift/Sample/ViewController.swift @@ -1,18 +1,10 @@ // // ViewController.swift -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/CustomCollectionView/Sample/AppDelegate.h b/examples/CustomCollectionView/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/CustomCollectionView/Sample/AppDelegate.h +++ b/examples/CustomCollectionView/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/AppDelegate.m b/examples/CustomCollectionView/Sample/AppDelegate.m index dec3c29fe7..867dafbc92 100644 --- a/examples/CustomCollectionView/Sample/AppDelegate.m +++ b/examples/CustomCollectionView/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/CustomCollectionView/Sample/ImageCellNode.h b/examples/CustomCollectionView/Sample/ImageCellNode.h index 970503c00d..787ee041ca 100644 --- a/examples/CustomCollectionView/Sample/ImageCellNode.h +++ b/examples/CustomCollectionView/Sample/ImageCellNode.h @@ -1,20 +1,10 @@ // // ImageCellNode.h -// Sample +// Texture // -// Created by McCallum, Levi on 11/22/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/ImageCellNode.m b/examples/CustomCollectionView/Sample/ImageCellNode.m index 4292b0f189..9e3e4a72ff 100644 --- a/examples/CustomCollectionView/Sample/ImageCellNode.m +++ b/examples/CustomCollectionView/Sample/ImageCellNode.m @@ -2,17 +2,9 @@ // ImageCellNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ImageCellNode.h" diff --git a/examples/CustomCollectionView/Sample/ImageCollectionViewCell.h b/examples/CustomCollectionView/Sample/ImageCollectionViewCell.h index 8ca69a4239..8359fb72a0 100644 --- a/examples/CustomCollectionView/Sample/ImageCollectionViewCell.h +++ b/examples/CustomCollectionView/Sample/ImageCollectionViewCell.h @@ -1,9 +1,9 @@ // // ImageCollectionViewCell.h -// Sample +// Texture // -// Created by Hannah Troisi on 1/28/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/ImageCollectionViewCell.m b/examples/CustomCollectionView/Sample/ImageCollectionViewCell.m index 9ef4a66281..c04c865039 100644 --- a/examples/CustomCollectionView/Sample/ImageCollectionViewCell.m +++ b/examples/CustomCollectionView/Sample/ImageCollectionViewCell.m @@ -1,9 +1,9 @@ // // ImageCollectionViewCell.m -// Sample +// Texture // -// Created by Hannah Troisi on 1/28/17. -// Copyright © 2017 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ImageCollectionViewCell.h" diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.h b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.h index 78a3f7a17e..b6651953d1 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.h +++ b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.h @@ -2,12 +2,8 @@ // MosaicCollectionLayoutDelegate.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.m b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.m index 196925c912..1715e1c374 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.m +++ b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutDelegate.m @@ -2,12 +2,8 @@ // MosaicCollectionLayoutDelegate.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "MosaicCollectionLayoutDelegate.h" diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.h b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.h index 1e7db52043..b887e1d2be 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.h +++ b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.h @@ -2,12 +2,8 @@ // MosaicCollectionLayoutInfo.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.m b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.m index f7a4224ab3..9eb80c2186 100644 --- a/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.m +++ b/examples/CustomCollectionView/Sample/MosaicCollectionLayoutInfo.m @@ -2,12 +2,8 @@ // MosaicCollectionLayoutInfo.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "MosaicCollectionLayoutInfo.h" diff --git a/examples/CustomCollectionView/Sample/ViewController.h b/examples/CustomCollectionView/Sample/ViewController.h index fb75aa3056..da850f7446 100644 --- a/examples/CustomCollectionView/Sample/ViewController.h +++ b/examples/CustomCollectionView/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/CustomCollectionView/Sample/ViewController.m b/examples/CustomCollectionView/Sample/ViewController.m index 65445a557c..7715fc8c07 100644 --- a/examples/CustomCollectionView/Sample/ViewController.m +++ b/examples/CustomCollectionView/Sample/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/CustomCollectionView/Sample/main.m b/examples/CustomCollectionView/Sample/main.m index d5794dca4c..65850400e4 100644 --- a/examples/CustomCollectionView/Sample/main.m +++ b/examples/CustomCollectionView/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m index 58fe564898..f8437855b0 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h index 07133747fb..49b6e48d09 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.h @@ -1,18 +1,10 @@ // // HorizontalScrollCellNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm index 9f2f355e9a..0794643893 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm +++ b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm @@ -1,18 +1,10 @@ // // HorizontalScrollCellNode.mm -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "HorizontalScrollCellNode.h" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h index 19e86e5712..85b53290cc 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.h @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.h -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m index fce6ea56e9..83d9ed6795 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.m -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "RandomCoreGraphicsNode.h" diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h index db689fe324..560b6a2d03 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h +++ b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m index 876775f35c..f1b1858825 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/main.m b/examples/HorizontalWithinVerticalScrolling/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/main.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Kittens/Sample/AppDelegate.h b/examples/Kittens/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples/Kittens/Sample/AppDelegate.h +++ b/examples/Kittens/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Kittens/Sample/AppDelegate.m b/examples/Kittens/Sample/AppDelegate.m index e683d16d4f..d9465e0de7 100644 --- a/examples/Kittens/Sample/AppDelegate.m +++ b/examples/Kittens/Sample/AppDelegate.m @@ -2,17 +2,9 @@ // AppDelegate.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/Kittens/Sample/BlurbNode.h b/examples/Kittens/Sample/BlurbNode.h index e6574bcd05..5451fb39f0 100644 --- a/examples/Kittens/Sample/BlurbNode.h +++ b/examples/Kittens/Sample/BlurbNode.h @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Kittens/Sample/BlurbNode.m b/examples/Kittens/Sample/BlurbNode.m index 7b02ae93de..6014711d33 100644 --- a/examples/Kittens/Sample/BlurbNode.m +++ b/examples/Kittens/Sample/BlurbNode.m @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "BlurbNode.h" diff --git a/examples/Kittens/Sample/KittenNode.h b/examples/Kittens/Sample/KittenNode.h index 9193b9df29..5b0b04203e 100644 --- a/examples/Kittens/Sample/KittenNode.h +++ b/examples/Kittens/Sample/KittenNode.h @@ -1,18 +1,10 @@ // // KittenNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Kittens/Sample/KittenNode.mm b/examples/Kittens/Sample/KittenNode.mm index c27d54bd2c..f8ae2ef2e6 100644 --- a/examples/Kittens/Sample/KittenNode.mm +++ b/examples/Kittens/Sample/KittenNode.mm @@ -1,18 +1,10 @@ // // KittenNode.mm -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "KittenNode.h" diff --git a/examples/Kittens/Sample/ViewController.h b/examples/Kittens/Sample/ViewController.h index db689fe324..560b6a2d03 100644 --- a/examples/Kittens/Sample/ViewController.h +++ b/examples/Kittens/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Kittens/Sample/ViewController.m b/examples/Kittens/Sample/ViewController.m index 38d01d6f55..552f482886 100644 --- a/examples/Kittens/Sample/ViewController.m +++ b/examples/Kittens/Sample/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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) through the 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/Kittens/Sample/main.m b/examples/Kittens/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/Kittens/Sample/main.m +++ b/examples/Kittens/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples-Swift/Sample/AppDelegate.swift b/examples/LayoutSpecExamples-Swift/Sample/AppDelegate.swift index 6cce6558a8..9a465c6de8 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/AppDelegate.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/AppDelegate.swift @@ -1,18 +1,10 @@ // // AppDelegate.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode+Layouts.swift b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode+Layouts.swift index c2d53a8f22..cf6bfbf1a6 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode+Layouts.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode+Layouts.swift @@ -1,18 +1,10 @@ // // LayoutExampleNode+Layouts.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift index 8be3356839..c113e07d37 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleNode.swift @@ -1,18 +1,10 @@ // // LayoutExampleNode.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleViewController.swift b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleViewController.swift index 1deccf05eb..25a391694f 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleViewController.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/LayoutExampleViewController.swift @@ -1,18 +1,10 @@ // // LayoutExampleViewController.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/OverviewCellNode.swift b/examples/LayoutSpecExamples-Swift/Sample/OverviewCellNode.swift index 2db4b5c4a9..e6e511b62d 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/OverviewCellNode.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/OverviewCellNode.swift @@ -1,18 +1,10 @@ // // OverviewCellNode.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/OverviewViewController.swift b/examples/LayoutSpecExamples-Swift/Sample/OverviewViewController.swift index e4b6f5d5a4..c43856f11a 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/OverviewViewController.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/OverviewViewController.swift @@ -1,18 +1,10 @@ // // OverviewViewController.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/LayoutSpecExamples-Swift/Sample/Utilities.swift b/examples/LayoutSpecExamples-Swift/Sample/Utilities.swift index 1f1bad89ce..f235be8166 100644 --- a/examples/LayoutSpecExamples-Swift/Sample/Utilities.swift +++ b/examples/LayoutSpecExamples-Swift/Sample/Utilities.swift @@ -1,18 +1,10 @@ // // Utilities.swift -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/LayoutSpecExamples/Sample/AppDelegate.h b/examples/LayoutSpecExamples/Sample/AppDelegate.h index 32777218dd..d5c7194563 100644 --- a/examples/LayoutSpecExamples/Sample/AppDelegate.h +++ b/examples/LayoutSpecExamples/Sample/AppDelegate.h @@ -1,11 +1,10 @@ // // AppDelegate.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/AppDelegate.m b/examples/LayoutSpecExamples/Sample/AppDelegate.m index 88772c00d2..73fc27af6e 100644 --- a/examples/LayoutSpecExamples/Sample/AppDelegate.m +++ b/examples/LayoutSpecExamples/Sample/AppDelegate.m @@ -1,11 +1,10 @@ // // AppDelegate.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h index 65241146ba..484ba5d418 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.h @@ -2,17 +2,9 @@ // LayoutExampleNodes.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m index 9b84cb16e4..5d9d63663f 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleNodes.m @@ -2,17 +2,9 @@ // LayoutExampleNodes.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "LayoutExampleNodes.h" diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.h b/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.h index 6426a8d8a2..d087bcc77f 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.h +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.h @@ -1,11 +1,10 @@ // // LayoutExampleViewController.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.m b/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.m index cc3cddc3cb..71607a6f87 100644 --- a/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.m +++ b/examples/LayoutSpecExamples/Sample/LayoutExampleViewController.m @@ -1,11 +1,10 @@ // // LayoutExampleViewController.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "LayoutExampleViewController.h" diff --git a/examples/LayoutSpecExamples/Sample/OverviewCellNode.h b/examples/LayoutSpecExamples/Sample/OverviewCellNode.h index 28926d294a..7a98c031cd 100644 --- a/examples/LayoutSpecExamples/Sample/OverviewCellNode.h +++ b/examples/LayoutSpecExamples/Sample/OverviewCellNode.h @@ -1,11 +1,10 @@ // // OverviewCellNode.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/OverviewCellNode.m b/examples/LayoutSpecExamples/Sample/OverviewCellNode.m index bab20e61d3..6cd4eb845f 100644 --- a/examples/LayoutSpecExamples/Sample/OverviewCellNode.m +++ b/examples/LayoutSpecExamples/Sample/OverviewCellNode.m @@ -1,11 +1,10 @@ // // OverviewCellNode.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewCellNode.h" diff --git a/examples/LayoutSpecExamples/Sample/OverviewViewController.h b/examples/LayoutSpecExamples/Sample/OverviewViewController.h index c05e4fd7a2..83381429a3 100644 --- a/examples/LayoutSpecExamples/Sample/OverviewViewController.h +++ b/examples/LayoutSpecExamples/Sample/OverviewViewController.h @@ -1,11 +1,10 @@ // // OverviewViewController.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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/OverviewViewController.m b/examples/LayoutSpecExamples/Sample/OverviewViewController.m index c3cd7f9b6b..9d9700f5e2 100644 --- a/examples/LayoutSpecExamples/Sample/OverviewViewController.m +++ b/examples/LayoutSpecExamples/Sample/OverviewViewController.m @@ -2,17 +2,9 @@ // OverviewViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverviewViewController.h" diff --git a/examples/LayoutSpecExamples/Sample/Utilities.h b/examples/LayoutSpecExamples/Sample/Utilities.h index b4bf2f824a..5719a4ab85 100644 --- a/examples/LayoutSpecExamples/Sample/Utilities.h +++ b/examples/LayoutSpecExamples/Sample/Utilities.h @@ -2,17 +2,9 @@ // Utilities.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/LayoutSpecExamples/Sample/Utilities.m b/examples/LayoutSpecExamples/Sample/Utilities.m index 92e5c4bda7..d999ddd32d 100644 --- a/examples/LayoutSpecExamples/Sample/Utilities.m +++ b/examples/LayoutSpecExamples/Sample/Utilities.m @@ -2,17 +2,9 @@ // Utilities.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "Utilities.h" diff --git a/examples/LayoutSpecExamples/Sample/main.m b/examples/LayoutSpecExamples/Sample/main.m index 791ef4b743..0e5da05001 100644 --- a/examples/LayoutSpecExamples/Sample/main.m +++ b/examples/LayoutSpecExamples/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/PagerNode/Sample/AppDelegate.h b/examples/PagerNode/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/PagerNode/Sample/AppDelegate.h +++ b/examples/PagerNode/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/PagerNode/Sample/AppDelegate.m b/examples/PagerNode/Sample/AppDelegate.m index 58fe564898..f8437855b0 100644 --- a/examples/PagerNode/Sample/AppDelegate.m +++ b/examples/PagerNode/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/PagerNode/Sample/PageNode.h b/examples/PagerNode/Sample/PageNode.h index e87a74628b..f4346289c5 100644 --- a/examples/PagerNode/Sample/PageNode.h +++ b/examples/PagerNode/Sample/PageNode.h @@ -1,20 +1,10 @@ // // PageNode.h -// Sample +// Texture // -// Created by McCallum, Levi on 12/7/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/PagerNode/Sample/PageNode.m b/examples/PagerNode/Sample/PageNode.m index 0efd831219..bedd46f0c0 100644 --- a/examples/PagerNode/Sample/PageNode.m +++ b/examples/PagerNode/Sample/PageNode.m @@ -2,17 +2,9 @@ // PageNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PageNode.h" diff --git a/examples/PagerNode/Sample/ViewController.h b/examples/PagerNode/Sample/ViewController.h index 151b29582a..3af731c848 100644 --- a/examples/PagerNode/Sample/ViewController.h +++ b/examples/PagerNode/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/PagerNode/Sample/ViewController.m b/examples/PagerNode/Sample/ViewController.m index 001c5c069a..b55fa343f9 100644 --- a/examples/PagerNode/Sample/ViewController.m +++ b/examples/PagerNode/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/PagerNode/Sample/main.m b/examples/PagerNode/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/PagerNode/Sample/main.m +++ b/examples/PagerNode/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/AppDelegate.h b/examples/SocialAppLayout-Inverted/Sample/AppDelegate.h index 445e9559ee..19db03c153 100644 --- a/examples/SocialAppLayout-Inverted/Sample/AppDelegate.h +++ b/examples/SocialAppLayout-Inverted/Sample/AppDelegate.h @@ -2,17 +2,9 @@ // AppDelegate.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/AppDelegate.m b/examples/SocialAppLayout-Inverted/Sample/AppDelegate.m index 54b277b146..73663a6919 100644 --- a/examples/SocialAppLayout-Inverted/Sample/AppDelegate.m +++ b/examples/SocialAppLayout-Inverted/Sample/AppDelegate.m @@ -2,17 +2,9 @@ // AppDelegate.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/CommentsNode.h b/examples/SocialAppLayout-Inverted/Sample/CommentsNode.h index cd1271f9b4..422460fe9e 100644 --- a/examples/SocialAppLayout-Inverted/Sample/CommentsNode.h +++ b/examples/SocialAppLayout-Inverted/Sample/CommentsNode.h @@ -2,17 +2,9 @@ // CommentsNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/CommentsNode.m b/examples/SocialAppLayout-Inverted/Sample/CommentsNode.m index d90ed58c1d..96ba688881 100644 --- a/examples/SocialAppLayout-Inverted/Sample/CommentsNode.m +++ b/examples/SocialAppLayout-Inverted/Sample/CommentsNode.m @@ -2,17 +2,9 @@ // CommentsNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "CommentsNode.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/LikesNode.h b/examples/SocialAppLayout-Inverted/Sample/LikesNode.h index 21908713c1..1dbbc191e1 100644 --- a/examples/SocialAppLayout-Inverted/Sample/LikesNode.h +++ b/examples/SocialAppLayout-Inverted/Sample/LikesNode.h @@ -2,17 +2,9 @@ // LikesNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/LikesNode.m b/examples/SocialAppLayout-Inverted/Sample/LikesNode.m index 551c575c72..cd5ade1db4 100644 --- a/examples/SocialAppLayout-Inverted/Sample/LikesNode.m +++ b/examples/SocialAppLayout-Inverted/Sample/LikesNode.m @@ -2,17 +2,9 @@ // LikesNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "LikesNode.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/Post.h b/examples/SocialAppLayout-Inverted/Sample/Post.h index c2383c82f2..c8259237b8 100644 --- a/examples/SocialAppLayout-Inverted/Sample/Post.h +++ b/examples/SocialAppLayout-Inverted/Sample/Post.h @@ -2,17 +2,9 @@ // Post.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/Post.m b/examples/SocialAppLayout-Inverted/Sample/Post.m index ca029e7aa0..fc61c5bf82 100644 --- a/examples/SocialAppLayout-Inverted/Sample/Post.m +++ b/examples/SocialAppLayout-Inverted/Sample/Post.m @@ -2,17 +2,9 @@ // Post.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "Post.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/PostNode.h b/examples/SocialAppLayout-Inverted/Sample/PostNode.h index c3e27e52b7..b558158e31 100644 --- a/examples/SocialAppLayout-Inverted/Sample/PostNode.h +++ b/examples/SocialAppLayout-Inverted/Sample/PostNode.h @@ -2,17 +2,9 @@ // PostNode.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/PostNode.m b/examples/SocialAppLayout-Inverted/Sample/PostNode.m index 1c4bad381e..defafc0061 100644 --- a/examples/SocialAppLayout-Inverted/Sample/PostNode.m +++ b/examples/SocialAppLayout-Inverted/Sample/PostNode.m @@ -2,17 +2,9 @@ // PostNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PostNode.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/TextStyles.h b/examples/SocialAppLayout-Inverted/Sample/TextStyles.h index 39cfe9528c..2a975bdea3 100644 --- a/examples/SocialAppLayout-Inverted/Sample/TextStyles.h +++ b/examples/SocialAppLayout-Inverted/Sample/TextStyles.h @@ -2,17 +2,9 @@ // TextStyles.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/TextStyles.m b/examples/SocialAppLayout-Inverted/Sample/TextStyles.m index 68f11954ae..ad7798c445 100644 --- a/examples/SocialAppLayout-Inverted/Sample/TextStyles.m +++ b/examples/SocialAppLayout-Inverted/Sample/TextStyles.m @@ -2,17 +2,9 @@ // TextStyles.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TextStyles.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/ViewController.h b/examples/SocialAppLayout-Inverted/Sample/ViewController.h index 437714485d..6416242247 100644 --- a/examples/SocialAppLayout-Inverted/Sample/ViewController.h +++ b/examples/SocialAppLayout-Inverted/Sample/ViewController.h @@ -2,17 +2,9 @@ // ViewController.h // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout-Inverted/Sample/ViewController.m b/examples/SocialAppLayout-Inverted/Sample/ViewController.m index f19962d613..efc9d06e4a 100644 --- a/examples/SocialAppLayout-Inverted/Sample/ViewController.m +++ b/examples/SocialAppLayout-Inverted/Sample/ViewController.m @@ -2,17 +2,9 @@ // ViewController.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/SocialAppLayout-Inverted/Sample/main.m b/examples/SocialAppLayout-Inverted/Sample/main.m index 7dd0fecc6d..0e5da05001 100644 --- a/examples/SocialAppLayout-Inverted/Sample/main.m +++ b/examples/SocialAppLayout-Inverted/Sample/main.m @@ -2,17 +2,9 @@ // main.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/AppDelegate.h b/examples/SocialAppLayout/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/SocialAppLayout/Sample/AppDelegate.h +++ b/examples/SocialAppLayout/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/AppDelegate.m b/examples/SocialAppLayout/Sample/AppDelegate.m index da7d93f4d8..73663a6919 100644 --- a/examples/SocialAppLayout/Sample/AppDelegate.m +++ b/examples/SocialAppLayout/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/SocialAppLayout/Sample/CommentsNode.h b/examples/SocialAppLayout/Sample/CommentsNode.h index 24e39cb5b4..422460fe9e 100644 --- a/examples/SocialAppLayout/Sample/CommentsNode.h +++ b/examples/SocialAppLayout/Sample/CommentsNode.h @@ -1,18 +1,10 @@ // // CommentsNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/CommentsNode.m b/examples/SocialAppLayout/Sample/CommentsNode.m index 48d1d457ad..96ba688881 100644 --- a/examples/SocialAppLayout/Sample/CommentsNode.m +++ b/examples/SocialAppLayout/Sample/CommentsNode.m @@ -1,18 +1,10 @@ // // CommentsNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "CommentsNode.h" diff --git a/examples/SocialAppLayout/Sample/LikesNode.h b/examples/SocialAppLayout/Sample/LikesNode.h index b98cbebef6..1dbbc191e1 100644 --- a/examples/SocialAppLayout/Sample/LikesNode.h +++ b/examples/SocialAppLayout/Sample/LikesNode.h @@ -1,18 +1,10 @@ // // LikesNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/LikesNode.m b/examples/SocialAppLayout/Sample/LikesNode.m index 593d5ae5de..cd5ade1db4 100644 --- a/examples/SocialAppLayout/Sample/LikesNode.m +++ b/examples/SocialAppLayout/Sample/LikesNode.m @@ -1,18 +1,10 @@ // // LikesNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "LikesNode.h" diff --git a/examples/SocialAppLayout/Sample/Post.h b/examples/SocialAppLayout/Sample/Post.h index 44bed0dd73..c8259237b8 100644 --- a/examples/SocialAppLayout/Sample/Post.h +++ b/examples/SocialAppLayout/Sample/Post.h @@ -1,18 +1,10 @@ // // Post.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/Post.m b/examples/SocialAppLayout/Sample/Post.m index 10bf3a7623..fc61c5bf82 100644 --- a/examples/SocialAppLayout/Sample/Post.m +++ b/examples/SocialAppLayout/Sample/Post.m @@ -1,18 +1,10 @@ // // Post.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "Post.h" diff --git a/examples/SocialAppLayout/Sample/PostNode.h b/examples/SocialAppLayout/Sample/PostNode.h index 6d8c62696d..b558158e31 100644 --- a/examples/SocialAppLayout/Sample/PostNode.h +++ b/examples/SocialAppLayout/Sample/PostNode.h @@ -1,18 +1,10 @@ // // PostNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/PostNode.m b/examples/SocialAppLayout/Sample/PostNode.m index 1c4bad381e..defafc0061 100644 --- a/examples/SocialAppLayout/Sample/PostNode.m +++ b/examples/SocialAppLayout/Sample/PostNode.m @@ -2,17 +2,9 @@ // PostNode.m // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PostNode.h" diff --git a/examples/SocialAppLayout/Sample/TextStyles.h b/examples/SocialAppLayout/Sample/TextStyles.h index b8ef6780c1..2a975bdea3 100644 --- a/examples/SocialAppLayout/Sample/TextStyles.h +++ b/examples/SocialAppLayout/Sample/TextStyles.h @@ -1,18 +1,10 @@ // // TextStyles.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/TextStyles.m b/examples/SocialAppLayout/Sample/TextStyles.m index 8f642522b7..ad7798c445 100644 --- a/examples/SocialAppLayout/Sample/TextStyles.m +++ b/examples/SocialAppLayout/Sample/TextStyles.m @@ -1,18 +1,10 @@ // // TextStyles.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TextStyles.h" diff --git a/examples/SocialAppLayout/Sample/ViewController.h b/examples/SocialAppLayout/Sample/ViewController.h index bfb359c6b5..6416242247 100644 --- a/examples/SocialAppLayout/Sample/ViewController.h +++ b/examples/SocialAppLayout/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/SocialAppLayout/Sample/ViewController.m b/examples/SocialAppLayout/Sample/ViewController.m index 28bdf90283..1eebcb516c 100644 --- a/examples/SocialAppLayout/Sample/ViewController.m +++ b/examples/SocialAppLayout/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/SocialAppLayout/Sample/main.m b/examples/SocialAppLayout/Sample/main.m index 791ef4b743..0e5da05001 100644 --- a/examples/SocialAppLayout/Sample/main.m +++ b/examples/SocialAppLayout/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Swift/Sample/AppDelegate.swift b/examples/Swift/Sample/AppDelegate.swift index c40f1be4ed..df48167298 100644 --- a/examples/Swift/Sample/AppDelegate.swift +++ b/examples/Swift/Sample/AppDelegate.swift @@ -1,18 +1,10 @@ // // AppDelegate.swift -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/Swift/Sample/TailLoadingCellNode.swift b/examples/Swift/Sample/TailLoadingCellNode.swift index 5327dd4456..5b586e7086 100644 --- a/examples/Swift/Sample/TailLoadingCellNode.swift +++ b/examples/Swift/Sample/TailLoadingCellNode.swift @@ -1,20 +1,10 @@ // // TailLoadingCellNode.swift -// Sample +// Texture // -// Created by Adlai Holler on 2/1/16. -// -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples/Swift/Sample/ViewController.swift b/examples/Swift/Sample/ViewController.swift index 4d1269e6ae..e68c178ad5 100644 --- a/examples/Swift/Sample/ViewController.swift +++ b/examples/Swift/Sample/ViewController.swift @@ -1,18 +1,10 @@ // // ViewController.swift -// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m index 7856fdec08..faa44dc60b 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h index 2c36e79dab..e679beb7d7 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.h @@ -1,18 +1,10 @@ // // GradientTableNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm index 8e6c884f11..af36ca637c 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm +++ b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm @@ -1,18 +1,10 @@ // // GradientTableNode.mm -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "GradientTableNode.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h index e2b21128f2..c07752ab1a 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.h -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m index 3b9e09d009..bf114349e5 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.m -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "RandomCoreGraphicsNode.h" diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m index 4791a42f08..7e852414c4 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/main.m b/examples/VerticalWithinHorizontalScrolling/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/main.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Videos/Sample/ASVideoNode.h b/examples/Videos/Sample/ASVideoNode.h index 3fcce60480..bec76ccc57 100644 --- a/examples/Videos/Sample/ASVideoNode.h +++ b/examples/Videos/Sample/ASVideoNode.h @@ -1,18 +1,10 @@ // // ASVideoNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Videos/Sample/ASVideoNode.m b/examples/Videos/Sample/ASVideoNode.m index 7b9118721d..f7db712b5b 100644 --- a/examples/Videos/Sample/ASVideoNode.m +++ b/examples/Videos/Sample/ASVideoNode.m @@ -1,18 +1,10 @@ // // ASVideoNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/examples/Videos/Sample/AppDelegate.h b/examples/Videos/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples/Videos/Sample/AppDelegate.h +++ b/examples/Videos/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Videos/Sample/AppDelegate.m b/examples/Videos/Sample/AppDelegate.m index c62355c06c..d0fd66f775 100644 --- a/examples/Videos/Sample/AppDelegate.m +++ b/examples/Videos/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples/Videos/Sample/ViewController.h b/examples/Videos/Sample/ViewController.h index 2b35e7f47d..40cc00f2fc 100644 --- a/examples/Videos/Sample/ViewController.h +++ b/examples/Videos/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples/Videos/Sample/ViewController.m b/examples/Videos/Sample/ViewController.m index b0de8101b3..988b3579b8 100644 --- a/examples/Videos/Sample/ViewController.m +++ b/examples/Videos/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples/Videos/Sample/main.m b/examples/Videos/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples/Videos/Sample/main.m +++ b/examples/Videos/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift index 85b7de1078..990773f687 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/AppDelegate.swift @@ -1,18 +1,10 @@ // // AppDelegate.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift index c56cc8f68c..f4da709f26 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Constants.swift @@ -1,20 +1,11 @@ // -// Constants -// ASDKgram-Swift +// Constants.swift +// 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 /ASDK-Licenses directory of this source tree. An additional -// grant of patent rights can be found in the PATENTS file in the same directory. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -// 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 -// -// swiftlint:disable nesting import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift index df4d189a2b..d367584b10 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Date.swift @@ -1,18 +1,10 @@ // // Date.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift index 47d02a2e13..937f87fadf 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NetworkImageView.swift @@ -1,18 +1,10 @@ // // NetworkImageView.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift index 699db03555..246f398b94 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/NumberFormatter.swift @@ -1,18 +1,10 @@ // // NumberFormatter.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift index 856abfefb0..45e5de48f7 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Codable.swift @@ -1,12 +1,10 @@ -/** - Copyright (c) 2015-2017 Lukas Kubanek - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. - */ +// +// OrderedDictionary+Codable.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #if swift(>=4.1) diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift index eca85b633d..604dbac119 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary+Description.swift @@ -1,12 +1,10 @@ -/** - Copyright (c) 2015-2017 Lukas Kubanek - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. - */ +// +// OrderedDictionary+Description.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// extension OrderedDictionary: CustomStringConvertible { diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift index 961173e01c..38bb9853f2 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/OrderedDictionary/OrderedDictionary.swift @@ -1,12 +1,10 @@ -/** - Copyright (c) 2015-2017 Lukas Kubanek - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - 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 THE AUTHORS OR COPYRIGHT HOLDERS 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. - */ +// +// OrderedDictionary.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// /// A generic collection for storing key-value pairs in an ordered manner. /// diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PX500Convenience.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PX500Convenience.swift index 808a553d14..a8754d695b 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PX500Convenience.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PX500Convenience.swift @@ -1,20 +1,10 @@ // // PX500Convenience.swift -// ASDKgram-Swift +// Texture // -// Created by Calum Harris on 08/01/2017. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift index 5a82c1014c..0870651e89 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/ParseResponse.swift @@ -1,18 +1,10 @@ // // ParseResponse.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift index 9e7cca4cae..edfe37ff37 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedModel.swift @@ -1,18 +1,10 @@ // // PhotoFeedModel.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift index 51d509ed84..6c2fe39f14 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableNodeController.swift @@ -1,18 +1,10 @@ // // PhotoFeedTableNodeController.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift index e09b896073..1f19fe8dc9 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoFeedTableViewController.swift @@ -1,18 +1,10 @@ // // PhotoFeedTableViewController.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift index e9a049f437..5f5c5bbe71 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoModel.swift @@ -1,18 +1,10 @@ // // PhotoModel.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift index 4ad4ea8ab8..58f2a7086c 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableNodeCell.swift @@ -1,18 +1,10 @@ // // PhotoTableNodeCell.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift index 982f673d06..0698ff2cee 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PhotoTableViewCell.swift @@ -1,18 +1,10 @@ // // PhotoTableViewCell.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift index 0c32a2bb0d..048b219211 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/PopularPageModel.swift @@ -1,18 +1,10 @@ // // PopularPageModel.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift index 40cea6f910..5498f07ce9 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/UIColor.swift @@ -1,18 +1,10 @@ // // UIColor.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift index cbdd5a942f..be9b4a49e9 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/URL.swift @@ -1,18 +1,10 @@ // // URL.swift -// ASDKgram-Swift +// 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift index 0718905d52..a103d21653 100644 --- a/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift +++ b/examples_extra/ASDKgram-Swift/ASDKgram-Swift/Webservice.swift @@ -1,20 +1,11 @@ // // Webservice.swift -// ASDKgram-Swift +// 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 /ASDK-Licenses directory of this source tree. An additional -// grant of patent rights can be found in the PATENTS file in the same directory. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -// 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 -// -// swiftlint:disable force_cast import UIKit diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.h b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.h index 0c5d69364f..d80265a099 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.h +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.h @@ -1,8 +1,9 @@ // // Sample.h -// Sample +// Texture // -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/HorizontalStackWithSpacer.xcplaygroundpage/Contents.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/HorizontalStackWithSpacer.xcplaygroundpage/Contents.swift index 10715382bb..43cf09026e 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/HorizontalStackWithSpacer.xcplaygroundpage/Contents.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/HorizontalStackWithSpacer.xcplaygroundpage/Contents.swift @@ -1,4 +1,10 @@ -//: [Photo With Outset Icon Overlay](PhotoWithOutsetIconOverlay) +// +// Contents.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/Index.xcplaygroundpage/Contents.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/Index.xcplaygroundpage/Contents.swift index b44cbd0226..655f86b0f5 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/Index.xcplaygroundpage/Contents.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/Index.xcplaygroundpage/Contents.swift @@ -1,24 +1,7 @@ -/*: - ## ⚠️ You must start by building the Sample framework ⚠️ - Once that succeeds, you should not have to build until you update AsyncDisplayKit! - What you see here isn't comprehensive, but you should be able to tweak the variables to familiarize yourself with the layout APIs. - - - - - - ## Table of Contents - * [Stack Layout](StackLayout) - * [Photo With Inset Text Overlay](PhotoWithInsetTextOverlay) - * [Photo With Outset Icon Overlay](PhotoWithOutsetIconOverlay) - * [Horizontal Stack With Spacer](HorizontalStackWithSpacer) - - - - - -Tips: - 1. Make sure to show the Assistant Editor in order to preview your code changes. You can do this with either of the following: - - (cmd + opt/alt + ⮐) - - View → Assistant Editor → Show Assistant Editor, to see the preview - 1. Make sure that **Timeline** as the element selected in the Assistant Editor - 1. You might have to click on stop/start (the one at the bottom of the screen, under the editor) a few times in case the timeline isn't updating. - - - - -Solutions to Common Issues: - 1. If you're getting errors regarding **import Sample_Sources**, simply restart Xcode and try again. - 1. If you're getting issues with threading, restart the test until it works. -*/ +// +// Contents.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithInsetTextOverlay.xcplaygroundpage/Contents.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithInsetTextOverlay.xcplaygroundpage/Contents.swift index cc73be4b1a..88360fd4fb 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithInsetTextOverlay.xcplaygroundpage/Contents.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithInsetTextOverlay.xcplaygroundpage/Contents.swift @@ -1,4 +1,10 @@ -//: [Stack Layout](StackLayout) +// +// Contents.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit @@ -23,4 +29,4 @@ extension PhotoWithInsetTextOverlay { PhotoWithInsetTextOverlay().show() -//: [Photo With Outset Icon Overlay](PhotoWithOutsetIconOverlay) \ No newline at end of file +//: [Photo With Outset Icon Overlay](PhotoWithOutsetIconOverlay) diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithOutsetIconOverlay.xcplaygroundpage/Contents.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithOutsetIconOverlay.xcplaygroundpage/Contents.swift index ab2195f393..ba866f3b6d 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithOutsetIconOverlay.xcplaygroundpage/Contents.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/PhotoWithOutsetIconOverlay.xcplaygroundpage/Contents.swift @@ -1,4 +1,10 @@ -//: [Photo With Inset Text Overlay](PhotoWithInsetTextOverlay) +// +// Contents.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/StackLayout.xcplaygroundpage/Contents.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/StackLayout.xcplaygroundpage/Contents.swift index d9eb59db8e..ec63def40a 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/StackLayout.xcplaygroundpage/Contents.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Pages/StackLayout.xcplaygroundpage/Contents.swift @@ -1,7 +1,10 @@ -//: [Index](Index) -/*: - In this example, you can experiment with stack layouts. - */ +// +// Contents.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit extension StackLayout { @@ -28,4 +31,4 @@ extension StackLayout { StackLayout().show() -//: [Photo With Inset Text Overlay](PhotoWithInsetTextOverlay) \ No newline at end of file +//: [Photo With Inset Text Overlay](PhotoWithInsetTextOverlay) diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/ASPlayground.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/ASPlayground.swift index 0aab532ed3..1edf7db0bb 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/ASPlayground.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/ASPlayground.swift @@ -1,3 +1,10 @@ +// +// ASPlayground.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import PlaygroundSupport import AsyncDisplayKit diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/HorizontalStackWithSpacer.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/HorizontalStackWithSpacer.swift index 03338158fb..84b38c8e4d 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/HorizontalStackWithSpacer.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/HorizontalStackWithSpacer.swift @@ -1,3 +1,10 @@ +// +// HorizontalStackWithSpacer.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit fileprivate let fontSize: CGFloat = 20 diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithInsetTextOverlay.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithInsetTextOverlay.swift index 701d82f834..2a9736446c 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithInsetTextOverlay.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithInsetTextOverlay.swift @@ -1,3 +1,10 @@ +// +// PhotoWithInsetTextOverlay.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit public class PhotoWithInsetTextOverlay: ASDisplayNode, ASPlayground { diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithOutsetIconOverlay.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithOutsetIconOverlay.swift index 469feab7e3..9a8c9f3ab3 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithOutsetIconOverlay.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/PhotoWithOutsetIconOverlay.swift @@ -1,3 +1,10 @@ +// +// PhotoWithOutsetIconOverlay.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit fileprivate let userImageHeight = 60 diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/StackLayout.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/StackLayout.swift index 8eb4b1dbc5..871252e0fc 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/StackLayout.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/StackLayout.swift @@ -1,3 +1,10 @@ +// +// StackLayout.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import AsyncDisplayKit public class StackLayout: ASDisplayNode, ASPlayground { diff --git a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/Utilities.swift b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/Utilities.swift index db9a9c2857..ab2cccc798 100644 --- a/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/Utilities.swift +++ b/examples_extra/ASLayoutSpecPlayground-Swift/Sample/Sample.playground/Sources/Utilities.swift @@ -1,3 +1,10 @@ +// +// Utilities.swift +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// import UIKit import Foundation diff --git a/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h +++ b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m index 3ba6ef18f3..1a89581c33 100644 --- a/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m +++ b/examples_extra/ASTableViewStressTest/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" @@ -52,4 +44,4 @@ [self pushNewViewControllerAnimated:YES]; } -@end \ No newline at end of file +@end diff --git a/examples_extra/ASTableViewStressTest/Sample/ViewController.h b/examples_extra/ASTableViewStressTest/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/ASTableViewStressTest/Sample/ViewController.h +++ b/examples_extra/ASTableViewStressTest/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTableViewStressTest/Sample/ViewController.m b/examples_extra/ASTableViewStressTest/Sample/ViewController.m index 4dfeca76ab..d75f9ac3ef 100644 --- a/examples_extra/ASTableViewStressTest/Sample/ViewController.m +++ b/examples_extra/ASTableViewStressTest/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/ASTableViewStressTest/Sample/main.m b/examples_extra/ASTableViewStressTest/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/ASTableViewStressTest/Sample/main.m +++ b/examples_extra/ASTableViewStressTest/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/AppDelegate.h b/examples_extra/ASTraitCollection/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples_extra/ASTraitCollection/Sample/AppDelegate.h +++ b/examples_extra/ASTraitCollection/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/AppDelegate.m b/examples_extra/ASTraitCollection/Sample/AppDelegate.m index eb5d123a4b..0a4654ae14 100644 --- a/examples_extra/ASTraitCollection/Sample/AppDelegate.m +++ b/examples_extra/ASTraitCollection/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/ASTraitCollection/Sample/CollectionViewController.h b/examples_extra/ASTraitCollection/Sample/CollectionViewController.h index 68c7b30d07..0528310b79 100644 --- a/examples_extra/ASTraitCollection/Sample/CollectionViewController.h +++ b/examples_extra/ASTraitCollection/Sample/CollectionViewController.h @@ -1,18 +1,10 @@ // // CollectionViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/CollectionViewController.m b/examples_extra/ASTraitCollection/Sample/CollectionViewController.m index 1c94ce4812..7e57f74434 100644 --- a/examples_extra/ASTraitCollection/Sample/CollectionViewController.m +++ b/examples_extra/ASTraitCollection/Sample/CollectionViewController.m @@ -1,18 +1,10 @@ // // CollectionViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "CollectionViewController.h" diff --git a/examples_extra/ASTraitCollection/Sample/KittenNode.h b/examples_extra/ASTraitCollection/Sample/KittenNode.h index 1fd783f03d..17655e0765 100644 --- a/examples_extra/ASTraitCollection/Sample/KittenNode.h +++ b/examples_extra/ASTraitCollection/Sample/KittenNode.h @@ -1,18 +1,10 @@ // // KittenNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/KittenNode.m b/examples_extra/ASTraitCollection/Sample/KittenNode.m index 6643f03b82..1526563e04 100644 --- a/examples_extra/ASTraitCollection/Sample/KittenNode.m +++ b/examples_extra/ASTraitCollection/Sample/KittenNode.m @@ -1,18 +1,10 @@ // // KittenNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "KittenNode.h" diff --git a/examples_extra/ASTraitCollection/Sample/OverrideViewController.h b/examples_extra/ASTraitCollection/Sample/OverrideViewController.h index 895d21ce2a..f5de270ae5 100644 --- a/examples_extra/ASTraitCollection/Sample/OverrideViewController.h +++ b/examples_extra/ASTraitCollection/Sample/OverrideViewController.h @@ -1,18 +1,10 @@ // // OverrideViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/OverrideViewController.m b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m index 008497f9d8..3e9fcc305e 100644 --- a/examples_extra/ASTraitCollection/Sample/OverrideViewController.m +++ b/examples_extra/ASTraitCollection/Sample/OverrideViewController.m @@ -1,18 +1,10 @@ // // OverrideViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "OverrideViewController.h" diff --git a/examples_extra/ASTraitCollection/Sample/TableViewController.h b/examples_extra/ASTraitCollection/Sample/TableViewController.h index 56683ad278..bfb5fad618 100644 --- a/examples_extra/ASTraitCollection/Sample/TableViewController.h +++ b/examples_extra/ASTraitCollection/Sample/TableViewController.h @@ -1,18 +1,10 @@ // // TableViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/TableViewController.m b/examples_extra/ASTraitCollection/Sample/TableViewController.m index b24cdec5ca..3a91be7588 100644 --- a/examples_extra/ASTraitCollection/Sample/TableViewController.m +++ b/examples_extra/ASTraitCollection/Sample/TableViewController.m @@ -1,18 +1,10 @@ // // TableViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TableViewController.h" diff --git a/examples_extra/ASTraitCollection/Sample/ViewController.h b/examples_extra/ASTraitCollection/Sample/ViewController.h index c5a802dd6f..4499f93bab 100644 --- a/examples_extra/ASTraitCollection/Sample/ViewController.h +++ b/examples_extra/ASTraitCollection/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/ASTraitCollection/Sample/ViewController.m b/examples_extra/ASTraitCollection/Sample/ViewController.m index 0b7b6dd370..ddb1d708f2 100644 --- a/examples_extra/ASTraitCollection/Sample/ViewController.m +++ b/examples_extra/ASTraitCollection/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/ASTraitCollection/Sample/main.m b/examples_extra/ASTraitCollection/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/ASTraitCollection/Sample/main.m +++ b/examples_extra/ASTraitCollection/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift b/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift index bc0e91bfc6..5868314aaf 100644 --- a/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/AppDelegate.swift @@ -1,20 +1,10 @@ // // AppDelegate.swift -// Sample +// Texture // -// Created by Adlai Holler on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift index 8ce79266b5..6c3e7e529b 100644 --- a/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/DemoCellNode.swift @@ -1,20 +1,10 @@ // // DemoCellNode.swift -// Sample +// Texture // -// Created by Adlai Holler on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift b/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift index 4a313ac139..f33065245c 100644 --- a/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/Utilities.swift @@ -1,20 +1,10 @@ // // Utilities.swift -// Sample +// Texture // -// Created by Adlai Holler on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift b/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift index facf11c8a5..47faf4384e 100644 --- a/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift +++ b/examples_extra/BackgroundPropertySetting/Sample/ViewController.swift @@ -1,20 +1,10 @@ // // ViewController.swift -// Sample +// Texture // -// Created by Adlai Holler on 2/17/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.h b/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.h index 2679ca0f5d..8d58a13cbe 100644 --- a/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.h +++ b/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.h @@ -1,20 +1,10 @@ // // AppDelegate.h -// Sample +// Texture // -// Created by Engin Kurutepe on 23/02/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.m b/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.m index 3cbd83a5e1..f4d3339633 100644 --- a/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.m +++ b/examples_extra/CarthageBuildTest/CarthageExample/AppDelegate.m @@ -1,20 +1,10 @@ // // AppDelegate.m -// Sample +// Texture // -// Created by Engin Kurutepe on 23/02/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // @import AsyncDisplayKit; diff --git a/examples_extra/CarthageBuildTest/CarthageExample/ViewController.h b/examples_extra/CarthageBuildTest/CarthageExample/ViewController.h index 69b7c77fa8..4627e29285 100644 --- a/examples_extra/CarthageBuildTest/CarthageExample/ViewController.h +++ b/examples_extra/CarthageBuildTest/CarthageExample/ViewController.h @@ -1,20 +1,10 @@ // // ViewController.h -// Sample +// Texture // -// Created by Engin Kurutepe on 23/02/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CarthageBuildTest/CarthageExample/ViewController.m b/examples_extra/CarthageBuildTest/CarthageExample/ViewController.m index 6c48850bbb..993d6ac152 100644 --- a/examples_extra/CarthageBuildTest/CarthageExample/ViewController.m +++ b/examples_extra/CarthageBuildTest/CarthageExample/ViewController.m @@ -1,20 +1,10 @@ // // ViewController.m -// Sample +// Texture // -// Created by Engin Kurutepe on 23/02/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/CarthageBuildTest/CarthageExample/main.m b/examples_extra/CarthageBuildTest/CarthageExample/main.m index 269c9a6c74..0e5da05001 100644 --- a/examples_extra/CarthageBuildTest/CarthageExample/main.m +++ b/examples_extra/CarthageBuildTest/CarthageExample/main.m @@ -1,20 +1,10 @@ // // main.m -// Sample +// Texture // -// Created by Engin Kurutepe on 23/02/16. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m index 853bf6e8bc..78de0a3151 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h index e24af762a1..07000b0e3f 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.h @@ -1,18 +1,10 @@ // // ImageViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m index 2d330689ce..60e5027dae 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m @@ -1,18 +1,10 @@ // // ImageViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h index 0acb1dde08..c7a9867fb5 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.h @@ -1,20 +1,10 @@ // // MosaicCollectionViewLayout.h -// Sample +// Texture // -// Created by McCallum, Levi on 11/22/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import @@ -38,4 +28,4 @@ @interface MosaicCollectionViewLayoutInspector : NSObject -@end \ No newline at end of file +@end diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m index 9e70ad0fd1..bc48035100 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/MosaicCollectionViewLayout.m @@ -1,20 +1,10 @@ // // MosaicCollectionViewLayout.m -// Sample +// Texture // -// Created by McCallum, Levi on 11/22/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "MosaicCollectionViewLayout.h" @@ -238,4 +228,4 @@ } } -@end \ No newline at end of file +@end diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h index 906fc50bdc..b29ec002b2 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.h @@ -1,18 +1,10 @@ // // SupplementaryNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m index ab3be7cd4d..47dfa786b5 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/SupplementaryNode.m @@ -1,18 +1,10 @@ // // SupplementaryNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "SupplementaryNode.h" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m index c1ae6628dc..60979faf3e 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m b/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m index d5794dca4c..65850400e4 100644 --- a/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m +++ b/examples_extra/CollectionViewWithViewControllerCells/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/EditableText/Sample/AppDelegate.h b/examples_extra/EditableText/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples_extra/EditableText/Sample/AppDelegate.h +++ b/examples_extra/EditableText/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/EditableText/Sample/AppDelegate.m b/examples_extra/EditableText/Sample/AppDelegate.m index c62355c06c..d0fd66f775 100644 --- a/examples_extra/EditableText/Sample/AppDelegate.m +++ b/examples_extra/EditableText/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/EditableText/Sample/ViewController.h b/examples_extra/EditableText/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/EditableText/Sample/ViewController.h +++ b/examples_extra/EditableText/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/EditableText/Sample/ViewController.m b/examples_extra/EditableText/Sample/ViewController.m index 6bbcad75cd..0a9703b897 100644 --- a/examples_extra/EditableText/Sample/ViewController.m +++ b/examples_extra/EditableText/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/EditableText/Sample/main.m b/examples_extra/EditableText/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/EditableText/Sample/main.m +++ b/examples_extra/EditableText/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Multiplex/Sample/AppDelegate.h b/examples_extra/Multiplex/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples_extra/Multiplex/Sample/AppDelegate.h +++ b/examples_extra/Multiplex/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Multiplex/Sample/AppDelegate.m b/examples_extra/Multiplex/Sample/AppDelegate.m index c62355c06c..d0fd66f775 100644 --- a/examples_extra/Multiplex/Sample/AppDelegate.m +++ b/examples_extra/Multiplex/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/Multiplex/Sample/ScreenNode.h b/examples_extra/Multiplex/Sample/ScreenNode.h index ecfb4c2220..4ade23a06b 100644 --- a/examples_extra/Multiplex/Sample/ScreenNode.h +++ b/examples_extra/Multiplex/Sample/ScreenNode.h @@ -1,20 +1,10 @@ // // ScreenNode.h -// Sample +// Texture // -// Created by Huy Nguyen on 16/09/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Multiplex/Sample/ScreenNode.m b/examples_extra/Multiplex/Sample/ScreenNode.m index ab0f94f394..86dda5ea2d 100644 --- a/examples_extra/Multiplex/Sample/ScreenNode.m +++ b/examples_extra/Multiplex/Sample/ScreenNode.m @@ -1,20 +1,10 @@ // // ScreenNode.m -// Sample +// Texture // -// Created by Huy Nguyen on 16/09/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ScreenNode.h" diff --git a/examples_extra/Multiplex/Sample/ViewController.h b/examples_extra/Multiplex/Sample/ViewController.h index c4af5a3e0d..27738fcbe1 100644 --- a/examples_extra/Multiplex/Sample/ViewController.h +++ b/examples_extra/Multiplex/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Multiplex/Sample/ViewController.m b/examples_extra/Multiplex/Sample/ViewController.m index 5cb4532a15..cd687f5bc7 100644 --- a/examples_extra/Multiplex/Sample/ViewController.m +++ b/examples_extra/Multiplex/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/Multiplex/Sample/main.m b/examples_extra/Multiplex/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/Multiplex/Sample/main.m +++ b/examples_extra/Multiplex/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/AppDelegate.h b/examples_extra/Placeholders/Sample/AppDelegate.h index 27e560aafe..19db03c153 100644 --- a/examples_extra/Placeholders/Sample/AppDelegate.h +++ b/examples_extra/Placeholders/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/AppDelegate.m b/examples_extra/Placeholders/Sample/AppDelegate.m index c62355c06c..d0fd66f775 100644 --- a/examples_extra/Placeholders/Sample/AppDelegate.m +++ b/examples_extra/Placeholders/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/Placeholders/Sample/PostNode.h b/examples_extra/Placeholders/Sample/PostNode.h index 844d8e4606..646f72232d 100644 --- a/examples_extra/Placeholders/Sample/PostNode.h +++ b/examples_extra/Placeholders/Sample/PostNode.h @@ -1,18 +1,10 @@ // // PostNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/PostNode.m b/examples_extra/Placeholders/Sample/PostNode.m index 7d4a5c2c8b..27809b471d 100644 --- a/examples_extra/Placeholders/Sample/PostNode.m +++ b/examples_extra/Placeholders/Sample/PostNode.m @@ -1,18 +1,10 @@ // // PostNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "PostNode.h" diff --git a/examples_extra/Placeholders/Sample/SlowpokeImageNode.h b/examples_extra/Placeholders/Sample/SlowpokeImageNode.h index ba9706e1b5..9c6ef5c42d 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeImageNode.h +++ b/examples_extra/Placeholders/Sample/SlowpokeImageNode.h @@ -1,18 +1,10 @@ // // SlowpokeImageNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/SlowpokeImageNode.m b/examples_extra/Placeholders/Sample/SlowpokeImageNode.m index ad607c71c2..8bf0f25bdf 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeImageNode.m +++ b/examples_extra/Placeholders/Sample/SlowpokeImageNode.m @@ -1,18 +1,10 @@ // // SlowpokeImageNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "SlowpokeImageNode.h" diff --git a/examples_extra/Placeholders/Sample/SlowpokeShareNode.h b/examples_extra/Placeholders/Sample/SlowpokeShareNode.h index deb3a640af..3742854276 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeShareNode.h +++ b/examples_extra/Placeholders/Sample/SlowpokeShareNode.h @@ -1,18 +1,10 @@ // // SlowpokeShareNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/SlowpokeShareNode.m b/examples_extra/Placeholders/Sample/SlowpokeShareNode.m index 4dcfe0547b..3d1e568756 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeShareNode.m +++ b/examples_extra/Placeholders/Sample/SlowpokeShareNode.m @@ -1,18 +1,10 @@ // // SlowpokeShareNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "SlowpokeShareNode.h" diff --git a/examples_extra/Placeholders/Sample/SlowpokeTextNode.h b/examples_extra/Placeholders/Sample/SlowpokeTextNode.h index d99968e1f0..069833e53f 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeTextNode.h +++ b/examples_extra/Placeholders/Sample/SlowpokeTextNode.h @@ -1,18 +1,10 @@ // // SlowpokeTextNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/SlowpokeTextNode.m b/examples_extra/Placeholders/Sample/SlowpokeTextNode.m index 7b3e133471..81cedf3ccd 100644 --- a/examples_extra/Placeholders/Sample/SlowpokeTextNode.m +++ b/examples_extra/Placeholders/Sample/SlowpokeTextNode.m @@ -1,18 +1,10 @@ // // SlowpokeTextNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "SlowpokeTextNode.h" diff --git a/examples_extra/Placeholders/Sample/ViewController.h b/examples_extra/Placeholders/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/Placeholders/Sample/ViewController.h +++ b/examples_extra/Placeholders/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Placeholders/Sample/ViewController.m b/examples_extra/Placeholders/Sample/ViewController.m index c631740d3a..f1177963bb 100644 --- a/examples_extra/Placeholders/Sample/ViewController.m +++ b/examples_extra/Placeholders/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/Placeholders/Sample/main.m b/examples_extra/Placeholders/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/Placeholders/Sample/main.m +++ b/examples_extra/Placeholders/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/RepoSearcher/RepoSearcher/AppDelegate.swift b/examples_extra/RepoSearcher/RepoSearcher/AppDelegate.swift index d9e8b19907..75583b7cd9 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/AppDelegate.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/AppDelegate.swift @@ -1,9 +1,9 @@ // // AppDelegate.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/RepoSearcher/RepoSearcher/IGListCollectionContext+ASDK.swift b/examples_extra/RepoSearcher/RepoSearcher/IGListCollectionContext+ASDK.swift index df923205c8..31a951f349 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/IGListCollectionContext+ASDK.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/IGListCollectionContext+ASDK.swift @@ -1,9 +1,9 @@ // // IGListCollectionContext+ASDK.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/RepoSearcher/RepoSearcher/LabelSectionController.swift b/examples_extra/RepoSearcher/RepoSearcher/LabelSectionController.swift index fe65d2dfa1..d76dfdd78c 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/LabelSectionController.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/LabelSectionController.swift @@ -1,9 +1,9 @@ // // LabelSectionController.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/RepoSearcher/RepoSearcher/NSObject+IGListDiffable.swift b/examples_extra/RepoSearcher/RepoSearcher/NSObject+IGListDiffable.swift index f6b95a193e..eb95b06c78 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/NSObject+IGListDiffable.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/NSObject+IGListDiffable.swift @@ -1,9 +1,9 @@ // // NSObject+IGListDiffable.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import IGListKit diff --git a/examples_extra/RepoSearcher/RepoSearcher/SearchNode.swift b/examples_extra/RepoSearcher/RepoSearcher/SearchNode.swift index 57bb1eebea..c25322c9cc 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/SearchNode.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/SearchNode.swift @@ -1,9 +1,9 @@ // // SearchNode.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/RepoSearcher/RepoSearcher/SearchSectionController.swift b/examples_extra/RepoSearcher/RepoSearcher/SearchSectionController.swift index 1619b55984..def4b10edd 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/SearchSectionController.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/SearchSectionController.swift @@ -1,9 +1,9 @@ // // SearchSectionController.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import AsyncDisplayKit diff --git a/examples_extra/RepoSearcher/RepoSearcher/SearchViewController.swift b/examples_extra/RepoSearcher/RepoSearcher/SearchViewController.swift index dd00d9aa74..59556d4b37 100644 --- a/examples_extra/RepoSearcher/RepoSearcher/SearchViewController.swift +++ b/examples_extra/RepoSearcher/RepoSearcher/SearchViewController.swift @@ -1,9 +1,9 @@ // // SearchViewController.swift -// RepoSearcher +// Texture // -// Created by Marvin Nazari on 2017-02-18. -// Copyright © 2017 Marvin Nazari. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/AppDelegate.swift b/examples_extra/Shop/Shop/AppDelegate.swift index 0c3c759fe5..ebae7efc3a 100644 --- a/examples_extra/Shop/Shop/AppDelegate.swift +++ b/examples_extra/Shop/Shop/AppDelegate.swift @@ -1,9 +1,9 @@ // // AppDelegate.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Extensions/UIColor.swift b/examples_extra/Shop/Shop/Extensions/UIColor.swift index b00e6715dc..4d6444f131 100644 --- a/examples_extra/Shop/Shop/Extensions/UIColor.swift +++ b/examples_extra/Shop/Shop/Extensions/UIColor.swift @@ -1,9 +1,9 @@ // // UIColor.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/Shop/Shop/Models/Category.swift b/examples_extra/Shop/Shop/Models/Category.swift index e1ed7aa9f6..d5e4949230 100644 --- a/examples_extra/Shop/Shop/Models/Category.swift +++ b/examples_extra/Shop/Shop/Models/Category.swift @@ -1,9 +1,9 @@ // // Category.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/Shop/Shop/Models/DummyGenerator.swift b/examples_extra/Shop/Shop/Models/DummyGenerator.swift index 3cfe4ba7a4..d68e43751f 100644 --- a/examples_extra/Shop/Shop/Models/DummyGenerator.swift +++ b/examples_extra/Shop/Shop/Models/DummyGenerator.swift @@ -1,9 +1,9 @@ // // DummyGenerator.swift -// Shop +// Texture // -// Created by Dimitri on 14/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/Shop/Shop/Models/Product.swift b/examples_extra/Shop/Shop/Models/Product.swift index c88cd21c74..67051c76ba 100644 --- a/examples_extra/Shop/Shop/Models/Product.swift +++ b/examples_extra/Shop/Shop/Models/Product.swift @@ -1,9 +1,9 @@ // // Product.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import Foundation diff --git a/examples_extra/Shop/Shop/Scenes/Product/ProductCellNode.swift b/examples_extra/Shop/Shop/Scenes/Product/ProductCellNode.swift index 3e61f06573..83a33ebd63 100644 --- a/examples_extra/Shop/Shop/Scenes/Product/ProductCellNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Product/ProductCellNode.swift @@ -1,9 +1,9 @@ // // ProductCellNode.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Product/ProductNode.swift b/examples_extra/Shop/Shop/Scenes/Product/ProductNode.swift index 0efaf45d3b..8dda39d137 100644 --- a/examples_extra/Shop/Shop/Scenes/Product/ProductNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Product/ProductNode.swift @@ -1,9 +1,9 @@ // // ProductNode.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Product/ProductViewController.swift b/examples_extra/Shop/Shop/Scenes/Product/ProductViewController.swift index 6251550848..9d36298e1d 100644 --- a/examples_extra/Shop/Shop/Scenes/Product/ProductViewController.swift +++ b/examples_extra/Shop/Shop/Scenes/Product/ProductViewController.swift @@ -1,9 +1,9 @@ // // ProductViewController.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Product/StarRatingNode.swift b/examples_extra/Shop/Shop/Scenes/Product/StarRatingNode.swift index 83a37564ff..21c373c858 100644 --- a/examples_extra/Shop/Shop/Scenes/Product/StarRatingNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Product/StarRatingNode.swift @@ -1,9 +1,9 @@ // // StarRatingNode.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Products/ProductCollectionNode.swift b/examples_extra/Shop/Shop/Scenes/Products/ProductCollectionNode.swift index 7b0897811b..5c95586fed 100644 --- a/examples_extra/Shop/Shop/Scenes/Products/ProductCollectionNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Products/ProductCollectionNode.swift @@ -1,9 +1,9 @@ // // ProductCollectionNode.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Products/ProductTableNode.swift b/examples_extra/Shop/Shop/Scenes/Products/ProductTableNode.swift index 7cb0a2b9f8..816d405dcf 100644 --- a/examples_extra/Shop/Shop/Scenes/Products/ProductTableNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Products/ProductTableNode.swift @@ -1,9 +1,9 @@ // // ProductTableNode.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Products/ProductsCollectionViewController.swift b/examples_extra/Shop/Shop/Scenes/Products/ProductsCollectionViewController.swift index 39c63ead13..caa5278f07 100644 --- a/examples_extra/Shop/Shop/Scenes/Products/ProductsCollectionViewController.swift +++ b/examples_extra/Shop/Shop/Scenes/Products/ProductsCollectionViewController.swift @@ -1,9 +1,9 @@ // // ProductsCollectionViewController.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Products/ProductsLayout.swift b/examples_extra/Shop/Shop/Scenes/Products/ProductsLayout.swift index 8a6054c8c6..67f4a77837 100644 --- a/examples_extra/Shop/Shop/Scenes/Products/ProductsLayout.swift +++ b/examples_extra/Shop/Shop/Scenes/Products/ProductsLayout.swift @@ -1,9 +1,9 @@ // // ProductsLayout.swift -// Shop +// Texture // -// Created by Dimitri on 16/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Products/ProductsTableViewController.swift b/examples_extra/Shop/Shop/Scenes/Products/ProductsTableViewController.swift index ab33726d96..bfb851a3f6 100644 --- a/examples_extra/Shop/Shop/Scenes/Products/ProductsTableViewController.swift +++ b/examples_extra/Shop/Shop/Scenes/Products/ProductsTableViewController.swift @@ -1,9 +1,9 @@ // // ProductsTableViewController.swift -// Shop +// Texture // -// Created by Dimitri on 15/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Shop/ShopCellNode.swift b/examples_extra/Shop/Shop/Scenes/Shop/ShopCellNode.swift index df94f35bdc..5e71328296 100644 --- a/examples_extra/Shop/Shop/Scenes/Shop/ShopCellNode.swift +++ b/examples_extra/Shop/Shop/Scenes/Shop/ShopCellNode.swift @@ -1,9 +1,9 @@ // // ShopCellNode.swift -// Shop +// Texture // -// Created by Dimitri on 14/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Scenes/Shop/ShopViewController.swift b/examples_extra/Shop/Shop/Scenes/Shop/ShopViewController.swift index c32ce3f0a4..8feefa3f25 100644 --- a/examples_extra/Shop/Shop/Scenes/Shop/ShopViewController.swift +++ b/examples_extra/Shop/Shop/Scenes/Shop/ShopViewController.swift @@ -1,9 +1,9 @@ // // ShopViewController.swift -// Shop +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/examples_extra/Shop/Shop/Shop-Bridging-Header.h b/examples_extra/Shop/Shop/Shop-Bridging-Header.h index ba84a99573..943168eead 100644 --- a/examples_extra/Shop/Shop/Shop-Bridging-Header.h +++ b/examples_extra/Shop/Shop/Shop-Bridging-Header.h @@ -1,5 +1,9 @@ // -// Use this file to import your target's public headers that you would like to expose to Swift. +// Shop-Bridging-Header.h +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/Shop/ShopTests/ShopTests.swift b/examples_extra/Shop/ShopTests/ShopTests.swift index 4838065106..b42098bc4c 100644 --- a/examples_extra/Shop/ShopTests/ShopTests.swift +++ b/examples_extra/Shop/ShopTests/ShopTests.swift @@ -1,9 +1,9 @@ // // ShopTests.swift -// ShopTests +// Texture // -// Created by Dimitri on 10/11/2016. -// Copyright © 2016 Dimitri. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import XCTest diff --git a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h +++ b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m index c7da0d3cb1..662357cb71 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m +++ b/examples_extra/SynchronousConcurrency/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h index 9a2e1a09b4..2b8fe4ed9f 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.h @@ -1,18 +1,10 @@ // // AsyncTableViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m index d87c22ea54..2cacef05ea 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncTableViewController.m @@ -1,18 +1,10 @@ // // AsyncTableViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h index f307e65d6b..2c20ade6e9 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.h @@ -1,20 +1,10 @@ // // AsyncViewController.h -// Sample +// Texture // -// Created by Scott Goodson on 9/26/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m index 5354915b51..de9b71cc89 100644 --- a/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m +++ b/examples_extra/SynchronousConcurrency/Sample/AsyncViewController.m @@ -1,20 +1,10 @@ // // AsyncViewController.m -// Sample +// Texture // -// Created by Scott Goodson on 9/26/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AsyncViewController.h" diff --git a/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h index 1690acf54a..cdd60a3465 100644 --- a/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h +++ b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.h @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.h -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m index 66b490df06..d80c51caf2 100644 --- a/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m +++ b/examples_extra/SynchronousConcurrency/Sample/RandomCoreGraphicsNode.m @@ -1,20 +1,10 @@ // // RandomCoreGraphicsNode.m -// Sample +// Texture // -// Created by Scott Goodson on 9/5/15. -// -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "RandomCoreGraphicsNode.h" diff --git a/examples_extra/SynchronousConcurrency/Sample/main.m b/examples_extra/SynchronousConcurrency/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/SynchronousConcurrency/Sample/main.m +++ b/examples_extra/SynchronousConcurrency/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousKittens/Sample/AppDelegate.h b/examples_extra/SynchronousKittens/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples_extra/SynchronousKittens/Sample/AppDelegate.h +++ b/examples_extra/SynchronousKittens/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousKittens/Sample/AppDelegate.m b/examples_extra/SynchronousKittens/Sample/AppDelegate.m index 58fe564898..f8437855b0 100644 --- a/examples_extra/SynchronousKittens/Sample/AppDelegate.m +++ b/examples_extra/SynchronousKittens/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/SynchronousKittens/Sample/BlurbNode.h b/examples_extra/SynchronousKittens/Sample/BlurbNode.h index e6574bcd05..5451fb39f0 100644 --- a/examples_extra/SynchronousKittens/Sample/BlurbNode.h +++ b/examples_extra/SynchronousKittens/Sample/BlurbNode.h @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousKittens/Sample/BlurbNode.m b/examples_extra/SynchronousKittens/Sample/BlurbNode.m index 7b02ae93de..6014711d33 100644 --- a/examples_extra/SynchronousKittens/Sample/BlurbNode.m +++ b/examples_extra/SynchronousKittens/Sample/BlurbNode.m @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "BlurbNode.h" diff --git a/examples_extra/SynchronousKittens/Sample/KittenNode.h b/examples_extra/SynchronousKittens/Sample/KittenNode.h index 9193b9df29..5b0b04203e 100644 --- a/examples_extra/SynchronousKittens/Sample/KittenNode.h +++ b/examples_extra/SynchronousKittens/Sample/KittenNode.h @@ -1,18 +1,10 @@ // // KittenNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousKittens/Sample/KittenNode.mm b/examples_extra/SynchronousKittens/Sample/KittenNode.mm index 87e2c40f49..5fcebf393e 100644 --- a/examples_extra/SynchronousKittens/Sample/KittenNode.mm +++ b/examples_extra/SynchronousKittens/Sample/KittenNode.mm @@ -1,18 +1,10 @@ // // KittenNode.mm -// 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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "KittenNode.h" diff --git a/examples_extra/SynchronousKittens/Sample/ViewController.h b/examples_extra/SynchronousKittens/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/SynchronousKittens/Sample/ViewController.h +++ b/examples_extra/SynchronousKittens/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/SynchronousKittens/Sample/ViewController.m b/examples_extra/SynchronousKittens/Sample/ViewController.m index f10b60edbe..1757807a1d 100644 --- a/examples_extra/SynchronousKittens/Sample/ViewController.m +++ b/examples_extra/SynchronousKittens/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/SynchronousKittens/Sample/main.m b/examples_extra/SynchronousKittens/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/SynchronousKittens/Sample/main.m +++ b/examples_extra/SynchronousKittens/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/TextStressTest/Sample/AppDelegate.h b/examples_extra/TextStressTest/Sample/AppDelegate.h index 2aa29369b4..e4a477eb23 100644 --- a/examples_extra/TextStressTest/Sample/AppDelegate.h +++ b/examples_extra/TextStressTest/Sample/AppDelegate.h @@ -1,13 +1,10 @@ -/* This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * 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. - */ +// +// AppDelegate.h +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #import diff --git a/examples_extra/TextStressTest/Sample/AppDelegate.m b/examples_extra/TextStressTest/Sample/AppDelegate.m index 5be641c029..c54a53505e 100644 --- a/examples_extra/TextStressTest/Sample/AppDelegate.m +++ b/examples_extra/TextStressTest/Sample/AppDelegate.m @@ -2,12 +2,8 @@ // AppDelegate.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/TextStressTest/Sample/CollectionViewController.h b/examples_extra/TextStressTest/Sample/CollectionViewController.h index 159b2fa1c9..d9329bdb07 100644 --- a/examples_extra/TextStressTest/Sample/CollectionViewController.h +++ b/examples_extra/TextStressTest/Sample/CollectionViewController.h @@ -2,12 +2,8 @@ // CollectionViewController.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/TextStressTest/Sample/CollectionViewController.m b/examples_extra/TextStressTest/Sample/CollectionViewController.m index d93005236b..0464c376fa 100644 --- a/examples_extra/TextStressTest/Sample/CollectionViewController.m +++ b/examples_extra/TextStressTest/Sample/CollectionViewController.m @@ -2,12 +2,8 @@ // CollectionViewController.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "CollectionViewController.h" diff --git a/examples_extra/TextStressTest/Sample/TabBarController.h b/examples_extra/TextStressTest/Sample/TabBarController.h index 5a25bb04ac..a8d7f80512 100644 --- a/examples_extra/TextStressTest/Sample/TabBarController.h +++ b/examples_extra/TextStressTest/Sample/TabBarController.h @@ -2,12 +2,8 @@ // TabBarController.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/TextStressTest/Sample/TabBarController.m b/examples_extra/TextStressTest/Sample/TabBarController.m index a7905cb235..d056f1f679 100644 --- a/examples_extra/TextStressTest/Sample/TabBarController.m +++ b/examples_extra/TextStressTest/Sample/TabBarController.m @@ -2,12 +2,8 @@ // TabBarController.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TabBarController.h" diff --git a/examples_extra/TextStressTest/Sample/TextCellNode.h b/examples_extra/TextStressTest/Sample/TextCellNode.h index c4b35cfaf4..2ae855e5fb 100644 --- a/examples_extra/TextStressTest/Sample/TextCellNode.h +++ b/examples_extra/TextStressTest/Sample/TextCellNode.h @@ -2,12 +2,8 @@ // TextCellNode.h // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/TextStressTest/Sample/TextCellNode.m b/examples_extra/TextStressTest/Sample/TextCellNode.m index 13bb7694cb..4b777b5677 100644 --- a/examples_extra/TextStressTest/Sample/TextCellNode.m +++ b/examples_extra/TextStressTest/Sample/TextCellNode.m @@ -2,12 +2,8 @@ // TextCellNode.m // Texture // -// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved. -// 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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "TextCellNode.h" diff --git a/examples_extra/TextStressTest/Sample/ViewController.h b/examples_extra/TextStressTest/Sample/ViewController.h index d0e9200d88..8c2d4162b9 100644 --- a/examples_extra/TextStressTest/Sample/ViewController.h +++ b/examples_extra/TextStressTest/Sample/ViewController.h @@ -1,13 +1,10 @@ -/* This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * 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. - */ +// +// ViewController.h +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #import diff --git a/examples_extra/TextStressTest/Sample/ViewController.m b/examples_extra/TextStressTest/Sample/ViewController.m index 3c21c64b8a..f14bba18b3 100644 --- a/examples_extra/TextStressTest/Sample/ViewController.m +++ b/examples_extra/TextStressTest/Sample/ViewController.m @@ -1,13 +1,10 @@ -/* This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * 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. - */ +// +// ViewController.m +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #import "ViewController.h" #import diff --git a/examples_extra/TextStressTest/Sample/main.m b/examples_extra/TextStressTest/Sample/main.m index ae9488711c..1745cc192d 100644 --- a/examples_extra/TextStressTest/Sample/main.m +++ b/examples_extra/TextStressTest/Sample/main.m @@ -1,13 +1,10 @@ -/* This file provided by Facebook is for non-commercial testing and evaluation - * purposes only. Facebook reserves all rights not expressly granted. - * - * 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. - */ +// +// main.m +// Texture +// +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 +// #import diff --git a/examples_extra/VideoTableView/Sample/AppDelegate.h b/examples_extra/VideoTableView/Sample/AppDelegate.h index 5274628a9e..c30a27f4dc 100644 --- a/examples_extra/VideoTableView/Sample/AppDelegate.h +++ b/examples_extra/VideoTableView/Sample/AppDelegate.h @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/VideoTableView/Sample/AppDelegate.m b/examples_extra/VideoTableView/Sample/AppDelegate.m index 58fe564898..f8437855b0 100644 --- a/examples_extra/VideoTableView/Sample/AppDelegate.m +++ b/examples_extra/VideoTableView/Sample/AppDelegate.m @@ -1,18 +1,10 @@ // // AppDelegate.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/examples_extra/VideoTableView/Sample/BlurbNode.h b/examples_extra/VideoTableView/Sample/BlurbNode.h index e6574bcd05..5451fb39f0 100644 --- a/examples_extra/VideoTableView/Sample/BlurbNode.h +++ b/examples_extra/VideoTableView/Sample/BlurbNode.h @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/VideoTableView/Sample/BlurbNode.m b/examples_extra/VideoTableView/Sample/BlurbNode.m index 36dea1ecae..ba39439157 100644 --- a/examples_extra/VideoTableView/Sample/BlurbNode.m +++ b/examples_extra/VideoTableView/Sample/BlurbNode.m @@ -1,18 +1,10 @@ // // BlurbNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "BlurbNode.h" diff --git a/examples_extra/VideoTableView/Sample/NicCageNode.h b/examples_extra/VideoTableView/Sample/NicCageNode.h index 6dbff3ffa5..b2937f6a44 100644 --- a/examples_extra/VideoTableView/Sample/NicCageNode.h +++ b/examples_extra/VideoTableView/Sample/NicCageNode.h @@ -1,18 +1,10 @@ // // NicCageNode.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/VideoTableView/Sample/NicCageNode.mm b/examples_extra/VideoTableView/Sample/NicCageNode.mm index 95a62d957f..5e960ee013 100644 --- a/examples_extra/VideoTableView/Sample/NicCageNode.mm +++ b/examples_extra/VideoTableView/Sample/NicCageNode.mm @@ -2,17 +2,9 @@ // NicCageNode.mm // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "NicCageNode.h" diff --git a/examples_extra/VideoTableView/Sample/ViewController.h b/examples_extra/VideoTableView/Sample/ViewController.h index fc52c022f2..c8a0626291 100644 --- a/examples_extra/VideoTableView/Sample/ViewController.h +++ b/examples_extra/VideoTableView/Sample/ViewController.h @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/examples_extra/VideoTableView/Sample/ViewController.m b/examples_extra/VideoTableView/Sample/ViewController.m index a57e3b2094..5e1553c571 100644 --- a/examples_extra/VideoTableView/Sample/ViewController.m +++ b/examples_extra/VideoTableView/Sample/ViewController.m @@ -1,18 +1,10 @@ // // ViewController.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/examples_extra/VideoTableView/Sample/main.m b/examples_extra/VideoTableView/Sample/main.m index 756080fb2b..511cd1a7ac 100644 --- a/examples_extra/VideoTableView/Sample/main.m +++ b/examples_extra/VideoTableView/Sample/main.m @@ -1,18 +1,10 @@ // // main.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. -// -// 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. +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/smoke-tests/Framework/Sample/AppDelegate.swift b/smoke-tests/Framework/Sample/AppDelegate.swift index 843523a436..a2c10adbba 100644 --- a/smoke-tests/Framework/Sample/AppDelegate.swift +++ b/smoke-tests/Framework/Sample/AppDelegate.swift @@ -2,17 +2,9 @@ // AppDelegate.swift // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/smoke-tests/Framework/Sample/ViewController.swift b/smoke-tests/Framework/Sample/ViewController.swift index 544850d42d..9d96ac7477 100644 --- a/smoke-tests/Framework/Sample/ViewController.swift +++ b/smoke-tests/Framework/Sample/ViewController.swift @@ -2,17 +2,9 @@ // ViewController.swift // 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 /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 +// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // import UIKit diff --git a/smoke-tests/Life Without CocoaPods/Life With Frameworks/main.m b/smoke-tests/Life Without CocoaPods/Life With Frameworks/main.m index 3f9d50d481..feb53cc3f7 100644 --- a/smoke-tests/Life Without CocoaPods/Life With Frameworks/main.m +++ b/smoke-tests/Life Without CocoaPods/Life With Frameworks/main.m @@ -1,9 +1,9 @@ // // main.m -// Life With Frameworks +// Texture // -// Created by Kiel Gillard on 7/07/2016. -// Copyright © 2016 Facebook. All rights reserved. +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h index bda0aacab9..75aff7fc14 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.h @@ -2,17 +2,8 @@ // AppDelegate.h // 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 /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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m index 14306e7930..d6890ff2e3 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/AppDelegate.m @@ -2,17 +2,8 @@ // AppDelegate.m // 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 /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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "AppDelegate.h" diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h index 1d87bcb6e1..261e9ff480 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.h @@ -2,17 +2,8 @@ // ViewController.h // 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 /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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m index 181eda42c2..106ee524f4 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/ViewController.m @@ -2,17 +2,8 @@ // ViewController.m // 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 /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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import "ViewController.h" diff --git a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m index 27c659b765..ec43dab250 100644 --- a/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m +++ b/smoke-tests/Life Without CocoaPods/Life Without CocoaPods/main.m @@ -2,17 +2,8 @@ // main.m // 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 /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 +// Copyright (c) Pinterest, Inc. All rights reserved. +// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // #import From dcda33b6927d6e45fc5b8930f50f647546f17cbc Mon Sep 17 00:00:00 2001 From: "J.T. Burgess" Date: Wed, 29 Aug 2018 19:39:23 -0500 Subject: [PATCH 61/97] Fix Typo (#1089) "preform" -> "perform" --- docs/_docs/node-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/node-overview.md b/docs/_docs/node-overview.md index 6f3b4ca1a7..c4f6d413cd 100755 --- a/docs/_docs/node-overview.md +++ b/docs/_docs/node-overview.md @@ -8,7 +8,7 @@ nextPage: subclassing.html Texture offers the following nodes. -A key advantage of using nodes over UIKit components is that **all nodes preform layout and display off of the main thread**, so that the main thread is available to immediately respond to user interaction events. +A key advantage of using nodes over UIKit components is that **all nodes perform layout and display off of the main thread**, so that the main thread is available to immediately respond to user interaction events. From cae37623fd7c5b9fbf3c1f33f2740249a455901d Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Thu, 30 Aug 2018 09:30:34 -0700 Subject: [PATCH 62/97] Add subnode should not be called with the lock held. (#1088) --- Source/ASImageNode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index cc2905d273..b8d249aee5 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -251,7 +251,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); // For debugging purposes we don't care about locking for now if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) { - ASPerformBlockOnMainThread(^{ + dispatch_async(dispatch_get_main_queue(), ^{ _debugLabelNode = [[ASTextNode alloc] init]; _debugLabelNode.layerBacked = YES; [self addSubnode:_debugLabelNode]; From b556b2f7759e07d05b9abc9ae3c6b201decfab36 Mon Sep 17 00:00:00 2001 From: "J.T. Burgess" Date: Fri, 31 Aug 2018 00:04:23 -0500 Subject: [PATCH 63/97] Fix a couple typos. (#1092) --- docs/_docs/cell-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_docs/cell-node.md b/docs/_docs/cell-node.md index 10fa271cfe..60b1cfad3f 100755 --- a/docs/_docs/cell-node.md +++ b/docs/_docs/cell-node.md @@ -138,5 +138,5 @@ Using this option does not eliminate all of the performance advantages of Textur UITableViewCell has properties like selectionStyle, accessoryType and seperatorInset that many of us use sometimes to give the Cell more detail. For this case ASCellNode has the same (passthrough) properties that can be used.
    -UIKits UITableViewCell contains ASCellNode as a subview. Depending how your ASLayoutSpec is defined it may occure that your Layout overlays the UITableViewCell.accessoryView and therefore not visible. Make sure that your Layout doesn't overlays any UITableViewCell's specific properties. +UIKits UITableViewCell contains ASCellNode as a subview. Depending how your ASLayoutSpec is defined it may occur that your Layout overlays the UITableViewCell.accessoryView and therefore is not visible. Make sure that your Layout doesn't overlay any of UITableViewCell's specific properties.
    From 1fe241df91e2df8ab6915934b9c290e52b83b1eb Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Thu, 30 Aug 2018 22:04:40 -0700 Subject: [PATCH 64/97] #trivial Shouldn't hold the lock while adding subnodes (#1091) * Shouldn't hold the lock while adding subnodes * Add comments, good call @nguyenhuy --- Source/ASControlNode.mm | 4 +++- Source/ASImageNode.mm | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/ASControlNode.mm b/Source/ASControlNode.mm index c04faccc7c..1256d2d629 100644 --- a/Source/ASControlNode.mm +++ b/Source/ASControlNode.mm @@ -295,7 +295,9 @@ CGRect _ASControlNodeGetExpandedBounds(ASControlNode *controlNode); // only show tap-able areas for views with 1 or more addTarget:action: pairs if ([ASControlNode enableHitTestDebug] && _debugHighlightOverlay == nil) { - ASPerformBlockOnMainThread(^{ + // do not use ASPerformBlockOnMainThread here, if it performs the block synchronously it will continue + // holding the lock while calling addSubnode. + dispatch_async(dispatch_get_main_queue(), ^{ // add a highlight overlay node with area of ASControlNode + UIEdgeInsets self.clipsToBounds = NO; _debugHighlightOverlay = [[ASImageNode alloc] init]; diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index b8d249aee5..f98356d671 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -251,6 +251,8 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); // For debugging purposes we don't care about locking for now if ([ASImageNode shouldShowImageScalingOverlay] && _debugLabelNode == nil) { + // do not use ASPerformBlockOnMainThread here, if it performs the block synchronously it will continue + // holding the lock while calling addSubnode. dispatch_async(dispatch_get_main_queue(), ^{ _debugLabelNode = [[ASTextNode alloc] init]; _debugLabelNode.layerBacked = YES; From eba4e290a57031b5b28546adc1169005c3f63992 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Fri, 31 Aug 2018 13:16:55 -0700 Subject: [PATCH 65/97] Allow to add interface state delegate in background. (#1090) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Allow to add interface state delegate in background threads. * Allow to add interface state delegate in background threads. * lock around _interfaceStateDelegates * lock _interfaceStateDelegates to local variable * Fix comments * remove extra spaces --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 77 +++++++++++++---------------------------- 2 files changed, 26 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d41a74f20f..53ae274b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASDisplayNode] Allow add/remove interface state delegates on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1090](https://github.com/TextureGroup/Texture/pull/1090) - [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077) - [ASNetworkImageNode] Allow delegate methods to be called on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1007](https://github.com/TextureGroup/Texture/pull/1007) - [ASLayoutTransition] Add support for preserving order after node moves during transitions. (This order defines the z-order as well.) [Kevin Smith](https://github.com/wiseoldduck) [#1006] diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index f24a9cb28d..3631bd522b 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -452,6 +452,16 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); #pragma mark - Loading +#define ASDisplayNodeCallInterfaceStateDelegates(method) \ + __instanceLock__.lock(); \ + NSHashTable *delegates = [_interfaceStateDelegates copy]; \ + __instanceLock__.unlock(); \ + for (id delegate in delegates) { \ + if ([delegate respondsToSelector:@selector(method)]) { \ + [delegate method]; \ + } \ + } + - (BOOL)_locked_shouldLoadViewOrLayer { ASAssertLocked(__instanceLock__); @@ -564,12 +574,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); for (ASDisplayNodeDidLoadBlock block in onDidLoadBlocks) { block(self); } - - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(nodeDidLoad)]) { - [delegate nodeDidLoad]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(nodeDidLoad); } - (void)didLoad @@ -1274,11 +1279,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(nodeDidLayout)]) { - [delegate nodeDidLayout]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(nodeDidLayout); } #pragma mark Layout Transition @@ -1501,12 +1502,7 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS if (_pendingDisplayNodes.isEmpty) { [self hierarchyDisplayDidFinish]; - - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(hierarchyDisplayDidFinish)]) { - [delegate hierarchyDisplayDidFinish]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(hierarchyDisplayDidFinish); BOOL placeholderShouldPersist = [self placeholderShouldPersist]; @@ -3217,7 +3213,10 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // Subclass hook ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertMainThread(); - for (id delegate in _interfaceStateDelegates) { + __instanceLock__.lock(); + NSHashTable *delegates = [_interfaceStateDelegates copy]; + __instanceLock__.unlock(); + for (id delegate in delegates) { if ([delegate respondsToSelector:@selector(interfaceStateDidChange:fromState:)]) { [delegate interfaceStateDidChange:newState fromState:oldState]; } @@ -3233,8 +3232,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)addInterfaceStateDelegate:(id )interfaceStateDelegate { - ASDisplayNodeAssertMainThread(); - + ASDN::MutexLocker l(__instanceLock__); // Not a fan of lazy loading, but this method won't get called very often and avoiding // the overhead of creating this is probably worth it. if (_interfaceStateDelegates == nil) { @@ -3245,7 +3243,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)removeInterfaceStateDelegate:(id )interfaceStateDelegate { - ASDisplayNodeAssertMainThread(); + ASDN::MutexLocker l(__instanceLock__); [_interfaceStateDelegates removeObject:interfaceStateDelegate]; } @@ -3260,11 +3258,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didEnterVisibleState)]) { - [delegate didEnterVisibleState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didEnterVisibleState); #if AS_ENABLE_TIPS [ASTipsController.shared nodeDidAppear:self]; #endif @@ -3275,11 +3269,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didExitVisibleState)]) { - [delegate didExitVisibleState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didExitVisibleState); } - (BOOL)isInDisplayState @@ -3293,11 +3283,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didEnterDisplayState)]) { - [delegate didEnterDisplayState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didEnterDisplayState); } - (void)didExitDisplayState @@ -3305,11 +3291,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didExitDisplayState)]) { - [delegate didExitDisplayState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didExitDisplayState); } - (BOOL)isInPreloadState @@ -3359,23 +3341,14 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (self.automaticallyManagesSubnodes) { [self layoutIfNeeded]; } - - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didEnterPreloadState)]) { - [delegate didEnterPreloadState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didEnterPreloadState); } - (void)didExitPreloadState { ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - for (id delegate in _interfaceStateDelegates) { - if ([delegate respondsToSelector:@selector(didExitPreloadState)]) { - [delegate didExitPreloadState]; - } - } + ASDisplayNodeCallInterfaceStateDelegates(didExitPreloadState); } - (void)clearContents From dbcf8babb8e87b0ac8652bc93ffc81c71a81bb65 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Wed, 5 Sep 2018 08:08:46 -0700 Subject: [PATCH 66/97] Fix collection editing (#1081) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Fix collection cell editing bug for iOS 9 & 10 * Rename to reordering. * Adjust _reordering more acuratedly * Add change log --- CHANGELOG.md | 1 + Source/ASCollectionView.mm | 32 +++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53ae274b7b..c3812f80b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASCollectionView] Fix reording of cells manually for iOS 9 & 10. [Max Wang](https://github.com/wsdwsd0829). [#1081](https://github.com/TextureGroup/Texture/pull/1081) - [ASDisplayNode] Allow add/remove interface state delegates on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1090](https://github.com/TextureGroup/Texture/pull/1090) - [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077) - [ASNetworkImageNode] Allow delegate methods to be called on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1007](https://github.com/TextureGroup/Texture/pull/1007) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 47ea99bf0b..69cd531478 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -139,6 +139,12 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; * (0 sections) we always check at least once after each update (initial reload is the first update.) */ BOOL _hasEverCheckedForBatchFetchingDueToUpdate; + + /** + * Set during beginInteractiveMovementForItemAtIndexPath and UIGestureRecognizerStateEnded + * (or UIGestureRecognizerStateFailed, UIGestureRecognizerStateCancelled. + */ + BOOL _reordering; /** * Counter used to keep track of nested batch updates. @@ -1013,9 +1019,29 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; - (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath { ASDisplayNodeAssertMainThread(); - [self performBatchUpdates:^{ - [_changeSet moveItemAtIndexPath:indexPath toIndexPath:newIndexPath animationOptions:kASCollectionViewAnimationNone]; - } completion:nil]; + if (!_reordering) { + [self performBatchUpdates:^{ + [_changeSet moveItemAtIndexPath:indexPath toIndexPath:newIndexPath animationOptions:kASCollectionViewAnimationNone]; + } completion:nil]; + } else { + [super moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; + } +} + +- (BOOL)beginInteractiveMovementForItemAtIndexPath:(NSIndexPath *)indexPath { + BOOL success = [super beginInteractiveMovementForItemAtIndexPath:indexPath]; + _reordering = success; + return success; +} + +- (void)endInteractiveMovement { + _reordering = NO; + [super endInteractiveMovement]; +} + +- (void)cancelInteractiveMovement { + _reordering = NO; + [super cancelInteractiveMovement]; } #pragma mark - From 6b0d57eda4079dc62fcb490af4b8ccdcdeba9a7a Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Wed, 5 Sep 2018 22:49:08 -0700 Subject: [PATCH 67/97] Explicitly cast to (void *) -> (const void **) to satisfy strict compilers (#1098) --- Source/ASCollections.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASCollections.m b/Source/ASCollections.m index b82a428619..4428d07389 100644 --- a/Source/ASCollections.m +++ b/Source/ASCollections.m @@ -53,7 +53,7 @@ static const void *ASTransferRetain(CFAllocatorRef allocator, const void *val) { return result; } - NSArray *result = (__bridge_transfer NSArray *)CFArrayCreate(gTransferAllocator, (void *)pointers, count, &callbacks); + NSArray *result = (__bridge_transfer NSArray *)CFArrayCreate(gTransferAllocator, (const void **)(void *)pointers, count, &callbacks); memset(pointers, 0, count * sizeof(id)); return result; } From 395fbd1302e0a2294070a97156e417e55aa07cc2 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Wed, 5 Sep 2018 22:52:41 -0700 Subject: [PATCH 68/97] Reuse interface state delegates when calling out #trivial (#1099) * Reuse interface state delegates when calling out instead of always copying --- Source/ASDisplayNode.mm | 7 ++++++- Source/Private/ASDisplayNodeInternal.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 3631bd522b..2cf3438a6e 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -454,7 +454,10 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); #define ASDisplayNodeCallInterfaceStateDelegates(method) \ __instanceLock__.lock(); \ - NSHashTable *delegates = [_interfaceStateDelegates copy]; \ + NSHashTable *delegates = _copiedInterfaceStateDelegates; \ + if (!delegates) { \ + delegates = _copiedInterfaceStateDelegates = [_interfaceStateDelegates copy]; \ + } \ __instanceLock__.unlock(); \ for (id delegate in delegates) { \ if ([delegate respondsToSelector:@selector(method)]) { \ @@ -3238,12 +3241,14 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (_interfaceStateDelegates == nil) { _interfaceStateDelegates = [NSHashTable weakObjectsHashTable]; } + _copiedInterfaceStateDelegates = nil; [_interfaceStateDelegates addObject:interfaceStateDelegate]; } - (void)removeInterfaceStateDelegate:(id )interfaceStateDelegate { ASDN::MutexLocker l(__instanceLock__); + _copiedInterfaceStateDelegates = nil; [_interfaceStateDelegates removeObject:interfaceStateDelegate]; } diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 1844796941..18eb03c5c6 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -249,6 +249,10 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest #endif NSHashTable > *_interfaceStateDelegates; + + // never mutated, used to enumerate delegates outside of lock. + // set to nil when mutating _interfaceStateDelegates. + NSHashTable > *_copiedInterfaceStateDelegates; } + (void)scheduleNodeForRecursiveDisplay:(ASDisplayNode *)node; From 56c94a89416c50f499713d03f4ad6418550359b0 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 6 Sep 2018 11:08:45 -0700 Subject: [PATCH 69/97] Add a -textureDidInitialize delegate callback (#1100) --- CHANGELOG.md | 1 + Source/ASConfigurationDelegate.h | 10 ++++++++++ Source/ASConfigurationInternal.h | 5 +++++ Source/ASConfigurationInternal.m | 22 ++++++++++++++++++++++ Source/Private/ASInternalHelpers.m | 2 ++ 5 files changed, 40 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3812f80b5..d607467bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ - Optimize text stack by removing unneeded copying. [Adlai Holler](https://github.com/Adlai-Holler) - Renamed `accessibleElements` to `accessibilityElements` and removed the re-definition of the property in ASDisplayView. [Jia Wern Lim](https://github.com/jiawernlim) - Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen) +- Add a delegate callback for when the framework has initialized. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASConfigurationDelegate.h b/Source/ASConfigurationDelegate.h index 5f94d0a36b..127ec3eb14 100644 --- a/Source/ASConfigurationDelegate.h +++ b/Source/ASConfigurationDelegate.h @@ -22,6 +22,16 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)textureDidActivateExperimentalFeatures:(ASExperimentalFeatures)features; +@optional + +/** + * Texture framework initialized. This method is called synchronously + * on the main thread from ASInitializeFrameworkMainThread if you defined + * AS_INITIALIZE_FRAMEWORK_MANUALLY or from the default initialization point + * (currently +load) otherwise. + */ +- (void)textureDidInitialize; + @end NS_ASSUME_NONNULL_END diff --git a/Source/ASConfigurationInternal.h b/Source/ASConfigurationInternal.h index fa3bb4c56f..8e744e65cd 100644 --- a/Source/ASConfigurationInternal.h +++ b/Source/ASConfigurationInternal.h @@ -22,6 +22,11 @@ NS_ASSUME_NONNULL_BEGIN */ AS_EXTERN BOOL ASActivateExperimentalFeature(ASExperimentalFeatures option); +/** + * Notify the configuration delegate that the framework initialized, if needed. + */ +AS_EXTERN void ASNotifyInitialized(void); + AS_SUBCLASSING_RESTRICTED @interface ASConfigurationManager : NSObject diff --git a/Source/ASConfigurationInternal.m b/Source/ASConfigurationInternal.m index fd2e537913..4fb9685ea8 100644 --- a/Source/ASConfigurationInternal.m +++ b/Source/ASConfigurationInternal.m @@ -7,6 +7,7 @@ // #import "ASConfigurationInternal.h" +#import #import #import #import @@ -16,6 +17,7 @@ @implementation ASConfigurationManager { ASConfiguration *_config; dispatch_queue_t _delegateQueue; + BOOL _frameworkInitialized; _Atomic(ASExperimentalFeatures) _activatedExperiments; } @@ -51,6 +53,21 @@ return self; } +- (void)frameworkDidInitialize +{ + ASDisplayNodeAssertMainThread(); + if (_frameworkInitialized) { + ASDisplayNodeFailAssert(@"Framework initialized twice."); + return; + } + _frameworkInitialized = YES; + + let delegate = _config.delegate; + if ([delegate respondsToSelector:@selector(textureDidInitialize)]) { + [delegate textureDidInitialize]; + } +} + - (BOOL)activateExperimentalFeature:(ASExperimentalFeatures)requested { if (_config == nil) { @@ -90,3 +107,8 @@ BOOL ASActivateExperimentalFeature(ASExperimentalFeatures feature) { return [ASGetSharedConfigMgr() activateExperimentalFeature:feature]; } + +void ASNotifyInitialized() +{ + [ASGetSharedConfigMgr() frameworkDidInitialize]; +} diff --git a/Source/Private/ASInternalHelpers.m b/Source/Private/ASInternalHelpers.m index 3dd8f0c57b..484560aa89 100644 --- a/Source/Private/ASInternalHelpers.m +++ b/Source/Private/ASInternalHelpers.m @@ -14,6 +14,7 @@ #import #import +#import #import #import @@ -53,6 +54,7 @@ void ASInitializeFrameworkMainThread(void) allowsGroupOpacityFromUIKitOrNil = @(layer.allowsGroupOpacity); allowsEdgeAntialiasingFromUIKitOrNil = @(layer.allowsEdgeAntialiasing); } + ASNotifyInitialized(); } BOOL ASSubclassOverridesSelector(Class superclass, Class subclass, SEL selector) From 35e9d857d57260a4b72bd7ab6225816363f8077d Mon Sep 17 00:00:00 2001 From: Muukii Date: Sun, 9 Sep 2018 04:01:13 +0900 Subject: [PATCH 70/97] Fix URL for blog about Pinterest (#1105) --- docs/showcase.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/showcase.md b/docs/showcase.md index fed05f3d03..711a55406d 100755 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -26,7 +26,7 @@ permalink: /showcase.html
    Pinterest
    - Re-architecting Pinterest's iOS app + Re-architecting Pinterest's iOS app
    From a798cf9008e3357f0c5a7aa2a8d4cec4813c4140 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 12 Sep 2018 09:39:22 -0700 Subject: [PATCH 71/97] Call out to AnimatedImage subclass hook in the next runloop cycle (#1087) --- CHANGELOG.md | 1 + Source/ASImageNode+AnimatedImage.mm | 37 +++++++++++++++++++---------- Source/ASImageNode.h | 3 +-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d607467bdc..714b1f9d12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ - Standardize property declaration style. [Adlai Holler](https://github.com/Adlai-Holler) - [ASTableView] Fix an issue that causes table view to use one of a cell's invalid layouts instead of generating a new one. [Huy Nguyen](https://github.com/nguyenhuy) [#942](https://github.com/TextureGroup/Texture/pull/942) - Introduce let / var macros and some further cleanup. [Michael Schneider](https://github.com/maicki) [#1012](https://github.com/TextureGroup/Texture/pull/1012) +- Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) ## 2.6 - [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon) diff --git a/Source/ASImageNode+AnimatedImage.mm b/Source/ASImageNode+AnimatedImage.mm index a9d6d2227a..298e21cb29 100644 --- a/Source/ASImageNode+AnimatedImage.mm +++ b/Source/ASImageNode+AnimatedImage.mm @@ -44,12 +44,12 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; - (void)_locked_setAnimatedImage:(id )animatedImage { ASAssertLocked(__instanceLock__); - + if (ASObjectIsEqual(_animatedImage, animatedImage) && (animatedImage == nil || animatedImage.playbackReady)) { return; } - id previousAnimatedImage = _animatedImage; + __block id previousAnimatedImage = _animatedImage; _animatedImage = animatedImage; @@ -70,22 +70,35 @@ NSString *const ASAnimatedImageDefaultRunLoopMode = NSRunLoopCommonModes; [self _locked_setShouldAnimate:YES]; } } else { - // Clean up after ourselves. - self.contents = nil; - [self setCoverImage:nil]; - } - - [self animatedImageSet:_animatedImage previousAnimatedImage:previousAnimatedImage]; + // Clean up after ourselves. - // Animated image can take while to dealloc, do it off the main queue - if (previousAnimatedImage != nil) { - ASPerformBackgroundDeallocation(&previousAnimatedImage); + // Don't bother using a `_locked` version for setting contnst as it should be pretty safe calling it with + // reaquire the lock and would add overhead to introduce this version + self.contents = nil; + [self _locked_setCoverImage:nil]; } + + // Push calling subclass to the next runloop cycle + // We have to schedule the block on the common modes otherwise the tracking mode will not be included and it will + // not fire e.g. while scrolling down + CFRunLoopPerformBlock(CFRunLoopGetCurrent(), kCFRunLoopCommonModes, ^(void) { + [self animatedImageSet:animatedImage previousAnimatedImage:previousAnimatedImage]; + + // Animated image can take while to dealloc, do it off the main queue + if (previousAnimatedImage != nil) { + ASPerformBackgroundDeallocation(&previousAnimatedImage); + } + }); + // Don't need to wakeup the runloop as the current is already running + // CFRunLoopWakeUp(runLoop); // Should not be necessary } - (void)animatedImageSet:(id )newAnimatedImage previousAnimatedImage:(id )previousAnimatedImage { - //Subclasses may override + // Subclass hook should not be called with the lock held + ASAssertUnlocked(__instanceLock__); + + // Subclasses may override } - (id )animatedImage diff --git a/Source/ASImageNode.h b/Source/ASImageNode.h index ea540a3d3f..d6271f55ac 100644 --- a/Source/ASImageNode.h +++ b/Source/ASImageNode.h @@ -173,9 +173,8 @@ typedef UIImage * _Nullable (^asimagenode_modification_block_t)(UIImage *image); * * @discussion This method is for subclasses to override so they can know if an animated image * has been set on the node. - * @warning this method is called with the node's lock held. */ -- (void)animatedImageSet:(id )newAnimatedImage previousAnimatedImage:(id )previousAnimatedImage; +- (void)animatedImageSet:(nullable id )newAnimatedImage previousAnimatedImage:(nullable id )previousAnimatedImage ASDISPLAYNODE_REQUIRES_SUPER; @end From 69ab24bc009e76ee48184ffa26f5eb43882ba701 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Wed, 12 Sep 2018 09:48:39 -0700 Subject: [PATCH 72/97] Make interface state delegate non optional (#1112) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Fix collection cell editing bug for iOS 9 & 10 * Revert "Fix collection cell editing bug for iOS 9 & 10" This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea. * Make interface state delegate protocol non-optional. * add change log * add missing removal * add required method to ASNodeController * fix indentation * Update CHANGELOG.md --- CHANGELOG.md | 1 + Source/ASDisplayNode+InterfaceState.h | 1 - Source/ASDisplayNode.mm | 8 ++------ Source/ASNodeController+Beta.h | 2 ++ Source/ASNodeController+Beta.mm | 2 ++ 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 714b1f9d12..e9752ddbda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [Breaking][ASDisplayNode] Make interface state delegate protocol required. [Max Wang](https://github.com/wsdwsd0829). [#1112](https://github.com/TextureGroup/Texture/pull/1112) - [ASCollectionView] Fix reording of cells manually for iOS 9 & 10. [Max Wang](https://github.com/wsdwsd0829). [#1081](https://github.com/TextureGroup/Texture/pull/1081) - [ASDisplayNode] Allow add/remove interface state delegates on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1090](https://github.com/TextureGroup/Texture/pull/1090) - [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses).[Scott Goodson](https://github.com/appleguy) [#1077](https://github.com/TextureGroup/Texture/pull/1077) diff --git a/Source/ASDisplayNode+InterfaceState.h b/Source/ASDisplayNode+InterfaceState.h index cca1e4e729..ec4414bb77 100644 --- a/Source/ASDisplayNode+InterfaceState.h +++ b/Source/ASDisplayNode+InterfaceState.h @@ -40,7 +40,6 @@ typedef NS_OPTIONS(NSUInteger, ASInterfaceState) }; @protocol ASInterfaceStateDelegate -@optional /** * @abstract Called whenever any bit in the ASInterfaceState bitfield is changed. diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 2cf3438a6e..c3d914671e 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -460,9 +460,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); } \ __instanceLock__.unlock(); \ for (id delegate in delegates) { \ - if ([delegate respondsToSelector:@selector(method)]) { \ - [delegate method]; \ - } \ + [delegate method]; \ } - (BOOL)_locked_shouldLoadViewOrLayer @@ -3220,9 +3218,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { NSHashTable *delegates = [_interfaceStateDelegates copy]; __instanceLock__.unlock(); for (id delegate in delegates) { - if ([delegate respondsToSelector:@selector(interfaceStateDidChange:fromState:)]) { - [delegate interfaceStateDidChange:newState fromState:oldState]; - } + [delegate interfaceStateDidChange:newState fromState:oldState]; } } diff --git a/Source/ASNodeController+Beta.h b/Source/ASNodeController+Beta.h index 7c00ba8fed..e5bcc29622 100644 --- a/Source/ASNodeController+Beta.h +++ b/Source/ASNodeController+Beta.h @@ -38,6 +38,8 @@ - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState ASDISPLAYNODE_REQUIRES_SUPER; +- (void)hierarchyDisplayDidFinish ASDISPLAYNODE_REQUIRES_SUPER; + @end @interface ASDisplayNode (ASNodeController) diff --git a/Source/ASNodeController+Beta.mm b/Source/ASNodeController+Beta.mm index 77199b25f6..201b3cfb93 100644 --- a/Source/ASNodeController+Beta.mm +++ b/Source/ASNodeController+Beta.mm @@ -80,6 +80,8 @@ - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState {} +- (void)hierarchyDisplayDidFinish {} + @end @implementation ASDisplayNode (ASNodeController) From 1d2f1f2ed8c3a4c62a922c19f6eea83bfe66d163 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 13 Sep 2018 11:05:48 -0700 Subject: [PATCH 73/97] Don't setNeedsDisplay on text node measure #trivial (#1116) --- Source/ASTextNode2.mm | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index e17c707254..1cdb77f1ab 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -246,8 +246,6 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; [self prepareAttributedString:mutableText]; ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:container text:mutableText]; - [self setNeedsDisplay]; - return layout.textBoundingSize; } From eb5bd0942bda4939b42eab188e1d62357e3058ba Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Thu, 13 Sep 2018 11:06:12 -0700 Subject: [PATCH 74/97] Don't copy container during ASTextNode2 layout (#1115) --- CHANGELOG.md | 1 + Source/ASTextNode2.mm | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9752ddbda..731724ca30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ - Renamed `accessibleElements` to `accessibilityElements` and removed the re-definition of the property in ASDisplayView. [Jia Wern Lim](https://github.com/jiawernlim) - Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen) - Add a delegate callback for when the framework has initialized. [Adlai Holler](https://github.com/Adlai-Holler) +- Improve TextNode2 by skipping an unneeded copy during measurement. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 1cdb77f1ab..813326bddf 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -232,19 +232,12 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; ASLockScopeSelf(); - ASTextContainer *container; - if (!CGSizeEqualToSize(container.size, constrainedSize)) { - container = [_textContainer copy]; - container.size = constrainedSize; - [container makeImmutable]; - } else { - container = _textContainer; - } + _textContainer.size = constrainedSize; [self _ensureTruncationText]; NSMutableAttributedString *mutableText = [_attributedText mutableCopy]; [self prepareAttributedString:mutableText]; - ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:container text:mutableText]; + ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:_textContainer text:mutableText]; return layout.textBoundingSize; } From f759d5cc7de965cc9911029c95eefbcc7a9e7551 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Fri, 14 Sep 2018 08:48:19 -0700 Subject: [PATCH 75/97] Improve locking around clearContents (#1107) * Improve locking around clearContents * Add changelog --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 15 +++++++++++---- Source/ASImageNode.mm | 7 +++---- Source/ASMultiplexImageNode.mm | 5 ++++- Source/Details/ASRangeController.mm | 2 ++ 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 731724ca30..6a9e7a5324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster. [Eric Jensen](https://github.com/ejensen) - Add a delegate callback for when the framework has initialized. [Adlai Holler](https://github.com/Adlai-Holler) - Improve TextNode2 by skipping an unneeded copy during measurement. [Adlai Holler](https://github.com/Adlai-Holler) +- Improve locking around clearContents [Michael Schneider](https://github.com/maicki) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index c3d914671e..d84b5cbe0e 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -3144,8 +3144,10 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [self setDisplaySuspended:YES]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(__instanceLock__); - if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { + __instanceLock__.lock(); + ASInterfaceState interfaceState = _interfaceState; + __instanceLock__.unlock(); + if (ASInterfaceStateIncludesDisplay(interfaceState) == NO) { [self clearContents]; } }); @@ -3162,8 +3164,10 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [[self asyncLayer] cancelAsyncDisplay]; //schedule clear contents on next runloop dispatch_async(dispatch_get_main_queue(), ^{ - ASDN::MutexLocker l(__instanceLock__); - if (ASInterfaceStateIncludesDisplay(_interfaceState) == NO) { + __instanceLock__.lock(); + ASInterfaceState interfaceState = _interfaceState; + __instanceLock__.unlock(); + if (ASInterfaceStateIncludesDisplay(interfaceState) == NO) { [self clearContents]; } }); @@ -3355,6 +3359,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)clearContents { ASDisplayNodeAssertMainThread(); + ASAssertUnlocked(__instanceLock__); + + ASDN::MutexLocker l(__instanceLock__); if (_flags.canClearContentsOfLayer) { // No-op if these haven't been created yet, as that guarantees they don't have contents that needs to be released. _layer.contents = nil; diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index f98356d671..f30257a6b9 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -590,10 +590,9 @@ static ASDN::StaticMutex& cacheLock = *new ASDN::StaticMutex; - (void)clearContents { [super clearContents]; - - __instanceLock__.lock(); - _weakCacheEntry = nil; // release contents from the cache. - __instanceLock__.unlock(); + + ASDN::MutexLocker l(__instanceLock__); + _weakCacheEntry = nil; // release contents from the cache. } #pragma mark - Cropping diff --git a/Source/ASMultiplexImageNode.mm b/Source/ASMultiplexImageNode.mm index 30001e5f3f..2adc646f91 100644 --- a/Source/ASMultiplexImageNode.mm +++ b/Source/ASMultiplexImageNode.mm @@ -412,8 +412,11 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent #pragma mark - Core Internal - (void)_setDisplayedImageIdentifier:(id)displayedImageIdentifier withImage:(UIImage *)image { - if (ASObjectIsEqual(displayedImageIdentifier, _displayedImageIdentifier)) + ASDisplayNodeAssertMainThread(); + + if (ASObjectIsEqual(_displayedImageIdentifier, displayedImageIdentifier)) { return; + } _displayedImageIdentifier = displayedImageIdentifier; diff --git a/Source/Details/ASRangeController.mm b/Source/Details/ASRangeController.mm index ff0176100b..9c8b7313ce 100644 --- a/Source/Details/ASRangeController.mm +++ b/Source/Details/ASRangeController.mm @@ -518,6 +518,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; // Skip the many method calls of the recursive operation if the top level cell node already has the right interfaceState. - (void)clearContents { + ASDisplayNodeAssertMainThread(); for (ASCollectionElement *element in [_dataSource elementMapForRangeController:self]) { ASCellNode *node = element.nodeIfAllocated; if (ASInterfaceStateIncludesDisplay(node.interfaceState)) { @@ -528,6 +529,7 @@ static UIApplicationState __ApplicationState = UIApplicationStateActive; - (void)clearPreloadedData { + ASDisplayNodeAssertMainThread(); for (ASCollectionElement *element in [_dataSource elementMapForRangeController:self]) { ASCellNode *node = element.nodeIfAllocated; if (ASInterfaceStateIncludesPreload(node.interfaceState)) { From 0114c46805ccec21fdd2788be46b976345c6a43b Mon Sep 17 00:00:00 2001 From: Jozsef Mihalicza Date: Fri, 14 Sep 2018 22:12:26 +0200 Subject: [PATCH 76/97] changelog fix: let / var macros did not make it to 2.7 (#1109) * let / var macros did not make it to 2.7 * moved change note later in the log to reflect actual timeline * Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a9e7a5324..452f4dcc5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Create a method to transfer strong C-arrays into immutable NSArrays, reducing retain/release traffic. [Adlai Holler](https://github.com/Adlai-Holler) - Remove yoga layout spec, which has been superseded by tighter Yoga integration (`ASDisplayNode+Yoga.h`) - Properly consider node for responder methods [Michael Schneider](https://github.com/maicki) +- Introduce let / var macros and some further cleanup. [Michael Schneider](https://github.com/maicki) [#1012](https://github.com/TextureGroup/Texture/pull/1012) - [IGListKit] Adds missing UIScrollViewDelegate method to DataSource proxy [Sergey Pronin](https://github.com/wannabehero) - Fix misleading/scary stack trace shown when an assertion occurs during node measurement [Huy Nguyen](https://github.com/nguyenhuy) [#1022](https://github.com/TextureGroup/Texture/pull/1022) - Fix build on 32-bit simulator in Xcode 9.3 and later, caused by `Thread-local storage is not supported on this architecture.` [Adlai Holler](https://github.com/Adlai-Holler) @@ -41,6 +42,7 @@ - Add a delegate callback for when the framework has initialized. [Adlai Holler](https://github.com/Adlai-Holler) - Improve TextNode2 by skipping an unneeded copy during measurement. [Adlai Holler](https://github.com/Adlai-Holler) - Improve locking around clearContents [Michael Schneider](https://github.com/maicki) +- Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) @@ -101,8 +103,6 @@ - Add an experimental deallocation queue implementation that's more efficient. [Adlai Holler](https://github.com/Adlai-Holler) - Standardize property declaration style. [Adlai Holler](https://github.com/Adlai-Holler) - [ASTableView] Fix an issue that causes table view to use one of a cell's invalid layouts instead of generating a new one. [Huy Nguyen](https://github.com/nguyenhuy) [#942](https://github.com/TextureGroup/Texture/pull/942) -- Introduce let / var macros and some further cleanup. [Michael Schneider](https://github.com/maicki) [#1012](https://github.com/TextureGroup/Texture/pull/1012) -- Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) ## 2.6 - [Xcode 9] Updated to require Xcode 9 (to fix warnings) [Garrett Moon](https://github.com/garrettmoon) From 1f0a213fe9fa107bf6c15754aec9c827bad5d7df Mon Sep 17 00:00:00 2001 From: Max Wang Date: Fri, 14 Sep 2018 15:25:27 -0700 Subject: [PATCH 77/97] Fix layer backed nodes not update properly (#1110) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Fix collection cell editing bug for iOS 9 & 10 * Do not cancel on exit, interface state update should handle it. * Revert "Fix collection cell editing bug for iOS 9 & 10" This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea. * add space to trigger ci * add change log --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 452f4dcc5c..85cf0c4753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASDisplayNode] Do not cancel display when in exit hierarchy but let interface state changing to handle it. [Max Wang](https://github.com/wsdwsd0829). [#1110](https://github.com/TextureGroup/Texture/pull/1110) - [Breaking][ASDisplayNode] Make interface state delegate protocol required. [Max Wang](https://github.com/wsdwsd0829). [#1112](https://github.com/TextureGroup/Texture/pull/1112) - [ASCollectionView] Fix reording of cells manually for iOS 9 & 10. [Max Wang](https://github.com/wsdwsd0829). [#1081](https://github.com/TextureGroup/Texture/pull/1081) - [ASDisplayNode] Allow add/remove interface state delegates on background thread. [Max Wang](https://github.com/wsdwsd0829). [#1090](https://github.com/TextureGroup/Texture/pull/1090) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index d84b5cbe0e..df87df1e4b 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2846,9 +2846,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { _flags.isExitingHierarchy = YES; _flags.isInHierarchy = NO; - [self._locked_asyncLayer cancelAsyncDisplay]; - - // Don't call -didExitHierarchy while holding __instanceLock__. + // Don't call -didExitHierarchy while holding __instanceLock__. // This method and subsequent ones (i.e -interfaceState and didExit(.*)State) // don't expect that they are called while the lock is being held. // More importantly, didExit(.*)State methods are meant to be overriden by clients. From 209227908e6f1bf72bc99e94cb2d2a6c48e61fd1 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Sat, 15 Sep 2018 08:04:46 -0700 Subject: [PATCH 78/97] Add missing argument for calling image download completion block (#1106) --- examples_extra/Multiplex/Sample/ScreenNode.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples_extra/Multiplex/Sample/ScreenNode.m b/examples_extra/Multiplex/Sample/ScreenNode.m index 86dda5ea2d..345c5bed5d 100644 --- a/examples_extra/Multiplex/Sample/ScreenNode.m +++ b/examples_extra/Multiplex/Sample/ScreenNode.m @@ -136,7 +136,7 @@ } if (completion) { - completion([UIImage imageWithData:data], connectionError, nil); + completion([UIImage imageWithData:data], connectionError, nil, nil); } }); }; From bf8d2685738a3099758b89d7d0246ff11c1ffee6 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Mon, 17 Sep 2018 10:11:04 -0700 Subject: [PATCH 79/97] Interface state not update correctly during layer thrash. (#1111) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Fix collection cell editing bug for iOS 9 & 10 * Revert "Fix collection cell editing bug for iOS 9 & 10" This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea. * Fix interface state not update correctly during layer thrash * add change log --- CHANGELOG.md | 1 + Source/ASDisplayNode.mm | 12 ++++++++++++ Source/Private/ASDisplayNodeInternal.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85cf0c4753..b63ac997c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ - Improve TextNode2 by skipping an unneeded copy during measurement. [Adlai Holler](https://github.com/Adlai-Holler) - Improve locking around clearContents [Michael Schneider](https://github.com/maicki) - Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) +- [ASDisplayNode] Fix interface state update for layer backed nodes when layer thrashes (interface coaleascing case).[Max Wang](https://github.com/wsdwsd0829). [#1111](https://github.com/TextureGroup/Texture/pull/1111) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index df87df1e4b..4744f78c0d 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -2945,6 +2945,15 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (![self supportsRangeManagedInterfaceState]) { self.interfaceState = ASInterfaceStateInHierarchy; + } else if (ASCATransactionQueue.sharedQueue.isEnabled) { + __instanceLock__.lock(); + ASInterfaceState state = _preExitingInterfaceState; + _preExitingInterfaceState = ASInterfaceStateNone; + __instanceLock__.unlock(); + // Layer thrash happened, revert to before exiting. + if (state != ASInterfaceStateNone) { + self.interfaceState = state; + } } } @@ -2983,6 +2992,8 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { unsigned isStillInHierarchy = _flags.isInHierarchy; BOOL isVisible = ASInterfaceStateIncludesVisible(_pendingInterfaceState); ASInterfaceState newState = (_pendingInterfaceState & ~ASInterfaceStateVisible); + // layer may be thrashed, we need to remember the state so we can reset if it enters in same runloop later. + _preExitingInterfaceState = _pendingInterfaceState; __instanceLock__.unlock(); if (!isStillInHierarchy && isVisible) { #if ENABLE_NEW_EXIT_HIERARCHY_BEHAVIOR @@ -3100,6 +3111,7 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { return; } _interfaceState = newState; + _preExitingInterfaceState = ASInterfaceStateNone; } // It should never be possible for a node to be visible but not be allowed / expected to display. diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 18eb03c5c6..dc3dedf81f 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -83,6 +83,8 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest _ASPendingState *_pendingViewState; ASInterfaceState _pendingInterfaceState; + ASInterfaceState _preExitingInterfaceState; + UIView *_view; CALayer *_layer; From fa8da15e695c34905070d264d103465517fe4f84 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Mon, 17 Sep 2018 12:40:18 -0700 Subject: [PATCH 80/97] Don't copy onDidLoadBlocks #trivial (#1123) --- Source/ASDisplayNode.mm | 3 +-- Source/Base/ASBaseDefines.h | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 4744f78c0d..a2e60b5327 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -568,8 +568,7 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); [self didLoad]; __instanceLock__.lock(); - NSArray *onDidLoadBlocks = [_onDidLoadBlocks copy]; - _onDidLoadBlocks = nil; + let onDidLoadBlocks = ASTransferStrong(_onDidLoadBlocks); __instanceLock__.unlock(); for (ASDisplayNodeDidLoadBlock block in onDidLoadBlocks) { diff --git a/Source/Base/ASBaseDefines.h b/Source/Base/ASBaseDefines.h index 5c72cb71bd..959e15d839 100644 --- a/Source/Base/ASBaseDefines.h +++ b/Source/Base/ASBaseDefines.h @@ -7,7 +7,7 @@ // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // -#import +#import #define AS_EXTERN FOUNDATION_EXTERN #define unowned __unsafe_unretained @@ -229,3 +229,18 @@ } \ __result; \ }) + +/** + * Capture-and-clear a strong reference without the intervening retain/release pair. + * + * E.g. let localVar = ASTransferStrong(_myIvar); + * Post-condition: localVar has the strong value from _myIvar and _myIvar is nil. + * No retain/release is emitted when the optimizer is on. + */ +#define ASTransferStrong(lvalue) ({ \ + CFTypeRef *__rawPtr = (CFTypeRef *)(void *)(&(lvalue)); \ + CFTypeRef __cfValue = *__rawPtr; \ + *__rawPtr = NULL; \ + __typeof(lvalue) __result = (__bridge_transfer __typeof(lvalue))__cfValue; \ + __result; \ +}) From f161665f5fd9bd0513bb756af65d664457e2963e Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Mon, 17 Sep 2018 13:35:00 -0700 Subject: [PATCH 81/97] Fix typos and minor code cleanups #trivial (#1120) - Fix typos in ASEditableTextNode.h and ASDisplayNode+FrameworkPrivate.h. - Remove unnecessary declaration for ASPINRemoteImageDownloader's sharedDownloader class property. - Remove unnecessary empty lines in ASPINRemoteImageDownloader.m and ASEditableTextNode.h. --- Source/ASEditableTextNode.h | 3 +-- Source/Details/ASPINRemoteImageDownloader.h | 1 - Source/Details/ASPINRemoteImageDownloader.m | 3 --- Source/Private/ASDisplayNode+FrameworkPrivate.h | 2 +- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Source/ASEditableTextNode.h b/Source/ASEditableTextNode.h index fb0c003564..e660eb106b 100644 --- a/Source/ASEditableTextNode.h +++ b/Source/ASEditableTextNode.h @@ -192,13 +192,12 @@ NS_ASSUME_NONNULL_BEGIN - (void)editableTextNodeDidUpdateText:(ASEditableTextNode *)editableTextNode; /** - @abstract Indicates to the delegate that teh text node has finished editing. + @abstract Indicates to the delegate that the text node has finished editing. @param editableTextNode An editable text node. @discussion The invocation of this method coincides with the keyboard animating to become hidden. */ - (void)editableTextNodeDidFinishEditing:(ASEditableTextNode *)editableTextNode; - @end NS_ASSUME_NONNULL_END diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index 26567027e2..8fa0294e9a 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -26,7 +26,6 @@ NS_ASSUME_NONNULL_BEGIN * This is the default downloader used by network backed image nodes if PINRemoteImage and PINCache are * available. It uses PINRemoteImage's features to provide caching and progressive image downloads. */ -@property (class, readonly) ASPINRemoteImageDownloader *sharedDownloader; + (ASPINRemoteImageDownloader *)sharedDownloader NS_RETURNS_RETAINED; diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 571c5de578..94962a123c 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -37,11 +37,9 @@ #if PIN_ANIMATED_AVAILABLE @interface ASPINRemoteImageDownloader () - @end @interface PINCachedAnimatedImage (ASPINRemoteImageDownloader) - @end @implementation PINCachedAnimatedImage (ASPINRemoteImageDownloader) @@ -98,7 +96,6 @@ @end - static ASPINRemoteImageDownloader *sharedDownloader = nil; @interface ASPINRemoteImageDownloader () diff --git a/Source/Private/ASDisplayNode+FrameworkPrivate.h b/Source/Private/ASDisplayNode+FrameworkPrivate.h index 3f5ca1dde5..2101565bf3 100644 --- a/Source/Private/ASDisplayNode+FrameworkPrivate.h +++ b/Source/Private/ASDisplayNode+FrameworkPrivate.h @@ -301,7 +301,7 @@ __unused static NSString * _Nonnull NSStringFromASHierarchyStateChange(ASHierarc - (void)_layoutTransitionMeasurementDidFinish; /** - * Informs the node that hte pending layout transition did complete + * Informs the node that the pending layout transition did complete */ - (void)_completePendingLayoutTransition; From 9bcafefa33c16b4e84303a0da3132665ec61ac1d Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Mon, 17 Sep 2018 14:29:22 -0700 Subject: [PATCH 82/97] Remove use of NSHashTable for interface state delegates #trivial (#1122) * Remove use of NSHashTable for interface state delegates #trivial * Stray line * One more case * Add code to let people have more delegates * Do it more --- Source/ASDisplayNode.h | 6 ++ Source/ASDisplayNode.mm | 99 +++++++++++++++++--------- Source/Private/ASDisplayNodeInternal.h | 15 ++-- 3 files changed, 81 insertions(+), 39 deletions(-) diff --git a/Source/ASDisplayNode.h b/Source/ASDisplayNode.h index 9bf9236d0e..437436b9f5 100644 --- a/Source/ASDisplayNode.h +++ b/Source/ASDisplayNode.h @@ -24,6 +24,10 @@ NS_ASSUME_NONNULL_BEGIN #define ASDisplayNodeLoggingEnabled 0 +#ifndef AS_MAX_INTERFACE_STATE_DELEGATES +#define AS_MAX_INTERFACE_STATE_DELEGATES 4 +#endif + @class ASDisplayNode; @protocol ASContextTransitioning; @@ -258,6 +262,8 @@ AS_EXTERN NSInteger const ASDefaultDrawingPriority; * @abstract Adds a delegate to receive notifications on interfaceState changes. * * @warning This must be called from the main thread. + * There is a hard limit on the number of delegates a node can have; see + * AS_MAX_INTERFACE_STATE_DELEGATES above. * * @see ASInterfaceState */ diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index a2e60b5327..f79fb10843 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -452,17 +452,6 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); #pragma mark - Loading -#define ASDisplayNodeCallInterfaceStateDelegates(method) \ - __instanceLock__.lock(); \ - NSHashTable *delegates = _copiedInterfaceStateDelegates; \ - if (!delegates) { \ - delegates = _copiedInterfaceStateDelegates = [_interfaceStateDelegates copy]; \ - } \ - __instanceLock__.unlock(); \ - for (id delegate in delegates) { \ - [delegate method]; \ - } - - (BOOL)_locked_shouldLoadViewOrLayer { ASAssertLocked(__instanceLock__); @@ -574,7 +563,9 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); for (ASDisplayNodeDidLoadBlock block in onDidLoadBlocks) { block(self); } - ASDisplayNodeCallInterfaceStateDelegates(nodeDidLoad); + [self enumerateInterfaceStateDelegates:^(id del) { + [del nodeDidLoad]; + }]; } - (void)didLoad @@ -1279,7 +1270,9 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertTrue(self.isNodeLoaded); - ASDisplayNodeCallInterfaceStateDelegates(nodeDidLayout); + [self enumerateInterfaceStateDelegates:^(id del) { + [del nodeDidLayout]; + }]; } #pragma mark Layout Transition @@ -1502,7 +1495,9 @@ NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"AS if (_pendingDisplayNodes.isEmpty) { [self hierarchyDisplayDidFinish]; - ASDisplayNodeCallInterfaceStateDelegates(hierarchyDisplayDidFinish); + [self enumerateInterfaceStateDelegates:^(id delegate) { + [delegate hierarchyDisplayDidFinish]; + }]; BOOL placeholderShouldPersist = [self placeholderShouldPersist]; @@ -3227,12 +3222,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // Subclass hook ASAssertUnlocked(__instanceLock__); ASDisplayNodeAssertMainThread(); - __instanceLock__.lock(); - NSHashTable *delegates = [_interfaceStateDelegates copy]; - __instanceLock__.unlock(); - for (id delegate in delegates) { - [delegate interfaceStateDidChange:newState fromState:oldState]; - } + [self enumerateInterfaceStateDelegates:^(id del) { + [del interfaceStateDidChange:newState fromState:oldState]; + }]; } - (BOOL)shouldScheduleDisplayWithNewInterfaceState:(ASInterfaceState)newInterfaceState @@ -3245,20 +3237,25 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { - (void)addInterfaceStateDelegate:(id )interfaceStateDelegate { ASDN::MutexLocker l(__instanceLock__); - // Not a fan of lazy loading, but this method won't get called very often and avoiding - // the overhead of creating this is probably worth it. - if (_interfaceStateDelegates == nil) { - _interfaceStateDelegates = [NSHashTable weakObjectsHashTable]; + _hasHadInterfaceStateDelegates = YES; + for (int i = 0; i < AS_MAX_INTERFACE_STATE_DELEGATES; i++) { + if (_interfaceStateDelegates[i] == nil) { + _interfaceStateDelegates[i] = interfaceStateDelegate; + return; + } } - _copiedInterfaceStateDelegates = nil; - [_interfaceStateDelegates addObject:interfaceStateDelegate]; + ASDisplayNodeFailAssert(@"Exceeded interface state delegate limit: %d", AS_MAX_INTERFACE_STATE_DELEGATES); } - (void)removeInterfaceStateDelegate:(id )interfaceStateDelegate { ASDN::MutexLocker l(__instanceLock__); - _copiedInterfaceStateDelegates = nil; - [_interfaceStateDelegates removeObject:interfaceStateDelegate]; + for (int i = 0; i < AS_MAX_INTERFACE_STATE_DELEGATES; i++) { + if (_interfaceStateDelegates[i] == interfaceStateDelegate) { + _interfaceStateDelegates[i] = nil; + break; + } + } } - (BOOL)isVisible @@ -3272,7 +3269,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - ASDisplayNodeCallInterfaceStateDelegates(didEnterVisibleState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didEnterVisibleState]; + }]; #if AS_ENABLE_TIPS [ASTipsController.shared nodeDidAppear:self]; #endif @@ -3283,7 +3282,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - ASDisplayNodeCallInterfaceStateDelegates(didExitVisibleState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didExitVisibleState]; + }]; } - (BOOL)isInDisplayState @@ -3297,7 +3298,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - ASDisplayNodeCallInterfaceStateDelegates(didEnterDisplayState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didEnterDisplayState]; + }]; } - (void)didExitDisplayState @@ -3305,7 +3308,9 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { // subclass override ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - ASDisplayNodeCallInterfaceStateDelegates(didExitDisplayState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didExitDisplayState]; + }]; } - (BOOL)isInPreloadState @@ -3355,14 +3360,18 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { if (self.automaticallyManagesSubnodes) { [self layoutIfNeeded]; } - ASDisplayNodeCallInterfaceStateDelegates(didEnterPreloadState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didEnterPreloadState]; + }]; } - (void)didExitPreloadState { ASDisplayNodeAssertMainThread(); ASAssertUnlocked(__instanceLock__); - ASDisplayNodeCallInterfaceStateDelegates(didExitPreloadState); + [self enumerateInterfaceStateDelegates:^(id del) { + [del didExitPreloadState]; + }]; } - (void)clearContents @@ -3389,7 +3398,29 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { }); } +- (void)enumerateInterfaceStateDelegates:(void (NS_NOESCAPE ^)(id))block +{ + ASAssertUnlocked(__instanceLock__); + id dels[AS_MAX_INTERFACE_STATE_DELEGATES]; + int count = 0; + { + ASLockScopeSelf(); + // Fast path for non-delegating nodes. + if (!_hasHadInterfaceStateDelegates) { + return; + } + + for (int i = 0; i < AS_MAX_INTERFACE_STATE_DELEGATES; i++) { + if ((dels[count] = _interfaceStateDelegates[i])) { + count++; + } + } + } + for (int i = 0; i < count; i++) { + block(dels[i]); + } +} #pragma mark - Gesture Recognizing diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index dc3dedf81f..f8fc559bc2 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -249,12 +249,10 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest NSTimeInterval _debugTimeToAddSubnodeViews; NSTimeInterval _debugTimeForDidLoad; #endif - - NSHashTable > *_interfaceStateDelegates; - // never mutated, used to enumerate delegates outside of lock. - // set to nil when mutating _interfaceStateDelegates. - NSHashTable > *_copiedInterfaceStateDelegates; + /// Fast path: tells whether we've ever had an interface state delegate before. + BOOL _hasHadInterfaceStateDelegates; + __weak id _interfaceStateDelegates[AS_MAX_INTERFACE_STATE_DELEGATES]; } + (void)scheduleNodeForRecursiveDisplay:(ASDisplayNode *)node; @@ -336,6 +334,13 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest - (void)applyPendingViewState; +/** + * Makes a local copy of the interface state delegates then calls the block on each. + * + * Lock is not held during block invocation. Method must not be called with the lock held. + */ +- (void)enumerateInterfaceStateDelegates:(void(NS_NOESCAPE ^)(id delegate))block; + /** * // TODO: NOT YET IMPLEMENTED * From 1452b31a24b4a991f43aae2bbc94958c520fcce6 Mon Sep 17 00:00:00 2001 From: ernestmama <43187788+ernestmama@users.noreply.github.com> Date: Mon, 17 Sep 2018 17:15:43 -0700 Subject: [PATCH 83/97] Add a method for setting preconfigured PINRemoteImageManager to ASPINRemoteImageManager (#1124) * add a method for setting preconfigured PINRemoteImageManager instead of using the self-created ASPINRemoteImageManager * update preconfigured image manager where it can only be set once * fix spacing in downloader * Fix doc/comments on new api * adding assertion to ensure either only configuration or preconfigure image manager can be set at a time * adding assertion to ensure either only configuration or preconfigure image manager can be set at a time * fix assertion condition * Update CHANGELOG.md * Remove unnecessary change --- CHANGELOG.md | 1 + Source/Details/ASPINRemoteImageDownloader.h | 10 ++++ Source/Details/ASPINRemoteImageDownloader.m | 57 +++++++++++++-------- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63ac997c5..fe8b26cb6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ - Improve locking around clearContents [Michael Schneider](https://github.com/maicki) - Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) - [ASDisplayNode] Fix interface state update for layer backed nodes when layer thrashes (interface coaleascing case).[Max Wang](https://github.com/wsdwsd0829). [#1111](https://github.com/TextureGroup/Texture/pull/1111) +- [ASPINRemoteImageManager] Add a new API for setting a preconfigured PINRemoteImageManager. [Ernest Ma](https://github.com/ernestmama) [#1124](https://github.com/TextureGroup/Texture/pull/1124) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index 8fa0294e9a..9624543c25 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -39,6 +39,16 @@ NS_ASSUME_NONNULL_BEGIN */ + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration; +/** + * Sets a custom preconfigured PINRemoteImageManager that will be used by @c ASNetworkImageNodes and @c ASMultiplexImageNodes + * while loading images off the network. This must be specified early in the application lifecycle before + * `sharedDownloader` is accessed. If nil is passed in as the PINRemoteImageManager, it will create + * a default image manager with a nil session configuration. + * + * @param PINRemoteImageManager The preconfigured remote image manager that will be used by `sharedDownloader` + */ ++ (void)setSharedPreconfiguredRemoteImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager; + /** * The shared instance of a @c PINRemoteImageManager used by all @c ASPINRemoteImageDownloaders * diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 94962a123c..46a60b3f0f 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -97,6 +97,7 @@ @end static ASPINRemoteImageDownloader *sharedDownloader = nil; +static PINRemoteImageManager *sharedPINRemoteImageManager = nil; @interface ASPINRemoteImageDownloader () @end @@ -116,43 +117,55 @@ static ASPINRemoteImageDownloader *sharedDownloader = nil; + (void)setSharedImageManagerWithConfiguration:(nullable NSURLSessionConfiguration *)configuration { NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); - __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration]; + NSAssert1(sharedPINRemoteImageManager == nil, @"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", [[sharedPINRemoteImageManager class] description]); + __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration preconfiguredPINRemoteImageManager:nil]; } -+ (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration ++ (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager { - static ASPINRemoteImageManager *sharedPINRemoteImageManager; + NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); + NSAssert1(sharedPINRemoteImageManager == nil, @"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", [[sharedPINRemoteImageManager class] description]); + __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:preconfiguredPINRemoteImageManager]; +} + ++ (PINRemoteImageManager *)sharedPINRemoteImageManagerWithConfiguration:(NSURLSessionConfiguration *)configuration preconfiguredPINRemoteImageManager:(PINRemoteImageManager *)preconfiguredPINRemoteImageManager +{ + NSAssert(!(configuration != nil && preconfiguredPINRemoteImageManager != nil), @"Either configuration or preconfigured image manager can be set at a time."); static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ + if (preconfiguredPINRemoteImageManager) { + sharedPINRemoteImageManager = preconfiguredPINRemoteImageManager; + } else { #if PIN_ANIMATED_AVAILABLE - // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each - if (!(NSClassFromString(@"PINRemoteImageManager"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINRemoteImage framework." - userInfo:nil]; - @throw e; - } - if (!(NSClassFromString(@"PINCache"))) { - NSException *e = [NSException - exceptionWithName:@"FrameworkSetupException" - reason:@"Missing the path to the PINCache framework." - userInfo:nil]; - @throw e; - } - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration - alternativeRepresentationProvider:[self sharedDownloader]]; + // Check that Carthage users have linked both PINRemoteImage & PINCache by testing for one file each + if (!(NSClassFromString(@"PINRemoteImageManager"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINRemoteImage framework." + userInfo:nil]; + @throw e; + } + if (!(NSClassFromString(@"PINCache"))) { + NSException *e = [NSException + exceptionWithName:@"FrameworkSetupException" + reason:@"Missing the path to the PINCache framework." + userInfo:nil]; + @throw e; + } + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration + alternativeRepresentationProvider:[self sharedDownloader]]; #else - sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; + sharedPINRemoteImageManager = [[ASPINRemoteImageManager alloc] initWithSessionConfiguration:configuration]; #endif + } }); return sharedPINRemoteImageManager; } - (PINRemoteImageManager *)sharedPINRemoteImageManager { - return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil]; + return [ASPINRemoteImageDownloader sharedPINRemoteImageManagerWithConfiguration:nil preconfiguredPINRemoteImageManager:nil]; } - (BOOL)sharedImageManagerSupportsMemoryRemoval From 47e2b9c0def1f5c2f78b5fcc7842b9794ce8c711 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Tue, 18 Sep 2018 07:12:01 -0700 Subject: [PATCH 84/97] [ASPINRemoteImageDownloader] Fix +setSharedPreconfiguredRemoteImageManager:'s doc #trivial (#1126) --- Source/Details/ASPINRemoteImageDownloader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.h b/Source/Details/ASPINRemoteImageDownloader.h index 9624543c25..618dc15842 100644 --- a/Source/Details/ASPINRemoteImageDownloader.h +++ b/Source/Details/ASPINRemoteImageDownloader.h @@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_BEGIN * `sharedDownloader` is accessed. If nil is passed in as the PINRemoteImageManager, it will create * a default image manager with a nil session configuration. * - * @param PINRemoteImageManager The preconfigured remote image manager that will be used by `sharedDownloader` + * @param preconfiguredPINRemoteImageManager The preconfigured remote image manager that will be used by `sharedDownloader` */ + (void)setSharedPreconfiguredRemoteImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager; From d2984ced8d34a2762d96ad7e60acd87795d3c77c Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 18 Sep 2018 07:26:29 -0700 Subject: [PATCH 85/97] Make yoga & layout specs faster by eliminating some copies (#1128) --- CHANGELOG.md | 1 + Source/ASDisplayNode+Yoga.mm | 7 +++++-- Source/Layout/ASAbsoluteLayoutSpec.mm | 11 +++++++---- Source/Layout/ASBackgroundLayoutSpec.mm | 9 ++++++--- Source/Layout/ASLayoutSpec.mm | 16 ++++++++-------- Source/Layout/ASOverlayLayoutSpec.mm | 8 ++++++-- Source/Layout/ASStackLayoutSpec.mm | 9 ++++++--- 7 files changed, 39 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8b26cb6e..27bcc41c70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Unlock before cleanup and calling out to subclass hooks for animated images. [Michael Schneider](https://github.com/maicki) [#1087](https://github.com/TextureGroup/Texture/pull/1087) - [ASDisplayNode] Fix interface state update for layer backed nodes when layer thrashes (interface coaleascing case).[Max Wang](https://github.com/wsdwsd0829). [#1111](https://github.com/TextureGroup/Texture/pull/1111) - [ASPINRemoteImageManager] Add a new API for setting a preconfigured PINRemoteImageManager. [Ernest Ma](https://github.com/ernestmama) [#1124](https://github.com/TextureGroup/Texture/pull/1124) +- Small optimization to the layout spec & yoga layout systems by eliminating array copies. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index fedff84cf1..d1d3d7defb 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -13,6 +13,7 @@ #import #import +#import #import #import #import @@ -155,10 +156,12 @@ ASDisplayNodeAssert(childCount == self.yogaChildren.count, @"Yoga tree should always be in sync with .yogaNodes array! %@", self.yogaChildren); - NSMutableArray *sublayouts = [NSMutableArray arrayWithCapacity:childCount]; + ASLayout *rawSublayouts[childCount]; + int i = 0; for (ASDisplayNode *subnode in self.yogaChildren) { - [sublayouts addObject:[subnode layoutForYogaNode]]; + rawSublayouts[i++] = [subnode layoutForYogaNode]; } + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:childCount]; // The layout for self should have position CGPointNull, but include the calculated size. CGSize size = CGSizeMake(YGNodeLayoutGetWidth(yogaNode), YGNodeLayoutGetHeight(yogaNode)); diff --git a/Source/Layout/ASAbsoluteLayoutSpec.mm b/Source/Layout/ASAbsoluteLayoutSpec.mm index b91b5d4ef6..e5edb272d8 100644 --- a/Source/Layout/ASAbsoluteLayoutSpec.mm +++ b/Source/Layout/ASAbsoluteLayoutSpec.mm @@ -9,6 +9,7 @@ #import +#import #import #import #import @@ -64,7 +65,8 @@ }; NSArray *children = self.children; - NSMutableArray *sublayouts = [NSMutableArray arrayWithCapacity:children.count]; + ASLayout *rawSublayouts[children.count]; + int i = 0; for (id child in children) { CGPoint layoutPosition = child.style.layoutPosition; @@ -77,13 +79,14 @@ ASLayout *sublayout = [child layoutThatFits:childConstraint parentSize:size]; sublayout.position = layoutPosition; - [sublayouts addObject:sublayout]; + rawSublayouts[i++] = sublayout; } - + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:i]; + if (_sizing == ASAbsoluteLayoutSpecSizingSizeToFit || isnan(size.width)) { size.width = constrainedSize.min.width; for (ASLayout *sublayout in sublayouts) { - size.width = MAX(size.width, sublayout.position.x + sublayout.size.width); + size.width = MAX(size.width, sublayout.position.x + sublayout.size.width); } } diff --git a/Source/Layout/ASBackgroundLayoutSpec.mm b/Source/Layout/ASBackgroundLayoutSpec.mm index 7f969215c0..30664fd92b 100644 --- a/Source/Layout/ASBackgroundLayoutSpec.mm +++ b/Source/Layout/ASBackgroundLayoutSpec.mm @@ -12,6 +12,7 @@ #import #import +#import static NSUInteger const kForegroundChildIndex = 0; static NSUInteger const kBackgroundChildIndex = 1; @@ -48,17 +49,19 @@ static NSUInteger const kBackgroundChildIndex = 1; { ASLayout *contentsLayout = [self.child layoutThatFits:constrainedSize parentSize:parentSize]; - NSMutableArray *sublayouts = [NSMutableArray arrayWithCapacity:2]; + ASLayout *rawSublayouts[2]; + int i = 0; if (self.background) { // Size background to exactly the same size. ASLayout *backgroundLayout = [self.background layoutThatFits:ASSizeRangeMake(contentsLayout.size) parentSize:parentSize]; backgroundLayout.position = CGPointZero; - [sublayouts addObject:backgroundLayout]; + rawSublayouts[i++] = backgroundLayout; } contentsLayout.position = CGPointZero; - [sublayouts addObject:contentsLayout]; + rawSublayouts[i++] = contentsLayout; + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:i]; return [ASLayout layoutWithLayoutElement:self size:contentsLayout.size sublayouts:sublayouts]; } diff --git a/Source/Layout/ASLayoutSpec.mm b/Source/Layout/ASLayoutSpec.mm index 4bebb094b5..dc8827d705 100644 --- a/Source/Layout/ASLayoutSpec.mm +++ b/Source/Layout/ASLayoutSpec.mm @@ -113,14 +113,12 @@ ASLayoutElementLayoutCalculationDefaults { ASDisplayNodeAssert(self.isMutable, @"Cannot set properties when layout spec is not mutable"); - [_childrenArray removeAllObjects]; - - NSUInteger i = 0; +#if ASDISPLAYNODE_ASSERTIONS_ENABLED for (id child in children) { ASDisplayNodeAssert([child conformsToProtocol:NSProtocolFromString(@"ASLayoutElement")], @"Child %@ of spec %@ is not an ASLayoutElement!", child, self); - _childrenArray[i] = child; - i += 1; } +#endif + [_childrenArray setArray:children]; } - (nullable NSArray> *)children @@ -291,7 +289,9 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__) - (ASLayout *)calculateLayoutThatFits:(ASSizeRange)constrainedSize { NSArray *children = self.children; - NSMutableArray *sublayouts = [NSMutableArray arrayWithCapacity:children.count]; + let count = children.count; + ASLayout *rawSublayouts[count]; + int i = 0; CGSize size = constrainedSize.min; for (id child in children) { @@ -301,9 +301,9 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__) size.width = MAX(size.width, sublayout.size.width); size.height = MAX(size.height, sublayout.size.height); - [sublayouts addObject:sublayout]; + rawSublayouts[i++] = sublayout; } - + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:i]; return [ASLayout layoutWithLayoutElement:self size:size sublayouts:sublayouts]; } diff --git a/Source/Layout/ASOverlayLayoutSpec.mm b/Source/Layout/ASOverlayLayoutSpec.mm index 84ca72a9c3..f1cbe48848 100644 --- a/Source/Layout/ASOverlayLayoutSpec.mm +++ b/Source/Layout/ASOverlayLayoutSpec.mm @@ -10,6 +10,7 @@ #import #import #import +#import static NSUInteger const kUnderlayChildIndex = 0; static NSUInteger const kOverlayChildIndex = 1; @@ -70,14 +71,17 @@ static NSUInteger const kOverlayChildIndex = 1; { ASLayout *contentsLayout = [self.child layoutThatFits:constrainedSize parentSize:parentSize]; contentsLayout.position = CGPointZero; - NSMutableArray *sublayouts = [NSMutableArray arrayWithObject:contentsLayout]; + ASLayout *rawSublayouts[2]; + int i = 0; + rawSublayouts[i++] = contentsLayout; if (self.overlay) { ASLayout *overlayLayout = [self.overlay layoutThatFits:ASSizeRangeMake(contentsLayout.size) parentSize:contentsLayout.size]; overlayLayout.position = CGPointZero; - [sublayouts addObject:overlayLayout]; + rawSublayouts[i++] = overlayLayout; } + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:i]; return [ASLayout layoutWithLayoutElement:self size:contentsLayout.size sublayouts:sublayouts]; } diff --git a/Source/Layout/ASStackLayoutSpec.mm b/Source/Layout/ASStackLayoutSpec.mm index 1cf9ce3d0e..93a693b1c9 100644 --- a/Source/Layout/ASStackLayoutSpec.mm +++ b/Source/Layout/ASStackLayoutSpec.mm @@ -12,6 +12,7 @@ #import #import +#import #import #import #import @@ -151,12 +152,14 @@ self.style.ascender = stackChildren.front().style.ascender; self.style.descender = stackChildren.back().style.descender; } - - const auto sublayouts = [[NSMutableArray alloc] init]; + + ASLayout *rawSublayouts[positionedLayout.items.size()]; + int i = 0; for (const auto &item : positionedLayout.items) { - [sublayouts addObject:item.layout]; + rawSublayouts[i++] = item.layout; } + let sublayouts = [NSArray arrayByTransferring:rawSublayouts count:i]; return [ASLayout layoutWithLayoutElement:self size:positionedLayout.size sublayouts:sublayouts]; } From 69ed9562df2e968f8955aeaf1b1295635db9fd1b Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Tue, 18 Sep 2018 11:58:24 -0700 Subject: [PATCH 86/97] Remove ASRectMap, which is not worth its own weight (#1127) --- AsyncDisplayKit.xcodeproj/project.pbxproj | 13 ---- CHANGELOG.md | 1 + Source/Layout/ASLayout.mm | 18 ++---- Source/Private/ASRectMap.h | 48 --------------- Source/Private/ASRectMap.mm | 74 ----------------------- Tests/ASRectMapTests.m | 51 ---------------- 6 files changed, 7 insertions(+), 198 deletions(-) delete mode 100644 Source/Private/ASRectMap.h delete mode 100644 Source/Private/ASRectMap.mm delete mode 100644 Tests/ASRectMapTests.m diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index e916d4bf5c..52ac52e894 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -459,9 +459,6 @@ DECBD6EA1BE56E1900CF4905 /* ASButtonNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = DECBD6E61BE56E1900CF4905 /* ASButtonNode.mm */; }; DEFAD8131CC48914000527C4 /* ASVideoNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = AEEC47E01C20C2DD00EC1693 /* ASVideoNode.mm */; }; E51B78BF1F028ABF00E32604 /* ASLayoutFlatteningTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E51B78BD1F01A0EE00E32604 /* ASLayoutFlatteningTests.m */; }; - E52AC9BA1FEA90EB00AA4040 /* ASRectMap.mm in Sources */ = {isa = PBXBuildFile; fileRef = E52AC9B81FEA90EB00AA4040 /* ASRectMap.mm */; }; - E52AC9BB1FEA90EB00AA4040 /* ASRectMap.h in Headers */ = {isa = PBXBuildFile; fileRef = E52AC9B91FEA90EB00AA4040 /* ASRectMap.h */; settings = {ATTRIBUTES = (Private, ); }; }; - E52AC9C01FEA916C00AA4040 /* ASRectMapTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E52AC9BE1FEA915D00AA4040 /* ASRectMapTests.m */; }; E54E00721F1D3828000B30D7 /* ASPagerNode+Beta.h in Headers */ = {isa = PBXBuildFile; fileRef = E54E00711F1D3828000B30D7 /* ASPagerNode+Beta.h */; settings = {ATTRIBUTES = (Public, ); }; }; E54E81FC1EB357BD00FFE8E1 /* ASPageTable.h in Headers */ = {isa = PBXBuildFile; fileRef = E54E81FA1EB357BD00FFE8E1 /* ASPageTable.h */; }; E54E81FD1EB357BD00FFE8E1 /* ASPageTable.m in Sources */ = {isa = PBXBuildFile; fileRef = E54E81FB1EB357BD00FFE8E1 /* ASPageTable.m */; }; @@ -990,9 +987,6 @@ E51B78BD1F01A0EE00E32604 /* ASLayoutFlatteningTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASLayoutFlatteningTests.m; sourceTree = ""; }; E52405B21C8FEF03004DC8E7 /* ASLayoutTransition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASLayoutTransition.mm; sourceTree = ""; }; E52405B41C8FEF16004DC8E7 /* ASLayoutTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASLayoutTransition.h; sourceTree = ""; }; - E52AC9B81FEA90EB00AA4040 /* ASRectMap.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASRectMap.mm; sourceTree = ""; }; - E52AC9B91FEA90EB00AA4040 /* ASRectMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASRectMap.h; sourceTree = ""; }; - E52AC9BE1FEA915D00AA4040 /* ASRectMapTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASRectMapTests.m; sourceTree = ""; }; E54E00711F1D3828000B30D7 /* ASPagerNode+Beta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ASPagerNode+Beta.h"; sourceTree = ""; }; E54E81FA1EB357BD00FFE8E1 /* ASPageTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASPageTable.h; sourceTree = ""; }; E54E81FB1EB357BD00FFE8E1 /* ASPageTable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ASPageTable.m; sourceTree = ""; }; @@ -1258,7 +1252,6 @@ isa = PBXGroup; children = ( F3F698D1211CAD4600800CB1 /* ASDisplayViewAccessibilityTests.mm */, - CC35CEC520DD87280006448D /* ASCollectionsTests.m */, DBC452DD1C5C6A6A00B16017 /* ArrayDiffingTests.m */, AC026B571BD3F61800BBC17E /* ASAbsoluteLayoutSpecSnapshotTests.m */, 696FCB301D6E46050093471E /* ASBackgroundLayoutSpecSnapshotTests.mm */, @@ -1308,7 +1301,6 @@ CC8B05D51D73836400F54286 /* ASPerformanceTestContext.m */, CC7FD9E01BB5F750005CCB2B /* ASPhotosFrameworkImageRequestTests.m */, ACF6ED5A1B178DC700DA7C62 /* ASRatioLayoutSpecSnapshotTests.mm */, - E52AC9BE1FEA915D00AA4040 /* ASRectMapTests.m */, CCAA0B81206ADECB0057B336 /* ASRecursiveUnfairLockTests.m */, 7AB338681C55B97B0055FDE8 /* ASRelativeLayoutSpecSnapshotTests.mm */, 4E9127681F64157600499623 /* ASRunLoopQueueTests.m */, @@ -1516,8 +1508,6 @@ CCED5E402020D41600395C40 /* ASNetworkImageLoadInfo+Private.h */, CC3B20811C3F76D600798563 /* ASPendingStateController.h */, CC3B20821C3F76D600798563 /* ASPendingStateController.mm */, - E52AC9B91FEA90EB00AA4040 /* ASRectMap.h */, - E52AC9B81FEA90EB00AA4040 /* ASRectMap.mm */, CC55A70F1E52A0F200594372 /* ASResponderChainEnumerator.h */, CC55A7101E52A0F200594372 /* ASResponderChainEnumerator.m */, CC512B841DAC45C60054848E /* ASTableView+Undeprecated.h */, @@ -1968,7 +1958,6 @@ E5775B021F16759300CAC9BC /* ASCollectionLayoutCache.h in Headers */, E5775B001F13D25400CAC9BC /* ASCollectionLayoutState+Private.h in Headers */, E5667E8C1F33871300FA6FC0 /* _ASCollectionGalleryLayoutInfo.h in Headers */, - E52AC9BB1FEA90EB00AA4040 /* ASRectMap.h in Headers */, E5775AFC1F13CE9F00CAC9BC /* _ASCollectionGalleryLayoutItem.h in Headers */, E5855DF01EBB4D83003639AE /* ASCollectionLayoutDefines.h in Headers */, E5B5B9D11E9BAD9800A6B726 /* ASCollectionLayoutContext+Private.h in Headers */, @@ -2332,7 +2321,6 @@ 05EA6FE71AC0966E00E35788 /* ASSnapshotTestCase.m in Sources */, CC35CEC620DD87280006448D /* ASCollectionsTests.m in Sources */, ACF6ED631B178DC700DA7C62 /* ASStackLayoutSpecSnapshotTests.mm in Sources */, - E52AC9C01FEA916C00AA4040 /* ASRectMapTests.m in Sources */, CCE4F9BA1F0DBB5000062E4E /* ASLayoutTestNode.mm in Sources */, CCAA0B82206ADECB0057B336 /* ASRecursiveUnfairLockTests.m in Sources */, 81E95C141D62639600336598 /* ASTextNodeSnapshotTests.m in Sources */, @@ -2362,7 +2350,6 @@ 3917EBD51E9C2FC400D04A01 /* _ASCollectionReusableView.m in Sources */, CCA282D11E9EBF6C0037E8B7 /* ASTipsWindow.m in Sources */, CCCCCCE41EC3EF060087FE10 /* NSParagraphStyle+ASText.m in Sources */, - E52AC9BA1FEA90EB00AA4040 /* ASRectMap.mm in Sources */, 8BBBAB8D1CEBAF1E00107FC6 /* ASDefaultPlaybackButton.m in Sources */, B30BF6541C59D889004FCD53 /* ASLayoutManager.m in Sources */, 92DD2FE71BF4D0850074C9DD /* ASMapNode.mm in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 27bcc41c70..2fca7b81e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ - [ASDisplayNode] Fix interface state update for layer backed nodes when layer thrashes (interface coaleascing case).[Max Wang](https://github.com/wsdwsd0829). [#1111](https://github.com/TextureGroup/Texture/pull/1111) - [ASPINRemoteImageManager] Add a new API for setting a preconfigured PINRemoteImageManager. [Ernest Ma](https://github.com/ernestmama) [#1124](https://github.com/TextureGroup/Texture/pull/1124) - Small optimization to the layout spec & yoga layout systems by eliminating array copies. [Adlai Holler](https://github.com/Adlai-Holler) +- Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/Layout/ASLayout.mm b/Source/Layout/ASLayout.mm index 1c83433886..ed92714481 100644 --- a/Source/Layout/ASLayout.mm +++ b/Source/Layout/ASLayout.mm @@ -20,7 +20,6 @@ #import #import #import -#import CGPoint const ASPointNull = {NAN, NAN}; @@ -54,9 +53,6 @@ ASDISPLAYNODE_INLINE AS_WARN_UNUSED_RESULT BOOL ASLayoutIsDisplayNodeType(ASLayo ASLayoutElementType _layoutElementType; std::atomic_bool _retainSublayoutElements; } - -@property (nonatomic, readonly) ASRectMap *elementToRectMap; - @end @implementation ASLayout @@ -110,13 +106,6 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( } _sublayouts = [sublayouts copy] ?: @[]; - - if (_sublayouts.count > 0) { - _elementToRectMap = [ASRectMap rectMapForWeakObjectPointers]; - for (ASLayout *layout in sublayouts) { - [_elementToRectMap setRect:layout.frame forKey:layout.layoutElement]; - } - } if ([ASLayout shouldRetainSublayoutLayoutElements]) { [self retainSublayoutElements]; @@ -294,7 +283,12 @@ static std::atomic_bool static_retainsSublayoutLayoutElements = ATOMIC_VAR_INIT( - (CGRect)frameForElement:(id)layoutElement { - return _elementToRectMap ? [_elementToRectMap rectForKey:layoutElement] : CGRectNull; + for (ASLayout *l in _sublayouts) { + if (l->_layoutElement == layoutElement) { + return l.frame; + } + } + return CGRectNull; } - (CGRect)frame diff --git a/Source/Private/ASRectMap.h b/Source/Private/ASRectMap.h deleted file mode 100644 index 88e8c8a2de..0000000000 --- a/Source/Private/ASRectMap.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// ASRectMap.h -// Texture -// -// Copyright (c) Pinterest, Inc. All rights reserved. -// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 -// - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * A category for indexing weak pointers to CGRects. Similar to ASIntegerMap. - */ -@interface ASRectMap : NSObject - -/** - * Creates a new rect map. The keys are never retained. - */ -+ (ASRectMap *)rectMapForWeakObjectPointers NS_RETURNS_RETAINED; - -/** - * Retrieves the rect for a given key, or CGRectNull if the key is not found. - * - * @param key An object to lookup the rect for. - */ -- (CGRect)rectForKey:(id)key; - -/** - * Sets the given rect for the associated key. Key *will not be retained!* - * - * @param rect The rect to store as value. - * @param key The key to use for the rect. - */ -- (void)setRect:(CGRect)rect forKey:(id)key; - -/** - * Removes the rect for the given key, if one exists. - * - * @param key The key to remove. - */ -- (void)removeRectForKey:(id)key; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Source/Private/ASRectMap.mm b/Source/Private/ASRectMap.mm deleted file mode 100644 index ed7b82ba0c..0000000000 --- a/Source/Private/ASRectMap.mm +++ /dev/null @@ -1,74 +0,0 @@ -// -// ASRectMap.mm -// Texture -// -// Copyright (c) Pinterest, Inc. All rights reserved. -// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 -// - -#import "ASRectMap.h" -#import "ASObjectDescriptionHelpers.h" -#import -#import - -@implementation ASRectMap { - std::unordered_map _map; -} - -+ (ASRectMap *)rectMapForWeakObjectPointers NS_RETURNS_RETAINED -{ - return [[self alloc] init]; -} - -- (CGRect)rectForKey:(id)key -{ - let result = _map.find((__bridge void *)key); - if (result != _map.end()) { - // result->first is the key; result->second is the value, a CGRect. - return result->second; - } else { - return CGRectNull; - } -} - -- (void)setRect:(CGRect)rect forKey:(id)key -{ - if (key) { - _map[(__bridge void *)key] = rect; - } -} - -- (void)removeRectForKey:(id)key -{ - if (key) { - _map.erase((__bridge void *)key); - } -} - -- (id)copyWithZone:(NSZone *)zone -{ - ASRectMap *copy = [ASRectMap rectMapForWeakObjectPointers]; - copy->_map = _map; - return copy; -} - -- (NSMutableArray *)propertiesForDescription -{ - NSMutableArray *result = [NSMutableArray array]; - - // { ptr1->rect1 ptr2->rect2 ptr3->rect3 } - NSMutableString *str = [NSMutableString string]; - for (let &e : _map) { - [str appendFormat:@" %@->%@", e.first, NSStringFromCGRect(e.second)]; - } - [result addObject:@{ @"ASRectMap": str }]; - - return result; -} - -- (NSString *)description -{ - return ASObjectDescriptionMakeWithoutObject([self propertiesForDescription]); -} - -@end diff --git a/Tests/ASRectMapTests.m b/Tests/ASRectMapTests.m deleted file mode 100644 index be5e2ef3df..0000000000 --- a/Tests/ASRectMapTests.m +++ /dev/null @@ -1,51 +0,0 @@ -// -// ASRectMapTests.m -// Texture -// -// Copyright (c) Pinterest, Inc. All rights reserved. -// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 -// - -#import - -#import "ASRectMap.h" -#import "ASXCTExtensions.h" - -@interface ASRectMapTests : XCTestCase -@end - -@implementation ASRectMapTests - -- (void)testThatItStoresRects -{ - ASRectMap *table = [ASRectMap rectMapForWeakObjectPointers]; - NSObject *key0 = [[NSObject alloc] init]; - NSObject *key1 = [[NSObject alloc] init]; - ASXCTAssertEqualRects([table rectForKey:key0], CGRectNull); - ASXCTAssertEqualRects([table rectForKey:key1], CGRectNull); - CGRect rect0 = CGRectMake(0, 0, 100, 100); - CGRect rect1 = CGRectMake(0, 0, 50, 50); - [table setRect:rect0 forKey:key0]; - [table setRect:rect1 forKey:key1]; - - ASXCTAssertEqualRects([table rectForKey:key0], rect0); - ASXCTAssertEqualRects([table rectForKey:key1], rect1); -} - - -- (void)testCopying -{ - ASRectMap *table = [ASRectMap rectMapForWeakObjectPointers]; - NSObject *key = [[NSObject alloc] init]; - ASXCTAssertEqualRects([table rectForKey:key], CGRectNull); - CGRect rect0 = CGRectMake(0, 0, 100, 100); - CGRect rect1 = CGRectMake(0, 0, 50, 50); - [table setRect:rect0 forKey:key]; - ASRectMap *copy = [table copy]; - [copy setRect:rect1 forKey:key]; - - ASXCTAssertEqualRects([table rectForKey:key], rect0); - ASXCTAssertEqualRects([copy rectForKey:key], rect1); -} - -@end From cd608c9b180e2952f14cb256c03cb55ba1d787f7 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 19 Sep 2018 07:51:46 -0700 Subject: [PATCH 87/97] Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode (#1103) --- CHANGELOG.md | 1 + Source/ASCollectionNode.mm | 78 +++++++++++++++++-------------- Source/ASTableNode.h | 4 +- Source/ASTableNode.mm | 84 +++++++++++++++++++++++++++------- Tests/ASCollectionViewTests.mm | 11 +++++ 5 files changed, 126 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fca7b81e2..312e3b248e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - [ASPINRemoteImageManager] Add a new API for setting a preconfigured PINRemoteImageManager. [Ernest Ma](https://github.com/ernestmama) [#1124](https://github.com/TextureGroup/Texture/pull/1124) - Small optimization to the layout spec & yoga layout systems by eliminating array copies. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler) +- Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index 82388c85aa..bf854b0466 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -30,9 +30,12 @@ #pragma mark - _ASCollectionPendingState -@interface _ASCollectionPendingState : NSObject -@property (weak, nonatomic) id delegate; -@property (weak, nonatomic) id dataSource; +@interface _ASCollectionPendingState : NSObject { +@public + std::vector> _tuningParameters; +} +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id dataSource; @property (nonatomic) UICollectionViewLayout *collectionViewLayout; @property (nonatomic) ASLayoutRangeMode rangeMode; @property (nonatomic) BOOL allowsSelection; // default is YES @@ -40,7 +43,7 @@ @property (nonatomic) BOOL inverted; //default is NO @property (nonatomic) BOOL usesSynchronousDataLoading; @property (nonatomic) CGFloat leadingScreensForBatching; -@property (weak, nonatomic) id layoutInspector; +@property (nonatomic, weak) id layoutInspector; @property (nonatomic) BOOL alwaysBounceVertical; @property (nonatomic) BOOL alwaysBounceHorizontal; @property (nonatomic) UIEdgeInsets contentInset; @@ -52,11 +55,14 @@ @implementation _ASCollectionPendingState +#pragma mark Lifecycle + - (instancetype)init { self = [super init]; if (self) { _rangeMode = ASLayoutRangeModeUnspecified; + _tuningParameters = std::vector> (ASLayoutRangeModeCount, std::vector (ASLayoutRangeTypeCount, ASRangeTuningParametersZero)); _allowsSelection = YES; _allowsMultipleSelection = NO; _inverted = NO; @@ -66,23 +72,8 @@ } return self; } -@end -// TODO: Add support for tuning parameters in the pending state -#if 0 // This is not used yet, but will provide a way to avoid creating the view to set range values. -@implementation _ASCollectionPendingState { - std::vector> _tuningParameters; -} - -- (instancetype)init -{ - self = [super init]; - if (self) { - _tuningParameters = std::vector> (ASLayoutRangeModeCount, std::vector (ASLayoutRangeTypeCount)); - _rangeMode = ASLayoutRangeModeUnspecified; - } - return self; -} +#pragma mark Tuning Parameters - (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType { @@ -107,7 +98,6 @@ } @end -#endif #pragma mark - ASCollectionNode @@ -118,6 +108,7 @@ id _batchFetchingDelegate; } @property (nonatomic) _ASCollectionPendingState *pendingState; +@property (nonatomic, weak) ASRangeController *rangeController; @end @implementation ASCollectionNode @@ -188,6 +179,8 @@ ASCollectionView *view = self.view; view.collectionNode = self; + + _rangeController = view.rangeController; if (_pendingState) { _ASCollectionPendingState *pendingState = _pendingState; @@ -219,9 +212,24 @@ if (!CGPointEqualToPoint(contentOffset, CGPointZero)) { [view setContentOffset:contentOffset animated:pendingState.animatesContentOffset]; } - + + let tuningParametersVector = pendingState->_tuningParameters; + let tuningParametersVectorSize = tuningParametersVector.size(); + for (NSInteger rangeMode = 0; rangeMode < tuningParametersVectorSize; rangeMode++) { + let tuningparametersRangeModeVector = tuningParametersVector[rangeMode]; + let tuningParametersVectorRangeModeSize = tuningparametersRangeModeVector.size(); + for (NSInteger rangeType = 0; rangeType < tuningParametersVectorRangeModeSize; rangeType++) { + ASRangeTuningParameters tuningParameters = tuningparametersRangeModeVector[rangeType]; + if (!ASRangeTuningParametersEqualToRangeTuningParameters(tuningParameters, ASRangeTuningParametersZero)) { + [_rangeController setTuningParameters:tuningParameters + forRangeMode:(ASLayoutRangeMode)rangeMode + rangeType:(ASLayoutRangeType)rangeType]; + } + } + } + if (pendingState.rangeMode != ASLayoutRangeModeUnspecified) { - [view.rangeController updateCurrentRangeWithMode:pendingState.rangeMode]; + [_rangeController updateCurrentRangeWithMode:pendingState.rangeMode]; } // Don't need to set collectionViewLayout to the view as the layout was already used to init the view in view block. @@ -253,7 +261,7 @@ // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. // TODO (ASCL) If this node supports async layout, kick off the initial data load without allocating the view if (ASHierarchyStateIncludesRangeManaged(self.hierarchyState) && CGRectEqualToRect(self.bounds, CGRectZero) == NO) { - [[self view] layoutIfNeeded]; + [self.view layoutIfNeeded]; } } @@ -285,12 +293,6 @@ return self.view.dataController; } -// TODO: Implement this without the view. -- (ASRangeController *)rangeController -{ - return self.view.rangeController; -} - - (_ASCollectionPendingState *)pendingState { if (!_pendingState && ![self isNodeLoaded]) { @@ -647,22 +649,30 @@ - (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController tuningParametersForRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; + return [self tuningParametersForRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; } - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType { - [self.rangeController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; + [self setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; } - (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + if ([self pendingState]) { + return [_pendingState tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + } else { + return [self.rangeController tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + } } - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + if ([self pendingState]) { + [_pendingState setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + } else { + return [self.rangeController setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + } } #pragma mark - Selection diff --git a/Source/ASTableNode.h b/Source/ASTableNode.h index 2476c309c1..2cd2394c8a 100644 --- a/Source/ASTableNode.h +++ b/Source/ASTableNode.h @@ -31,8 +31,8 @@ NS_ASSUME_NONNULL_BEGIN @property (readonly) ASTableView *view; // These properties can be set without triggering the view to be created, so it's fine to set them in -init. -@property (nullable, weak, nonatomic) id delegate; -@property (nullable, weak, nonatomic) id dataSource; +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id dataSource; /** * The number of screens left to scroll before the delegate -tableNode:beginBatchFetchingWithContext: is called. diff --git a/Source/ASTableNode.mm b/Source/ASTableNode.mm index 12d3f972f4..cbcb54f77a 100644 --- a/Source/ASTableNode.mm +++ b/Source/ASTableNode.mm @@ -25,9 +25,12 @@ #pragma mark - _ASTablePendingState -@interface _ASTablePendingState : NSObject -@property (weak, nonatomic) id delegate; -@property (weak, nonatomic) id dataSource; +@interface _ASTablePendingState : NSObject { +@public + std::vector> _tuningParameters; +} +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id dataSource; @property (nonatomic) ASLayoutRangeMode rangeMode; @property (nonatomic) BOOL allowsSelection; @property (nonatomic) BOOL allowsSelectionDuringEditing; @@ -39,14 +42,19 @@ @property (nonatomic) CGPoint contentOffset; @property (nonatomic) BOOL animatesContentOffset; @property (nonatomic) BOOL automaticallyAdjustsContentOffset; + @end @implementation _ASTablePendingState + +#pragma mark - Lifecycle + - (instancetype)init { self = [super init]; if (self) { _rangeMode = ASLayoutRangeModeUnspecified; + _tuningParameters = std::vector> (ASLayoutRangeModeCount, std::vector (ASLayoutRangeTypeCount, ASRangeTuningParametersZero)); _allowsSelection = YES; _allowsSelectionDuringEditing = NO; _allowsMultipleSelection = NO; @@ -61,6 +69,30 @@ return self; } +#pragma mark Tuning Parameters + +- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType +{ + return [self tuningParametersForRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; +} + +- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType +{ + return [self setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; +} + +- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType +{ + ASDisplayNodeAssert(rangeMode < _tuningParameters.size() && rangeType < _tuningParameters[rangeMode].size(), @"Requesting a range that is OOB for the configured tuning parameters"); + return _tuningParameters[rangeMode][rangeType]; +} + +- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType +{ + ASDisplayNodeAssert(rangeMode < _tuningParameters.size() && rangeType < _tuningParameters[rangeMode].size(), @"Setting a range that is OOB for the configured tuning parameters"); + _tuningParameters[rangeMode][rangeType] = tuningParameters; +} + @end #pragma mark - ASTableView @@ -72,6 +104,7 @@ } @property (nonatomic) _ASTablePendingState *pendingState; +@property (nonatomic, weak) ASRangeController *rangeController; @end @implementation ASTableNode @@ -116,9 +149,11 @@ ASTableView *view = self.view; view.tableNode = self; + + _rangeController = view.rangeController; if (_pendingState) { - _ASTablePendingState *pendingState = _pendingState; + _ASTablePendingState *pendingState = _pendingState; view.asyncDelegate = pendingState.delegate; view.asyncDataSource = pendingState.dataSource; view.inverted = pendingState.inverted; @@ -129,8 +164,23 @@ view.contentInset = pendingState.contentInset; self.pendingState = nil; + let tuningParametersVector = pendingState->_tuningParameters; + let tuningParametersVectorSize = tuningParametersVector.size(); + for (NSInteger rangeMode = 0; rangeMode < tuningParametersVectorSize; rangeMode++) { + let tuningparametersRangeModeVector = tuningParametersVector[rangeMode]; + let tuningParametersVectorRangeModeSize = tuningparametersRangeModeVector.size(); + for (NSInteger rangeType = 0; rangeType < tuningParametersVectorRangeModeSize; rangeType++) { + ASRangeTuningParameters tuningParameters = tuningparametersRangeModeVector[rangeType]; + if (!ASRangeTuningParametersEqualToRangeTuningParameters(tuningParameters, ASRangeTuningParametersZero)) { + [_rangeController setTuningParameters:tuningParameters + forRangeMode:(ASLayoutRangeMode)rangeMode + rangeType:(ASLayoutRangeType)rangeType]; + } + } + } + if (pendingState.rangeMode != ASLayoutRangeModeUnspecified) { - [view.rangeController updateCurrentRangeWithMode:pendingState.rangeMode]; + [_rangeController updateCurrentRangeWithMode:pendingState.rangeMode]; } [view setContentOffset:pendingState.contentOffset animated:pendingState.animatesContentOffset]; @@ -159,7 +209,7 @@ [super didEnterPreloadState]; // Intentionally allocate the view here and trigger a layout pass on it, which in turn will trigger the intial data load. // We can get rid of this call later when ASDataController, ASRangeController and ASCollectionLayout can operate without the view. - [[self view] layoutIfNeeded]; + [self.view layoutIfNeeded]; } #if ASRangeControllerLoggingEnabled @@ -190,12 +240,6 @@ return self.view.dataController; } -// TODO: Implement this without the view. -- (ASRangeController *)rangeController -{ - return self.view.rangeController; -} - - (_ASTablePendingState *)pendingState { if (!_pendingState && ![self isNodeLoaded]) { @@ -476,22 +520,30 @@ ASLayoutElementCollectionTableSetTraitCollection(_environmentStateLock) - (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController tuningParametersForRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; + return [self tuningParametersForRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; } - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType { - [self.rangeController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; + [self setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; } - (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + if ([self pendingState]) { + return [_pendingState tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + } else { + return [self.rangeController tuningParametersForRangeMode:rangeMode rangeType:rangeType]; + } } - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType { - return [self.rangeController setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + if ([self pendingState]) { + [_pendingState setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + } else { + return [self.rangeController setTuningParameters:tuningParameters forRangeMode:rangeMode rangeType:rangeType]; + } } #pragma mark - Selection diff --git a/Tests/ASCollectionViewTests.mm b/Tests/ASCollectionViewTests.mm index 372e258f20..92fb349e89 100644 --- a/Tests/ASCollectionViewTests.mm +++ b/Tests/ASCollectionViewTests.mm @@ -369,6 +369,17 @@ XCTAssertTrue(ASRangeTuningParametersEqualToRangeTuningParameters(preloadParams, [collectionView tuningParametersForRangeType:ASLayoutRangeTypePreload])); } +// Informations to test: https://github.com/TextureGroup/Texture/issues/1094 +- (void)testThatCollectionNodeCanHandleNilRangeController +{ + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + ASCollectionNode *collectionNode = [[ASCollectionNode alloc] initWithCollectionViewLayout:layout]; + [collectionNode recursivelySetInterfaceState:ASInterfaceStateDisplay]; + [collectionNode setHierarchyState:ASHierarchyStateRangeManaged]; + [collectionNode recursivelySetInterfaceState:ASInterfaceStateNone]; + ASCATransactionQueueWait(nil); +} + /** * This may seem silly, but we had issues where the runtime sometimes wouldn't correctly report * conformances declared on categories. From ceed2d200827e495dcd3464e77486815441ac750 Mon Sep 17 00:00:00 2001 From: Adlai Holler Date: Wed, 19 Sep 2018 11:23:19 -0700 Subject: [PATCH 88/97] Remove reliance on shared_ptr for ASDisplayNodeLayouts (#1131) * Remove reliance on shared_ptr for ASDisplayNodeLayouts * Fix up * Fix in yoga * Back to let * Returns inner pointer * Trivial change to kick the CI --- AsyncDisplayKit.xcodeproj/project.pbxproj | 4 - CHANGELOG.md | 1 + Source/ASDisplayNode+Layout.mm | 126 +++++++++++----------- Source/ASDisplayNode+Yoga.mm | 2 +- Source/ASDisplayNode.mm | 24 ++--- Source/Private/ASDisplayNodeInternal.h | 4 +- Source/Private/ASDisplayNodeLayout.h | 10 +- Source/Private/ASDisplayNodeLayout.mm | 22 ---- Source/Private/ASLayoutTransition.h | 10 +- Source/Private/ASLayoutTransition.mm | 20 ++-- 10 files changed, 99 insertions(+), 124 deletions(-) delete mode 100644 Source/Private/ASDisplayNodeLayout.mm diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index 52ac52e894..bb70ae7d7b 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -148,7 +148,6 @@ 6947B0C01E36B4E30007C478 /* ASStackUnpositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6947B0BD1E36B4E30007C478 /* ASStackUnpositionedLayout.mm */; }; 6947B0C31E36B5040007C478 /* ASStackPositionedLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 6947B0C11E36B5040007C478 /* ASStackPositionedLayout.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6947B0C51E36B5040007C478 /* ASStackPositionedLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6947B0C21E36B5040007C478 /* ASStackPositionedLayout.mm */; }; - 6959433F1D70815300B0EE1F /* ASDisplayNodeLayout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6959433C1D70815300B0EE1F /* ASDisplayNodeLayout.mm */; }; 695943401D70815300B0EE1F /* ASDisplayNodeLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 6959433D1D70815300B0EE1F /* ASDisplayNodeLayout.h */; settings = {ATTRIBUTES = (Private, ); }; }; 695BE2551DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 695BE2541DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm */; }; 696F01EC1DD2AF450049FBD5 /* ASEventLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 696F01EA1DD2AF450049FBD5 /* ASEventLog.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -705,7 +704,6 @@ 6947B0BD1E36B4E30007C478 /* ASStackUnpositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackUnpositionedLayout.mm; sourceTree = ""; }; 6947B0C11E36B5040007C478 /* ASStackPositionedLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASStackPositionedLayout.h; sourceTree = ""; }; 6947B0C21E36B5040007C478 /* ASStackPositionedLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASStackPositionedLayout.mm; sourceTree = ""; }; - 6959433C1D70815300B0EE1F /* ASDisplayNodeLayout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASDisplayNodeLayout.mm; sourceTree = ""; }; 6959433D1D70815300B0EE1F /* ASDisplayNodeLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASDisplayNodeLayout.h; sourceTree = ""; }; 695BE2541DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASWrapperSpecSnapshotTests.mm; sourceTree = ""; }; 696F01EA1DD2AF450049FBD5 /* ASEventLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASEventLog.h; sourceTree = ""; }; @@ -1490,7 +1488,6 @@ 690BC8C020F6D3490052A434 /* ASDisplayNodeCornerLayerDelegate.m */, 058D0A0C195D050800B7D73C /* ASDisplayNodeInternal.h */, 6959433D1D70815300B0EE1F /* ASDisplayNodeLayout.h */, - 6959433C1D70815300B0EE1F /* ASDisplayNodeLayout.mm */, CCA282C61E9EB64B0037E8B7 /* ASDisplayNodeTipState.h */, CCA282C71E9EB64B0037E8B7 /* ASDisplayNodeTipState.m */, 68B8A4DB1CBD911D007E4543 /* ASImageNode+AnimatedImagePrivate.h */, @@ -2497,7 +2494,6 @@ DB78412E1C6BCE1600A9E2B4 /* _ASTransitionContext.m in Sources */, B350620B1B010EFD0018CF92 /* ASTableView.mm in Sources */, B350620E1B010EFD0018CF92 /* ASTextNode.mm in Sources */, - 6959433F1D70815300B0EE1F /* ASDisplayNodeLayout.mm in Sources */, 68355B3E1CB57A60001D4E68 /* ASPINRemoteImageDownloader.m in Sources */, CC034A141E649F1300626263 /* AsyncDisplayKit+IGListKitMethods.m in Sources */, 509E68661B3AEDD7009B9150 /* CoreGraphics+ASConvenience.m in Sources */, diff --git a/CHANGELOG.md b/CHANGELOG.md index 312e3b248e..0b2cde12a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ - Small optimization to the layout spec & yoga layout systems by eliminating array copies. [Adlai Holler](https://github.com/Adlai-Holler) - Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler) - Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki) +- Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 3e08fd9606..fe1df8fc62 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -70,19 +70,19 @@ ASLayout *layout = nil; NSUInteger version = _layoutVersion; - if (_calculatedDisplayNodeLayout->isValid(constrainedSize, parentSize, version)) { - ASDisplayNodeAssertNotNil(_calculatedDisplayNodeLayout->layout, @"-[ASDisplayNode layoutThatFits:parentSize:] _calculatedDisplayNodeLayout->layout should not be nil! %@", self); - layout = _calculatedDisplayNodeLayout->layout; - } else if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(constrainedSize, parentSize, version)) { - ASDisplayNodeAssertNotNil(_pendingDisplayNodeLayout->layout, @"-[ASDisplayNode layoutThatFits:parentSize:] _pendingDisplayNodeLayout->layout should not be nil! %@", self); - layout = _pendingDisplayNodeLayout->layout; + if (_calculatedDisplayNodeLayout.isValid(constrainedSize, parentSize, version)) { + ASDisplayNodeAssertNotNil(_calculatedDisplayNodeLayout.layout, @"-[ASDisplayNode layoutThatFits:parentSize:] _calculatedDisplayNodeLayout.layout should not be nil! %@", self); + layout = _calculatedDisplayNodeLayout.layout; + } else if (_pendingDisplayNodeLayout.isValid(constrainedSize, parentSize, version)) { + ASDisplayNodeAssertNotNil(_pendingDisplayNodeLayout.layout, @"-[ASDisplayNode layoutThatFits:parentSize:] _pendingDisplayNodeLayout.layout should not be nil! %@", self); + layout = _pendingDisplayNodeLayout.layout; } else { // Create a pending display node layout for the layout pass layout = [self calculateLayoutThatFits:constrainedSize restrictedToSize:self.style.size relativeToParentSize:parentSize]; as_log_verbose(ASLayoutLog(), "Established pending layout for %@ in %s", self, sel_getName(_cmd)); - _pendingDisplayNodeLayout = std::make_shared(layout, constrainedSize, parentSize, version); + _pendingDisplayNodeLayout = ASDisplayNodeLayout(layout, constrainedSize, parentSize,version); ASDisplayNodeAssertNotNil(layout, @"-[ASDisplayNode layoutThatFits:parentSize:] newly calculated layout should not be nil! %@", self); } @@ -156,16 +156,16 @@ ASLayoutElementStyleExtensibilityForwarding - (ASLayout *)calculatedLayout { ASDN::MutexLocker l(__instanceLock__); - return _calculatedDisplayNodeLayout->layout; + return _calculatedDisplayNodeLayout.layout; } - (CGSize)calculatedSize { ASDN::MutexLocker l(__instanceLock__); - if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { - return _pendingDisplayNodeLayout->layout.size; + if (_pendingDisplayNodeLayout.isValid(_layoutVersion)) { + return _pendingDisplayNodeLayout.layout.size; } - return _calculatedDisplayNodeLayout->layout.size; + return _calculatedDisplayNodeLayout.layout.size; } - (ASSizeRange)constrainedSizeForCalculatedLayout @@ -177,10 +177,10 @@ ASLayoutElementStyleExtensibilityForwarding - (ASSizeRange)_locked_constrainedSizeForCalculatedLayout { ASAssertLocked(__instanceLock__); - if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { - return _pendingDisplayNodeLayout->constrainedSize; + if (_pendingDisplayNodeLayout.isValid(_layoutVersion)) { + return _pendingDisplayNodeLayout.constrainedSize; } - return _calculatedDisplayNodeLayout->constrainedSize; + return _calculatedDisplayNodeLayout.constrainedSize; } @end @@ -246,10 +246,10 @@ ASLayoutElementStyleExtensibilityForwarding // Figure out constrainedSize to use ASSizeRange constrainedSize = ASSizeRangeMake(boundsSizeForLayout); - if (_pendingDisplayNodeLayout != nullptr) { - constrainedSize = _pendingDisplayNodeLayout->constrainedSize; - } else if (_calculatedDisplayNodeLayout->layout != nil) { - constrainedSize = _calculatedDisplayNodeLayout->constrainedSize; + if (_pendingDisplayNodeLayout.layout != nil) { + constrainedSize = _pendingDisplayNodeLayout.constrainedSize; + } else if (_calculatedDisplayNodeLayout.layout != nil) { + constrainedSize = _calculatedDisplayNodeLayout.constrainedSize; } __instanceLock__.unlock(); @@ -305,20 +305,20 @@ ASLayoutElementStyleExtensibilityForwarding // Prefer a newer and not yet applied _pendingDisplayNodeLayout over _calculatedDisplayNodeLayout // If there is no such _pending, check if _calculated is valid to reuse (avoiding recalculation below). BOOL pendingLayoutIsPreferred = NO; - if (_pendingDisplayNodeLayout != nullptr && _pendingDisplayNodeLayout->isValid(_layoutVersion)) { - NSUInteger calculatedVersion = _calculatedDisplayNodeLayout->version; - NSUInteger pendingVersion = _pendingDisplayNodeLayout->version; + if (_pendingDisplayNodeLayout.isValid(_layoutVersion)) { + NSUInteger calculatedVersion = _calculatedDisplayNodeLayout.version; + NSUInteger pendingVersion = _pendingDisplayNodeLayout.version; if (pendingVersion > calculatedVersion) { pendingLayoutIsPreferred = YES; // Newer _pending } else if (pendingVersion == calculatedVersion - && !ASSizeRangeEqualToSizeRange(_pendingDisplayNodeLayout->constrainedSize, - _calculatedDisplayNodeLayout->constrainedSize)) { + && !ASSizeRangeEqualToSizeRange(_pendingDisplayNodeLayout.constrainedSize, + _calculatedDisplayNodeLayout.constrainedSize)) { pendingLayoutIsPreferred = YES; // _pending with a different constrained size } } - BOOL calculatedLayoutIsReusable = (_calculatedDisplayNodeLayout->isValid(_layoutVersion) - && (_calculatedDisplayNodeLayout->requestedLayoutFromAbove - || CGSizeEqualToSize(_calculatedDisplayNodeLayout->layout.size, boundsSizeForLayout))); + BOOL calculatedLayoutIsReusable = (_calculatedDisplayNodeLayout.isValid(_layoutVersion) + && (_calculatedDisplayNodeLayout.requestedLayoutFromAbove + || CGSizeEqualToSize(_calculatedDisplayNodeLayout.layout.size, boundsSizeForLayout))); if (!pendingLayoutIsPreferred && calculatedLayoutIsReusable) { return; } @@ -341,15 +341,15 @@ ASLayoutElementStyleExtensibilityForwarding } // Figure out previous and pending layouts for layout transition - std::shared_ptr nextLayout = _pendingDisplayNodeLayout; - #define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout->layout.size, boundsSizeForLayout) + ASDisplayNodeLayout nextLayout = _pendingDisplayNodeLayout; + #define layoutSizeDifferentFromBounds !CGSizeEqualToSize(nextLayout.layout.size, boundsSizeForLayout) // nextLayout was likely created by a call to layoutThatFits:, check if it is valid and can be applied. // If our bounds size is different than it, or invalid, recalculate. Use #define to avoid nullptr-> BOOL pendingLayoutApplicable = NO; - if (nextLayout == nullptr) { + if (nextLayout.layout == nil) { as_log_verbose(ASLayoutLog(), "No pending layout."); - } else if (nextLayout->isValid(_layoutVersion) == NO) { + } else if (!nextLayout.isValid(_layoutVersion)) { as_log_verbose(ASLayoutLog(), "Pending layout is stale."); } else if (layoutSizeDifferentFromBounds) { as_log_verbose(ASLayoutLog(), "Pending layout size %@ doesn't match bounds size.", NSStringFromCGSize(nextLayout->layout.size)); @@ -366,10 +366,10 @@ ASLayoutElementStyleExtensibilityForwarding ASLayout *layout = [self calculateLayoutThatFits:constrainedSize restrictedToSize:self.style.size relativeToParentSize:boundsSizeForLayout]; - nextLayout = std::make_shared(layout, constrainedSize, boundsSizeForLayout, version); + nextLayout = ASDisplayNodeLayout(layout, constrainedSize, boundsSizeForLayout, version); // Now that the constrained size of pending layout might have been reused, the layout is useless // Release it and any orphaned subnodes it retains - _pendingDisplayNodeLayout = nullptr; + _pendingDisplayNodeLayout.layout = nil; } if (didCreateNewContext) { @@ -378,8 +378,8 @@ ASLayoutElementStyleExtensibilityForwarding // If our new layout's desired size for self doesn't match current size, ask our parent to update it. // This can occur for either pre-calculated or newly-calculated layouts. - if (nextLayout->requestedLayoutFromAbove == NO - && CGSizeEqualToSize(boundsSizeForLayout, nextLayout->layout.size) == NO) { + if (nextLayout.requestedLayoutFromAbove == NO + && CGSizeEqualToSize(boundsSizeForLayout, nextLayout.layout.size) == NO) { as_log_verbose(ASLayoutLog(), "Layout size doesn't match bounds size. Requesting layout from above."); // The layout that we have specifies that this node (self) would like to be a different size // than it currently is. Because that size has been computed within the constrainedSize, we @@ -387,7 +387,7 @@ ASLayoutElementStyleExtensibilityForwarding // However, in some cases apps may manually interfere with this (setting a different bounds). // In this case, we need to detect that we've already asked to be resized to match this // particular ASLayout object, and shouldn't loop asking again unless we have a different ASLayout. - nextLayout->requestedLayoutFromAbove = YES; + nextLayout.requestedLayoutFromAbove = YES; { ASDN::MutexUnlocker u(__instanceLock__); @@ -396,11 +396,11 @@ ASLayoutElementStyleExtensibilityForwarding // Update the layout's version here because _u_setNeedsLayoutFromAbove calls __setNeedsLayout which in turn increases _layoutVersion // Failing to do this will cause the layout to be invalid immediately - nextLayout->version = _layoutVersion; + nextLayout.version = _layoutVersion; } // Prepare to transition to nextLayout - ASDisplayNodeAssertNotNil(nextLayout->layout, @"nextLayout->layout should not be nil! %@", self); + ASDisplayNodeAssertNotNil(nextLayout.layout, @"nextLayout->layout should not be nil! %@", self); _pendingLayoutTransition = [[ASLayoutTransition alloc] initWithNode:self pendingLayout:nextLayout previousLayout:_calculatedDisplayNodeLayout]; @@ -431,17 +431,16 @@ ASLayoutElementStyleExtensibilityForwarding CGSize boundsSizeForLayout = ASCeilSizeValues(self.threadSafeBounds.size); // Checkout if constrained size of pending or calculated display node layout can be used - if (_pendingDisplayNodeLayout != nullptr - && (_pendingDisplayNodeLayout->requestedLayoutFromAbove - || CGSizeEqualToSize(_pendingDisplayNodeLayout->layout.size, boundsSizeForLayout))) { + if (_pendingDisplayNodeLayout.requestedLayoutFromAbove + || CGSizeEqualToSize(_pendingDisplayNodeLayout.layout.size, boundsSizeForLayout)) { // We assume the size from the last returned layoutThatFits: layout was applied so use the pending display node // layout constrained size - return _pendingDisplayNodeLayout->constrainedSize; - } else if (_calculatedDisplayNodeLayout->layout != nil - && (_calculatedDisplayNodeLayout->requestedLayoutFromAbove - || CGSizeEqualToSize(_calculatedDisplayNodeLayout->layout.size, boundsSizeForLayout))) { + return _pendingDisplayNodeLayout.constrainedSize; + } else if (_calculatedDisplayNodeLayout.layout != nil + && (_calculatedDisplayNodeLayout.requestedLayoutFromAbove + || CGSizeEqualToSize(_calculatedDisplayNodeLayout.layout.size, boundsSizeForLayout))) { // We assume the _calculatedDisplayNodeLayout is still valid and the frame is not different - return _calculatedDisplayNodeLayout->constrainedSize; + return _calculatedDisplayNodeLayout.constrainedSize; } else { // In this case neither the _pendingDisplayNodeLayout or the _calculatedDisplayNodeLayout constrained size can // be reused, so the current bounds is used. This is usual the case if a frame was set manually that differs to @@ -458,10 +457,10 @@ ASLayoutElementStyleExtensibilityForwarding ASLayout *layout; { ASDN::MutexLocker l(__instanceLock__); - if (_calculatedDisplayNodeLayout->version < _layoutVersion) { + if (_calculatedDisplayNodeLayout.version < _layoutVersion) { return; } - layout = _calculatedDisplayNodeLayout->layout; + layout = _calculatedDisplayNodeLayout.layout; } for (ASDisplayNode *node in self.subnodes) { @@ -654,10 +653,10 @@ ASLayoutElementStyleExtensibilityForwarding // Update calculated layout let previousLayout = _calculatedDisplayNodeLayout; - let pendingLayout = std::make_shared(newLayout, - constrainedSize, - constrainedSize.max, - newLayoutVersion); + let pendingLayout = ASDisplayNodeLayout(newLayout, + constrainedSize, + constrainedSize.max, + newLayoutVersion); [self _locked_setCalculatedDisplayNodeLayout:pendingLayout]; // Setup pending layout transition for animation @@ -869,7 +868,7 @@ ASLayoutElementStyleExtensibilityForwarding { ASAssertUnlocked(__instanceLock__); - ASLayoutTransition *pendingLayoutTransition = nil; + ASLayoutTransition *pendingLayoutTransition; { ASDN::MutexLocker l(__instanceLock__); pendingLayoutTransition = _pendingLayoutTransition; @@ -918,7 +917,7 @@ ASLayoutElementStyleExtensibilityForwarding } NSArray *subnodes = [self subnodes]; - NSArray *sublayouts = _calculatedDisplayNodeLayout->layout.sublayouts; + NSArray *sublayouts = _calculatedDisplayNodeLayout.layout.sublayouts; let currentSubnodes = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality capacity:subnodes.count]; @@ -970,8 +969,7 @@ ASLayoutElementStyleExtensibilityForwarding if (_placeholderEnabled && !_placeholderImage && [self _locked_displaysAsynchronously]) { // Zero-sized nodes do not require a placeholder. - ASLayout *layout = _calculatedDisplayNodeLayout->layout; - CGSize layoutSize = (layout ? layout.size : CGSizeZero); + CGSize layoutSize = _calculatedDisplayNodeLayout.layout.size; if (layoutSize.width * layoutSize.height <= 0.0) { return; } @@ -995,26 +993,26 @@ ASLayoutElementStyleExtensibilityForwarding _pendingLayoutTransition = nil; } -- (void)_setCalculatedDisplayNodeLayout:(std::shared_ptr)displayNodeLayout +- (void)_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout { ASDN::MutexLocker l(__instanceLock__); [self _locked_setCalculatedDisplayNodeLayout:displayNodeLayout]; } -- (void)_locked_setCalculatedDisplayNodeLayout:(std::shared_ptr)displayNodeLayout +- (void)_locked_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout { ASAssertLocked(__instanceLock__); - ASDisplayNodeAssertTrue(displayNodeLayout->layout.layoutElement == self); - ASDisplayNodeAssertTrue(displayNodeLayout->layout.size.width >= 0.0); - ASDisplayNodeAssertTrue(displayNodeLayout->layout.size.height >= 0.0); + ASDisplayNodeAssertTrue(displayNodeLayout.layout.layoutElement == self); + ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.width >= 0.0); + ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.height >= 0.0); + + _calculatedDisplayNodeLayout = displayNodeLayout; // Flatten the layout if it wasn't done before (@see -calculateLayoutThatFits:). if ([ASDisplayNode shouldStoreUnflattenedLayouts]) { - _unflattenedLayout = displayNodeLayout->layout; - displayNodeLayout->layout = [_unflattenedLayout filteredNodeLayoutTree]; + _unflattenedLayout = _calculatedDisplayNodeLayout.layout; + _calculatedDisplayNodeLayout.layout = [_unflattenedLayout filteredNodeLayoutTree]; } - - _calculatedDisplayNodeLayout = displayNodeLayout; } @end diff --git a/Source/ASDisplayNode+Yoga.mm b/Source/ASDisplayNode+Yoga.mm index d1d3d7defb..8f4cfdc63a 100644 --- a/Source/ASDisplayNode+Yoga.mm +++ b/Source/ASDisplayNode+Yoga.mm @@ -209,7 +209,7 @@ // For the root node in a Yoga tree, make sure to preserve the constrainedSize originally provided. // This will be used for all relayouts triggered by children, since they escalate to root. ASSizeRange range = parentNode ? ASSizeRangeUnconstrained : self.constrainedSizeForCalculatedLayout; - _pendingDisplayNodeLayout = std::make_shared(layout, range, parentSize, _layoutVersion); + _pendingDisplayNodeLayout = ASDisplayNodeLayout(layout, range, parentSize, _layoutVersion); } } diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index f79fb10843..fcd209e9d8 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -292,8 +292,6 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c) _primitiveTraitCollection = ASPrimitiveTraitCollectionMakeDefault(); - _calculatedDisplayNodeLayout = std::make_shared(); - _pendingDisplayNodeLayout = nullptr; _layoutVersion = 1; _defaultLayoutTransitionDuration = 0.2; @@ -3812,21 +3810,19 @@ ASDISPLAYNODE_INLINE BOOL subtreeIsRasterized(ASDisplayNode *node) { [props addObject:@{ @"layoutVersion": @(_layoutVersion.load()) }]; [props addObject:@{ @"bounds": [NSValue valueWithCGRect:self.bounds] }]; - if (_calculatedDisplayNodeLayout != nullptr) { - ASDisplayNodeLayout c = *_calculatedDisplayNodeLayout; - [props addObject:@{ @"calculatedLayout": c.layout }]; - [props addObject:@{ @"calculatedVersion": @(c.version) }]; - [props addObject:@{ @"calculatedConstrainedSize" : NSStringFromASSizeRange(c.constrainedSize) }]; - if (c.requestedLayoutFromAbove) { + if (_calculatedDisplayNodeLayout.layout) { + [props addObject:@{ @"calculatedLayout": _calculatedDisplayNodeLayout.layout }]; + [props addObject:@{ @"calculatedVersion": @(_calculatedDisplayNodeLayout.version) }]; + [props addObject:@{ @"calculatedConstrainedSize" : NSStringFromASSizeRange(_calculatedDisplayNodeLayout.constrainedSize) }]; + if (_calculatedDisplayNodeLayout.requestedLayoutFromAbove) { [props addObject:@{ @"calculatedRequestedLayoutFromAbove": @"YES" }]; } } - if (_pendingDisplayNodeLayout != nullptr) { - ASDisplayNodeLayout p = *_pendingDisplayNodeLayout; - [props addObject:@{ @"pendingLayout": p.layout }]; - [props addObject:@{ @"pendingVersion": @(p.version) }]; - [props addObject:@{ @"pendingConstrainedSize" : NSStringFromASSizeRange(p.constrainedSize) }]; - if (p.requestedLayoutFromAbove) { + if (_pendingDisplayNodeLayout.layout) { + [props addObject:@{ @"pendingLayout": _pendingDisplayNodeLayout.layout }]; + [props addObject:@{ @"pendingVersion": @(_pendingDisplayNodeLayout.version) }]; + [props addObject:@{ @"pendingConstrainedSize" : NSStringFromASSizeRange(_pendingDisplayNodeLayout.constrainedSize) }]; + if (_pendingDisplayNodeLayout.requestedLayoutFromAbove) { [props addObject:@{ @"pendingRequestedLayoutFromAbove": (id)kCFNull }]; } } diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index f8fc559bc2..96b4cb2f4b 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -164,8 +164,8 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest std::atomic _pendingTransitionID; ASLayoutTransition *_pendingLayoutTransition; - std::shared_ptr _calculatedDisplayNodeLayout; - std::shared_ptr _pendingDisplayNodeLayout; + ASDisplayNodeLayout _calculatedDisplayNodeLayout; + ASDisplayNodeLayout _pendingDisplayNodeLayout; /// Sentinel for layout data. Incremented when we get -setNeedsLayout / -invalidateCalculatedLayout. /// Starts at 1. diff --git a/Source/Private/ASDisplayNodeLayout.h b/Source/Private/ASDisplayNodeLayout.h index 272e10776d..ba8d9c273e 100644 --- a/Source/Private/ASDisplayNodeLayout.h +++ b/Source/Private/ASDisplayNodeLayout.h @@ -43,10 +43,16 @@ struct ASDisplayNodeLayout { /** * Returns whether this is valid for a given version */ - BOOL isValid(NSUInteger version); + BOOL isValid(NSUInteger versionArg) { + return layout != nil && version >= versionArg; + } /** * Returns whether this is valid for a given constrained size, parent size, and version */ - BOOL isValid(ASSizeRange constrainedSize, CGSize parentSize, NSUInteger version); + BOOL isValid(ASSizeRange theConstrainedSize, CGSize theParentSize, NSUInteger versionArg) { + return isValid(versionArg) + && CGSizeEqualToSize(parentSize, theParentSize) + && ASSizeRangeEqualToSizeRange(constrainedSize, theConstrainedSize); + } }; diff --git a/Source/Private/ASDisplayNodeLayout.mm b/Source/Private/ASDisplayNodeLayout.mm deleted file mode 100644 index 6dc433d51c..0000000000 --- a/Source/Private/ASDisplayNodeLayout.mm +++ /dev/null @@ -1,22 +0,0 @@ -// -// ASDisplayNodeLayout.mm -// Texture -// -// Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. -// Changes after 4/13/2017 are: Copyright (c) Pinterest, Inc. All rights reserved. -// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 -// - -#import - -BOOL ASDisplayNodeLayout::isValid(NSUInteger versionArg) -{ - return layout != nil && version >= versionArg; -} - -BOOL ASDisplayNodeLayout::isValid(ASSizeRange theConstrainedSize, CGSize theParentSize, NSUInteger versionArg) -{ - return isValid(versionArg) - && CGSizeEqualToSize(parentSize, theParentSize) - && ASSizeRangeEqualToSizeRange(constrainedSize, theConstrainedSize); -} diff --git a/Source/Private/ASLayoutTransition.h b/Source/Private/ASLayoutTransition.h index 6be60836e5..f2bcf9b253 100644 --- a/Source/Private/ASLayoutTransition.h +++ b/Source/Private/ASLayoutTransition.h @@ -15,8 +15,6 @@ #import #import -#import - NS_ASSUME_NONNULL_BEGIN #pragma mark - ASLayoutElementTransition @@ -52,12 +50,12 @@ AS_SUBCLASSING_RESTRICTED /** * Previous layout to transition from */ -@property (nonatomic, readonly) std::shared_ptr previousLayout; +@property (nonatomic, readonly) const ASDisplayNodeLayout &previousLayout NS_RETURNS_INNER_POINTER; /** * Pending layout to transition to */ -@property (nonatomic, readonly) std::shared_ptr pendingLayout; +@property (nonatomic, readonly) const ASDisplayNodeLayout &pendingLayout NS_RETURNS_INNER_POINTER; /** * Returns if the layout transition needs to happen synchronously @@ -68,8 +66,8 @@ AS_SUBCLASSING_RESTRICTED * Returns a newly initialized layout transition */ - (instancetype)initWithNode:(ASDisplayNode *)node - pendingLayout:(std::shared_ptr)pendingLayout - previousLayout:(std::shared_ptr)previousLayout NS_DESIGNATED_INITIALIZER; + pendingLayout:(const ASDisplayNodeLayout &)pendingLayout + previousLayout:(const ASDisplayNodeLayout &)previousLayout NS_DESIGNATED_INITIALIZER; /** * Insert and remove subnodes that were added or removed between the previousLayout and the pendingLayout diff --git a/Source/Private/ASLayoutTransition.mm b/Source/Private/ASLayoutTransition.mm index 32eaa3229e..1e482afa63 100644 --- a/Source/Private/ASLayoutTransition.mm +++ b/Source/Private/ASLayoutTransition.mm @@ -60,11 +60,13 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { NSArray *_removedSubnodes; std::vector _insertedSubnodePositions; std::vector> _subnodeMoves; + ASDisplayNodeLayout _pendingLayout; + ASDisplayNodeLayout _previousLayout; } - (instancetype)initWithNode:(ASDisplayNode *)node - pendingLayout:(std::shared_ptr)pendingLayout - previousLayout:(std::shared_ptr)previousLayout + pendingLayout:(const ASDisplayNodeLayout &)pendingLayout + previousLayout:(const ASDisplayNodeLayout &)previousLayout { self = [super init]; if (self) { @@ -80,7 +82,7 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { - (BOOL)isSynchronous { ASDN::MutexSharedLocker l(__instanceLock__); - return !ASLayoutCanTransitionAsynchronous(_pendingLayout->layout); + return !ASLayoutCanTransitionAsynchronous(_pendingLayout.layout); } - (void)commitTransition @@ -156,8 +158,8 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { // Create an activity even if no subnodes affected. as_activity_create_for_scope("Calculate subnode operations"); - ASLayout *previousLayout = _previousLayout->layout; - ASLayout *pendingLayout = _pendingLayout->layout; + ASLayout *previousLayout = _previousLayout.layout; + ASLayout *pendingLayout = _pendingLayout.layout; if (previousLayout) { #if AS_IG_LIST_KIT @@ -226,9 +228,9 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { { ASDN::MutexSharedLocker l(__instanceLock__); if ([key isEqualToString:ASTransitionContextFromLayoutKey]) { - return _previousLayout->layout; + return _previousLayout.layout; } else if ([key isEqualToString:ASTransitionContextToLayoutKey]) { - return _pendingLayout->layout; + return _pendingLayout.layout; } else { return nil; } @@ -238,9 +240,9 @@ static inline BOOL ASLayoutCanTransitionAsynchronous(ASLayout *layout) { { ASDN::MutexSharedLocker l(__instanceLock__); if ([key isEqualToString:ASTransitionContextFromLayoutKey]) { - return _previousLayout->constrainedSize; + return _previousLayout.constrainedSize; } else if ([key isEqualToString:ASTransitionContextToLayoutKey]) { - return _pendingLayout->constrainedSize; + return _pendingLayout.constrainedSize; } else { return ASSizeRangeMake(CGSizeZero, CGSizeZero); } From 71ef0fc3ed6ec5351fe3c79638ac0971ab7c7667 Mon Sep 17 00:00:00 2001 From: ernestmama <43187788+ernestmama@users.noreply.github.com> Date: Wed, 19 Sep 2018 13:07:06 -0700 Subject: [PATCH 89/97] Fix downloader method name mismatch #trivial (#1134) --- Source/Details/ASPINRemoteImageDownloader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Details/ASPINRemoteImageDownloader.m b/Source/Details/ASPINRemoteImageDownloader.m index 46a60b3f0f..f405771206 100644 --- a/Source/Details/ASPINRemoteImageDownloader.m +++ b/Source/Details/ASPINRemoteImageDownloader.m @@ -121,7 +121,7 @@ static PINRemoteImageManager *sharedPINRemoteImageManager = nil; __unused PINRemoteImageManager *sharedManager = [self sharedPINRemoteImageManagerWithConfiguration:configuration preconfiguredPINRemoteImageManager:nil]; } -+ (void)setSharedPreconfiguredImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager ++ (void)setSharedPreconfiguredRemoteImageManager:(nullable PINRemoteImageManager *)preconfiguredPINRemoteImageManager { NSAssert(sharedDownloader == nil, @"Singleton has been created and session can no longer be configured."); NSAssert1(sharedPINRemoteImageManager == nil, @"An instance of %@ has been set. Either configuration or preconfigured image manager can be set at a time and only once.", [[sharedPINRemoteImageManager class] description]); From 696f344301b0adca156b3580b14853edc23ff7bb Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Thu, 20 Sep 2018 07:54:10 -0700 Subject: [PATCH 90/97] Fix compilation warnings #trivial (#1132) * Apply recommended warnings * Squelch designated initializer warning in ASViewController * Remove unused compiler flag clang: warning: argument unused during compilation: '-fno-objc-arc-exceptions' [-Wunused-command-line-argument] * Fix warning about overriding an instance variable within a category Instance method 'methodOverrides' in category from _ASDisplayView.o overrides method from class in ASDisplayNode.o --- AsyncDisplayKit.xcodeproj/project.pbxproj | 14 ++++++++++---- .../xcschemes/AsyncDisplayKit.xcscheme | 2 +- Source/ASDisplayNode.mm | 5 +++++ Source/ASViewController.mm | 5 +++++ Source/Details/_ASDisplayView.mm | 14 -------------- Source/Private/ASDisplayNodeInternal.h | 2 +- Texture.podspec | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/AsyncDisplayKit.xcodeproj/project.pbxproj b/AsyncDisplayKit.xcodeproj/project.pbxproj index bb70ae7d7b..305b392e1c 100644 --- a/AsyncDisplayKit.xcodeproj/project.pbxproj +++ b/AsyncDisplayKit.xcodeproj/project.pbxproj @@ -2128,7 +2128,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = AS; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = Pinterest; TargetAttributes = { 057D02BE1AC0A66700C7AC3C = { @@ -2586,6 +2586,7 @@ CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -2618,7 +2619,9 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; @@ -2640,6 +2643,7 @@ CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -2662,7 +2666,9 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; SDKROOT = iphoneos; @@ -2741,7 +2747,6 @@ OTHER_CFLAGS = ( "-Wundef", "-fno-exceptions", - "-fno-objc-arc-exceptions", ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; @@ -2774,7 +2779,6 @@ OTHER_CFLAGS = ( "-Wundef", "-fno-exceptions", - "-fno-objc-arc-exceptions", ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; @@ -2797,6 +2801,7 @@ CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; @@ -2819,7 +2824,9 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 9.0; SDKROOT = iphoneos; @@ -2892,7 +2899,6 @@ OTHER_CFLAGS = ( "-Wundef", "-fno-exceptions", - "-fno-objc-arc-exceptions", ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = AsyncDisplayKit; diff --git a/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme b/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme index 8cf72597a3..f06fd13c88 100644 --- a/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme +++ b/AsyncDisplayKit.xcodeproj/xcshareddata/xcschemes/AsyncDisplayKit.xcscheme @@ -1,6 +1,6 @@ #import -#pragma mark - ASDisplayNode - -/** - * Open access to the method overrides struct for ASDisplayView - */ -@implementation ASDisplayNode (ASDisplayNodeMethodOverrides_ASDisplayView) - -- (ASDisplayNodeMethodOverrides)methodOverrides -{ - return _methodOverrides; -} - -@end - #pragma mark - _ASDisplayViewMethodOverrides typedef NS_OPTIONS(NSUInteger, _ASDisplayViewMethodOverrides) diff --git a/Source/Private/ASDisplayNodeInternal.h b/Source/Private/ASDisplayNodeInternal.h index 96b4cb2f4b..5f9092ffaa 100644 --- a/Source/Private/ASDisplayNodeInternal.h +++ b/Source/Private/ASDisplayNodeInternal.h @@ -261,7 +261,7 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest @property (nullable, nonatomic, readonly) _ASDisplayLayer *asyncLayer; /// Bitmask to check which methods an object overrides. -@property (nonatomic, readonly) ASDisplayNodeMethodOverrides methodOverrides; +- (ASDisplayNodeMethodOverrides)methodOverrides; /** * Invoked before a call to setNeedsLayout to the underlying view diff --git a/Texture.podspec b/Texture.podspec index 0ec19ce157..c64e8df22c 100644 --- a/Texture.podspec +++ b/Texture.podspec @@ -16,7 +16,7 @@ Pod::Spec.new do |spec| # Subspecs spec.subspec 'Core' do |core| - core.compiler_flags = '-fno-exceptions -fno-objc-arc-exceptions' + core.compiler_flags = '-fno-exceptions' core.public_header_files = [ 'Source/*.h', 'Source/Details/**/*.h', From 4708522bd0078ca3c08ee5bc72acf15951fe6fb2 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 20 Sep 2018 09:22:18 -0700 Subject: [PATCH 91/97] Add ASExperimentalSkipClearData #trivial (#1136) * Add ASExperimentalSkipClearData * Move the experiment check within the if clause --- Source/ASCollectionView.mm | 3 ++- Source/ASExperimentalFeatures.h | 1 + Source/ASExperimentalFeatures.m | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 69cd531478..94406b0eee 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -576,7 +576,8 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; - (void)_asyncDelegateOrDataSourceDidChange { ASDisplayNodeAssertMainThread(); - if (_asyncDataSource == nil && _asyncDelegate == nil) { + + if (_asyncDataSource == nil && _asyncDelegate == nil && !ASActivateExperimentalFeature(ASExperimentalSkipClearData)) { [_dataController clearData]; } } diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 26c228f8e9..e4bdf067fe 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -24,6 +24,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalDeallocQueue = 1 << 6, // exp_dealloc_queue_v2 ASExperimentalCollectionTeardown = 1 << 7, // exp_collection_teardown ASExperimentalFramesetterCache = 1 << 8, // exp_framesetter_cache + ASExperimentalSkipClearData = 1 << 9, // exp_skip_clear_data ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index b12891fd73..4be736033b 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -20,7 +20,8 @@ NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags @"exp_network_image_queue", @"exp_dealloc_queue_v2", @"exp_collection_teardown", - @"exp_framesetter_cache"])); + @"exp_framesetter_cache" + @"exp_skip_clear_data"])); if (flags == ASExperimentalFeatureAll) { return allNames; From 5dd5611c2cdedbaa7ec4cda924a76bb1ad0b9af6 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Thu, 20 Sep 2018 15:46:39 -0700 Subject: [PATCH 92/97] Add missing comma in ASExperimentalFeatures #trivial (#1137) --- Source/ASExperimentalFeatures.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index 4be736033b..b5751c8737 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -20,7 +20,7 @@ NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags @"exp_network_image_queue", @"exp_dealloc_queue_v2", @"exp_collection_teardown", - @"exp_framesetter_cache" + @"exp_framesetter_cache", @"exp_skip_clear_data"])); if (flags == ASExperimentalFeatureAll) { From f656dbbeddec65978232792fa28654de3ec7afd8 Mon Sep 17 00:00:00 2001 From: Max Wang Date: Fri, 28 Sep 2018 09:14:52 -0700 Subject: [PATCH 93/97] Guard photo library with macro for tests (#1147) * fix SIMULATE_WEB_RESPONSE not imported #449 * Fix to make rangeMode update in right time * remove uncessary assert * Fix collection cell editing bug for iOS 9 & 10 * Revert "Fix collection cell editing bug for iOS 9 & 10" This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea. * Only test when photo library is enabled. It will fail to build if photo library is disabled cause the test is depending on it. * Add ChangeLog. --- CHANGELOG.md | 1 + Tests/ASPhotosFrameworkImageRequestTests.m | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b2cde12a9..7bb3646171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## master * Add your own contributions to the next release on the line below this with your name. +- [ASPhotosFrameworkImageRequestTests] Guard photo library with macro for tests. [Max Wang](https://github.com/wsdwsd0829). [#1147](https://github.com/TextureGroup/Texture/pull/1147) - [ASDisplayNode] Do not cancel display when in exit hierarchy but let interface state changing to handle it. [Max Wang](https://github.com/wsdwsd0829). [#1110](https://github.com/TextureGroup/Texture/pull/1110) - [Breaking][ASDisplayNode] Make interface state delegate protocol required. [Max Wang](https://github.com/wsdwsd0829). [#1112](https://github.com/TextureGroup/Texture/pull/1112) - [ASCollectionView] Fix reording of cells manually for iOS 9 & 10. [Max Wang](https://github.com/wsdwsd0829). [#1081](https://github.com/TextureGroup/Texture/pull/1081) diff --git a/Tests/ASPhotosFrameworkImageRequestTests.m b/Tests/ASPhotosFrameworkImageRequestTests.m index 6e9c2f570d..dc753bb927 100644 --- a/Tests/ASPhotosFrameworkImageRequestTests.m +++ b/Tests/ASPhotosFrameworkImageRequestTests.m @@ -7,6 +7,8 @@ // Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0 // +#if AS_USE_PHOTOS + #import #import @@ -59,3 +61,5 @@ static NSString *const kTestAssetID = @"testAssetID"; } @end + +#endif From 5e0579308de2772c4ead27e0dfd704070abcfa1d Mon Sep 17 00:00:00 2001 From: ernestmama <43187788+ernestmama@users.noreply.github.com> Date: Mon, 1 Oct 2018 11:20:12 -0700 Subject: [PATCH 94/97] Rollout ASDeallocQueueV2 #trivial (#1143) --- Source/ASExperimentalFeatures.h | 7 +- Source/ASRunLoopQueue.mm | 166 +----------------- .../Sample/AppDelegate.m | 11 -- 3 files changed, 8 insertions(+), 176 deletions(-) diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index e4bdf067fe..2af937d663 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -21,10 +21,9 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalUnfairLock = 1 << 3, // exp_unfair_lock ASExperimentalLayerDefaults = 1 << 4, // exp_infer_layer_defaults ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue - ASExperimentalDeallocQueue = 1 << 6, // exp_dealloc_queue_v2 - ASExperimentalCollectionTeardown = 1 << 7, // exp_collection_teardown - ASExperimentalFramesetterCache = 1 << 8, // exp_framesetter_cache - ASExperimentalSkipClearData = 1 << 9, // exp_skip_clear_data + ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown + ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache + ASExperimentalSkipClearData = 1 << 8, // exp_skip_clear_data ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASRunLoopQueue.mm b/Source/ASRunLoopQueue.mm index 391e8e85e1..0463c6221b 100644 --- a/Source/ASRunLoopQueue.mm +++ b/Source/ASRunLoopQueue.mm @@ -31,177 +31,21 @@ static void runLoopSourceCallback(void *info) { #pragma mark - ASDeallocQueue -@interface ASDeallocQueueV1 : ASDeallocQueue -@end -@interface ASDeallocQueueV2 : ASDeallocQueue -@end - -@implementation ASDeallocQueue +@implementation ASDeallocQueue { + std::vector _queue; + ASDN::Mutex _lock; +} + (ASDeallocQueue *)sharedDeallocationQueue NS_RETURNS_RETAINED { static ASDeallocQueue *deallocQueue = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - if (ASActivateExperimentalFeature(ASExperimentalDeallocQueue)) { - deallocQueue = [[ASDeallocQueueV2 alloc] init]; - } else { - deallocQueue = [[ASDeallocQueueV1 alloc] init]; - } + deallocQueue = [[ASDeallocQueue alloc] init]; }); return deallocQueue; } -- (void)releaseObjectInBackground:(id _Nullable __strong *)objectPtr -{ - ASDisplayNodeFailAssert(@"Abstract method."); -} - -- (void)drain -{ - ASDisplayNodeFailAssert(@"Abstract method."); -} - -@end - -@implementation ASDeallocQueueV1 { - NSThread *_thread; - NSCondition *_condition; - std::deque _queue; - ASDN::RecursiveMutex _queueLock; -} - -- (void)releaseObjectInBackground:(id _Nullable __strong *)objectPtr -{ - if (objectPtr != NULL && *objectPtr != nil) { - ASDN::MutexLocker l(_queueLock); - _queue.push_back(*objectPtr); - *objectPtr = nil; - } -} - -- (void)threadMain -{ - @autoreleasepool { - __unsafe_unretained __typeof__(self) weakSelf = self; - // 100ms timer. No resources are wasted in between, as the thread sleeps, and each check is fast. - // This time is fast enough for most use cases without excessive churn. - CFRunLoopTimerRef timer = CFRunLoopTimerCreateWithHandler(NULL, -1, 0.1, 0, 0, ^(CFRunLoopTimerRef timer) { - weakSelf->_queueLock.lock(); - if (weakSelf->_queue.size() == 0) { - weakSelf->_queueLock.unlock(); - return; - } - // The scope below is entered while already locked. @autorelease is crucial here; see PR 2890. - __unused NSInteger count; // Prevent static analyzer warning if release build - @autoreleasepool { -#if ASRunLoopQueueLoggingEnabled - NSLog(@"ASDeallocQueue Processing: %lu objects destroyed", weakSelf->_queue.size()); -#endif - // Sometimes we release 10,000 objects at a time. Don't hold the lock while releasing. - std::deque currentQueue = weakSelf->_queue; - count = currentQueue.size(); - ASSignpostStartCustom(ASSignpostDeallocQueueDrain, self, count); - weakSelf->_queue = std::deque(); - weakSelf->_queueLock.unlock(); - currentQueue.clear(); - } - ASSignpostEndCustom(ASSignpostDeallocQueueDrain, self, count, ASSignpostColorDefault); - }); - - CFRunLoopRef runloop = CFRunLoopGetCurrent(); - CFRunLoopAddTimer(runloop, timer, kCFRunLoopCommonModes); - - [_condition lock]; - [_condition signal]; - // At this moment, -init is signalled that the thread is guaranteed to be finished starting. - [_condition unlock]; - - // Keep processing events until the runloop is stopped. - CFRunLoopRun(); - - CFRunLoopTimerInvalidate(timer); - CFRunLoopRemoveTimer(runloop, timer, kCFRunLoopCommonModes); - CFRelease(timer); - - [_condition lock]; - [_condition signal]; - // At this moment, -stop is signalled that the thread is guaranteed to be finished exiting. - [_condition unlock]; - } -} - -- (instancetype)init -{ - if ((self = [super init])) { - _condition = [[NSCondition alloc] init]; - - _thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMain) object:nil]; - _thread.name = @"ASDeallocQueue"; - - // Use condition to ensure NSThread has finished starting. - [_condition lock]; - [_thread start]; - [_condition wait]; - [_condition unlock]; - } - return self; -} - -- (void)stop -{ - if (!_thread) { - return; - } - - [_condition lock]; - [self performSelector:@selector(_stop) onThread:_thread withObject:nil waitUntilDone:NO]; - [_condition wait]; - // At this moment, the thread is guaranteed to be finished running. - [_condition unlock]; - _thread = nil; -} - -- (void)drain -{ - [self performSelector:@selector(_drain) onThread:_thread withObject:nil waitUntilDone:YES]; -} - -- (void)_drain -{ - while (true) { - @autoreleasepool { - _queueLock.lock(); - std::deque currentQueue = _queue; - _queue = std::deque(); - _queueLock.unlock(); - - if (currentQueue.empty()) { - return; - } else { - currentQueue.clear(); - } - } - } -} - -- (void)_stop -{ - CFRunLoopStop(CFRunLoopGetCurrent()); -} - -- (void)dealloc -{ - [self stop]; -} - -@end - -@implementation ASDeallocQueueV2 { - std::vector _queue; - ASDN::Mutex _lock; -} - - (void)dealloc { ASDisplayNodeFailAssert(@"Singleton should not dealloc."); diff --git a/examples/CatDealsCollectionView/Sample/AppDelegate.m b/examples/CatDealsCollectionView/Sample/AppDelegate.m index d626041192..447ff93b88 100644 --- a/examples/CatDealsCollectionView/Sample/AppDelegate.m +++ b/examples/CatDealsCollectionView/Sample/AppDelegate.m @@ -47,14 +47,3 @@ } @end - -@implementation ASConfiguration (UserProvided) - -+ (ASConfiguration *)textureConfiguration -{ - ASConfiguration *cfg = [[ASConfiguration alloc] init]; - cfg.experimentalFeatures = ASExperimentalDeallocQueue; - return cfg; -} - -@end From 9588692361bde617e8c6249d56cab0ca36039b92 Mon Sep 17 00:00:00 2001 From: Michael Zuccarino Date: Wed, 3 Oct 2018 14:49:15 -0700 Subject: [PATCH 95/97] Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver (#1157) * Simpler Huy fix for more efficient delayed flattening of the layout tree * Nit * Remove pbx changes * Update CHANGELOG.md * Add note about change in timing of _flattenedLayout capture --- CHANGELOG.md | 1 + Source/ASDisplayNode+Layout.mm | 12 ------------ Source/ASDisplayNode.mm | 8 ++++---- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bb3646171..3701bce941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler) - Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki) - Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler) +- Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver. [Michael Zuccarino](https://github.com/mikezucc) [#1157](https://github.com/TextureGroup/Texture/pull/1157) ## 2.7 - Fix pager node for interface coalescing. [Max Wang](https://github.com/wsdwsd0829) [#877](https://github.com/TextureGroup/Texture/pull/877) diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index fe1df8fc62..866f661875 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -993,12 +993,6 @@ ASLayoutElementStyleExtensibilityForwarding _pendingLayoutTransition = nil; } -- (void)_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout -{ - ASDN::MutexLocker l(__instanceLock__); - [self _locked_setCalculatedDisplayNodeLayout:displayNodeLayout]; -} - - (void)_locked_setCalculatedDisplayNodeLayout:(const ASDisplayNodeLayout &)displayNodeLayout { ASAssertLocked(__instanceLock__); @@ -1007,12 +1001,6 @@ ASLayoutElementStyleExtensibilityForwarding ASDisplayNodeAssertTrue(displayNodeLayout.layout.size.height >= 0.0); _calculatedDisplayNodeLayout = displayNodeLayout; - - // Flatten the layout if it wasn't done before (@see -calculateLayoutThatFits:). - if ([ASDisplayNode shouldStoreUnflattenedLayouts]) { - _unflattenedLayout = _calculatedDisplayNodeLayout.layout; - _calculatedDisplayNodeLayout.layout = [_unflattenedLayout filteredNodeLayoutTree]; - } } @end diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index deddfe4a2d..d9d6a66b51 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -1220,11 +1220,11 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); } ASDisplayNodeLogEvent(self, @"computedLayout: %@", layout); - // Return the (original) unflattened layout if it needs to be stored. The layout will be flattened later on (@see _locked_setCalculatedDisplayNodeLayout:). - // Otherwise, flatten it right away. - if (! [ASDisplayNode shouldStoreUnflattenedLayouts]) { - layout = [layout filteredNodeLayoutTree]; + // PR #1157: Reduces accuracy of _unflattenedLayout for debugging/Weaver + if ([ASDisplayNode shouldStoreUnflattenedLayouts]) { + _unflattenedLayout = layout; } + layout = [layout filteredNodeLayoutTree]; return layout; } From e70325563a24160f9ef6f86786ebfa12f690e750 Mon Sep 17 00:00:00 2001 From: Huy Nguyen Date: Wed, 3 Oct 2018 16:14:01 -0700 Subject: [PATCH 96/97] Only clear ASCollectionView's data during deallocation (#1154) This is a follow up on #1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause. Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway. --- CHANGELOG.md | 1 + Schemas/configuration.json | 3 ++- Source/ASCollectionView.mm | 2 +- Source/ASExperimentalFeatures.h | 2 +- Source/ASExperimentalFeatures.m | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3701bce941..85b2f08433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ - Optimize layout process by removing `ASRectMap`. [Adlai Holler](https://github.com/Adlai-Holler) - Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode. [Michael Schneider](https://github.com/maicki) - Remove display node's reliance on shared_ptr. [Adlai Holler](https://github.com/Adlai-Holler) +- [ASCollectionView] Fix a crash that is caused by clearing a collection view's data while it's still being used. [Huy Nguyen](https://github.com/nguyenhuy) [#1154](https://github.com/TextureGroup/Texture/pull/1154) - Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver. [Michael Zuccarino](https://github.com/mikezucc) [#1157](https://github.com/TextureGroup/Texture/pull/1157) ## 2.7 diff --git a/Schemas/configuration.json b/Schemas/configuration.json index 29c4375a41..33b1f43c35 100644 --- a/Schemas/configuration.json +++ b/Schemas/configuration.json @@ -21,7 +21,8 @@ "exp_network_image_queue", "exp_dealloc_queue_v2", "exp_collection_teardown", - "exp_framesetter_cache" + "exp_framesetter_cache", + "exp_clear_data_during_deallocation" ] } } diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 94406b0eee..0c36204a0c 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -577,7 +577,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; { ASDisplayNodeAssertMainThread(); - if (_asyncDataSource == nil && _asyncDelegate == nil && !ASActivateExperimentalFeature(ASExperimentalSkipClearData)) { + if (_asyncDataSource == nil && _asyncDelegate == nil && _isDeallocating && ASActivateExperimentalFeature(ASExperimentalClearDataDuringDeallocation)) { [_dataController clearData]; } } diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 2af937d663..626975636c 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -23,7 +23,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalNetworkImageQueue = 1 << 5, // exp_network_image_queue ASExperimentalCollectionTeardown = 1 << 6, // exp_collection_teardown ASExperimentalFramesetterCache = 1 << 7, // exp_framesetter_cache - ASExperimentalSkipClearData = 1 << 8, // exp_skip_clear_data + ASExperimentalClearDataDuringDeallocation = 1 << 8, // exp_clear_data_during_deallocation ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index b5751c8737..73abea48b6 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -21,7 +21,7 @@ NSArray *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags @"exp_dealloc_queue_v2", @"exp_collection_teardown", @"exp_framesetter_cache", - @"exp_skip_clear_data"])); + @"exp_clear_data_during_deallocation"])); if (flags == ASExperimentalFeatureAll) { return allNames; From 565da7d4935740d12fc204aa061faf093831da1e Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Thu, 4 Oct 2018 09:33:08 -0700 Subject: [PATCH 97/97] Add missing NS_NOESCAPE in overwritten methods (#1139) Fixes -Wmissing-noescape warnings --- Source/ASCollectionNode.mm | 4 ++-- Source/ASCollectionView.mm | 4 ++-- Source/ASImageNode.mm | 2 +- Source/ASTableNode.mm | 4 ++-- Source/ASTextNode.mm | 2 +- Source/ASTextNode2.mm | 2 +- Source/TextKit/ASTextKitContext.mm | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/ASCollectionNode.mm b/Source/ASCollectionNode.mm index bf854b0466..ba31b41ca2 100644 --- a/Source/ASCollectionNode.mm +++ b/Source/ASCollectionNode.mm @@ -820,7 +820,7 @@ [self.view registerSupplementaryNodeOfKind:elementKind]; } -- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { ASDisplayNodeAssertMainThread(); if (self.nodeLoaded) { @@ -835,7 +835,7 @@ } } -- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { [self performBatchAnimated:UIView.areAnimationsEnabled updates:updates completion:completion]; } diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 0c36204a0c..62380e4891 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -921,7 +921,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; } } -- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { ASDisplayNodeAssertMainThread(); [self beginUpdates]; @@ -936,7 +936,7 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier"; [self endUpdatesAnimated:animated completion:completion]; } -- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { // We capture the current state of whether animations are enabled if they don't provide us with one. [self performBatchAnimated:[UIView areAnimationsEnabled] updates:updates completion:completion]; diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index f30257a6b9..d5739f1a49 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -323,7 +323,7 @@ typedef void (^ASImageNodeDrawParametersBlock)(ASWeakMapEntry *entry); return drawParameters; } -+ (UIImage *)displayWithParameters:(id)parameter isCancelled:(asdisplaynode_iscancelled_block_t)isCancelled ++ (UIImage *)displayWithParameters:(id)parameter isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelled { ASImageNodeDrawParameters *drawParameter = (ASImageNodeDrawParameters *)parameter; diff --git a/Source/ASTableNode.mm b/Source/ASTableNode.mm index cbcb54f77a..4ac85989c6 100644 --- a/Source/ASTableNode.mm +++ b/Source/ASTableNode.mm @@ -729,7 +729,7 @@ ASLayoutElementCollectionTableSetTraitCollection(_environmentStateLock) [self.view relayoutItems]; } -- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { ASDisplayNodeAssertMainThread(); if (self.nodeLoaded) { @@ -746,7 +746,7 @@ ASLayoutElementCollectionTableSetTraitCollection(_environmentStateLock) } } -- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion +- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion { [self performBatchAnimated:YES updates:updates completion:completion]; } diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index 01819de417..1de1117dd9 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -501,7 +501,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; textContainerInsets:_textContainerInset]; } -+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing ++ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing { ASTextNodeDrawParameter *drawParameter = (ASTextNodeDrawParameter *)parameters; UIColor *backgroundColor = (isRasterizing || drawParameter == nil) ? nil : drawParameter->_backgroundColor; diff --git a/Source/ASTextNode2.mm b/Source/ASTextNode2.mm index 813326bddf..aaa215e672 100644 --- a/Source/ASTextNode2.mm +++ b/Source/ASTextNode2.mm @@ -465,7 +465,7 @@ static NSArray *DefaultLinkAttributeNames = @[ NSLinkAttributeName ]; return layout; } -+ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)layoutDict isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing ++ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)layoutDict isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing { ASTextContainer *container = layoutDict[@"container"]; NSAttributedString *text = layoutDict[@"text"]; diff --git a/Source/TextKit/ASTextKitContext.mm b/Source/TextKit/ASTextKitContext.mm index 012619c2ec..0995a66f66 100644 --- a/Source/TextKit/ASTextKitContext.mm +++ b/Source/TextKit/ASTextKitContext.mm @@ -62,9 +62,9 @@ return self; } -- (void)performBlockWithLockedTextKitComponents:(void (^)(NSLayoutManager *, - NSTextStorage *, - NSTextContainer *))block +- (void)performBlockWithLockedTextKitComponents:(NS_NOESCAPE void (^)(NSLayoutManager *, + NSTextStorage *, + NSTextContainer *))block { ASDN::MutexSharedLocker l(__instanceLock__); if (block) {