Swiftgram/AsyncDisplayKit/Private/ASLayoutSpec+Private.h
Michael Schneider c90ed08d10 [ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)
* Use childrenMap directly to prevent creating an NSArray in ASDK for ASLayoutSpec children

* Add locking for parent property in ASLayoutSpec

* Remove unnecessary import

* Add newline

* Add NSFastEnumeration to ASEnvironment and ASDisplayNode / ASLayoutSpec

* Change NSMutableArray initializer to arrayWithCapacity:

* Move ASLayoutSpec+Private.h into Private folder

Fixes building with Swift

* Remove lock for ASLayoutSpec parent
2016-07-29 10:53:31 -07:00

26 lines
743 B
Objective-C

//
// ASLayoutSpec+Private.h
// AsyncDisplayKit
//
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
#import "ASLayoutSpec.h"
#import <objc/runtime.h>
#import <map>
typedef std::map<unsigned long, id<ASLayoutable>, std::less<unsigned long>> ASChildrenMap;
@interface ASLayoutSpec (Private)
/*
* Inside ASDK the childrenMap property should be preferred over the children array to prevent unecessary boxing
*/
@property (nonatomic, assign, readonly) ASChildrenMap childrenMap;
@end