Skip to content

Commit

Permalink
Shuffle & Cleanup Stuff (#3080)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai Holler authored Feb 27, 2017
1 parent e48edef commit 73ca6ab
Show file tree
Hide file tree
Showing 595 changed files with 181 additions and 225 deletions.
20 changes: 10 additions & 10 deletions AsyncDisplayKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ Pod::Spec.new do |spec|

# Subspecs
spec.subspec 'Core' do |core|
core.prefix_header_file = 'AsyncDisplayKit/AsyncDisplayKit-Prefix.pch'
core.prefix_header_file = 'Source/AsyncDisplayKit-Prefix.pch'
core.public_header_files = [
'AsyncDisplayKit/*.h',
'AsyncDisplayKit/Details/**/*.h',
'AsyncDisplayKit/Layout/**/*.h',
'Base/*.h',
'AsyncDisplayKit/Debug/ASLayoutElementInspectorNode.h',
'AsyncDisplayKit/TextKit/ASTextNodeTypes.h',
'AsyncDisplayKit/TextKit/ASTextKitComponents.h'
'Source/*.h',
'Source/Details/**/*.h',
'Source/Layout/**/*.h',
'Source/Base/*.h',
'Source/Debug/AsyncDisplayKit+Debug.h',
'Source/TextKit/ASTextNodeTypes.h',
'Source/TextKit/ASTextKitComponents.h'
]

core.source_files = [
'AsyncDisplayKit/**/*.{h,m,mm}',
'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
'AsyncDisplayKit/TextKit/*.h',
'Source/TextKit/*.h',
]
core.xcconfig = { 'GCC_PRECOMPILE_PREFIX_HEADER' => 'YES' }
end
Expand Down
164 changes: 77 additions & 87 deletions AsyncDisplayKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<EnvironmentVariables>
<EnvironmentVariable
key = "FB_REFERENCE_IMAGE_DIR"
value = "$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages"
value = "$(SOURCE_ROOT)/Tests/ReferenceImages"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
Expand Down
Binary file removed ...StackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed .../ASStackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...LayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...ayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...SStackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...tackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...ASStackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...ayoutSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...youtSpecSnapshotTests/[email protected]
Binary file not shown.
Binary file removed ...StackLayoutSpecSnapshotTests/[email protected]
Binary file not shown.
55 changes: 28 additions & 27 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ COMMON_LANG_PREPROCESSOR_FLAGS = {
COMMON_LINKER_FLAGS = ['-ObjC++']

ASYNCDISPLAYKIT_EXPORTED_HEADERS = glob([
'AsyncDisplayKit/*.h',
'AsyncDisplayKit/Details/**/*.h',
'AsyncDisplayKit/Layout/*.h',
'Base/*.h',
'AsyncDisplayKit/Debug/ASLayoutElementInspectorNode.h',
'Source/*.h',
'Source/Details/**/*.h',
'Source/Layout/*.h',
'Source/Base/*.h',
'Source/Debug/AsyncDisplayKit+Debug.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
'AsyncDisplayKit/TextKit/ASTextNodeTypes.h',
'AsyncDisplayKit/TextKit/ASTextKitComponents.h'
'Source/TextKit/ASTextNodeTypes.h',
'Source/TextKit/ASTextKitComponents.h'
])

ASYNCDISPLAYKIT_PRIVATE_HEADERS = glob([
'AsyncDisplayKit/**/*.h'
'Source/**/*.h'
],
excludes = ASYNCDISPLAYKIT_EXPORTED_HEADERS,
)
Expand All @@ -42,14 +42,14 @@ def asyncdisplaykit_library(

apple_library(
name = name,
prefix_header = 'AsyncDisplayKit/AsyncDisplayKit-Prefix.pch',
header_path_prefix = 'AsyncDisplayKit',
prefix_header = 'Source/AsyncDisplayKit-Prefix.pch',
header_path_prefix = 'Source',
exported_headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS,
headers = ASYNCDISPLAYKIT_PRIVATE_HEADERS,
srcs = glob([
'AsyncDisplayKit/**/*.m',
'AsyncDisplayKit/**/*.mm',
'Base/*.m'
'Source/**/*.m',
'Source/**/*.mm',
'Source/Base/*.m'
]),
preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + additional_preprocessor_flags,
lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS,
Expand All @@ -58,12 +58,13 @@ def asyncdisplaykit_library(
'Photos',
'-weak_framework',
'MapKit',
'-weak_framework',
'AssetsLibrary',
],
deps = deps,
frameworks = [
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
'$SDKROOT/System/Library/Frameworks/AssetsLibrary.framework',

'$SDKROOT/System/Library/Frameworks/QuartzCore.framework',
'$SDKROOT/System/Library/Frameworks/CoreMedia.framework',
Expand Down Expand Up @@ -109,7 +110,7 @@ apple_bundle(
name = 'TestHost',
binary = ':TestHostBinary',
extension = 'app',
info_plist = 'AsyncDisplayKitTestHost/Info.plist',
info_plist = 'Tests/TestHost/Info.plist',
info_plist_substitutions = {
'PRODUCT_BUNDLE_IDENTIFIER': 'com.facebook.AsyncDisplayKitTestHost',
},
Expand All @@ -118,10 +119,10 @@ apple_bundle(

apple_binary(
name = 'TestHostBinary',
headers = glob(['AsyncDisplayKitTestHost/*.h']),
headers = glob(['Tests/TestHost/*.h']),
srcs = glob([
'AsyncDisplayKitTestHost/*.m',
'AsyncDisplayKitTestHost/*.mm',
'Tests/TestHost/*.m',
'Tests/TestHost/*.mm',
]),
lang_preprocessor_flags = COMMON_LANG_PREPROCESSOR_FLAGS,
linker_flags = COMMON_LINKER_FLAGS,
Expand All @@ -145,30 +146,30 @@ apple_package(
#####################################
apple_resource(
name = 'TestsResources',
files = ['AsyncDisplayKitTests/en.lproj/InfoPlist.strings'],
dirs = ['AsyncDisplayKitTests/TestResources'],
files = ['Tests/en.lproj/InfoPlist.strings'],
dirs = ['Tests/TestResources'],
)

apple_test(
name = 'Tests',
test_host_app = ':TestHost',
info_plist = 'AsyncDisplayKitTests/AsyncDisplayKitTests-Info.plist',
info_plist = 'Tests/AsyncDisplayKitTests-Info.plist',
info_plist_substitutions = {
'PRODUCT_BUNDLE_IDENTIFIER': 'com.facebook.AsyncDisplayKitTests',
},
prefix_header = 'AsyncDisplayKitTests/AsyncDisplayKitTests-Prefix.pch',
prefix_header = 'Tests/AsyncDisplayKitTests-Prefix.pch',
# Expose all ASDK headers to tests
headers = ASYNCDISPLAYKIT_EXPORTED_HEADERS + ASYNCDISPLAYKIT_PRIVATE_HEADERS + glob([
'AsyncDisplayKitTests/*.h',
'Tests/*.h',
]),
srcs = glob([
'AsyncDisplayKitTests/*.m',
'AsyncDisplayKitTests/*.mm'
'Tests/*.m',
'Tests/*.mm'
],
# ASTextNodePerformanceTests are excluded (#2173)
excludes = ['AsyncDisplayKitTests/ASTextNodePerformanceTests.m*']
excludes = ['Tests/ASTextNodePerformanceTests.m*']
),
snapshot_reference_images_path='AsyncDisplayKitTests/ReferenceImages',
snapshot_reference_images_path='Tests/ReferenceImages',
preprocessor_flags = COMMON_PREPROCESSOR_FLAGS + [
'-Wno-implicit-function-declaration',
],
Expand Down
Binary file removed [email protected]
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import <AsyncDisplayKit/ASDisplayNode.h>
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
#import <AsyncDisplayKit/ASCollectionView.h>
#import <AsyncDisplayKit/ASBlockTypes.h>

@protocol ASCollectionViewLayoutFacilitatorProtocol;
@protocol ASCollectionDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#import <AsyncDisplayKit/ASDataController.h>
#import <AsyncDisplayKit/ASCollectionView+Undeprecated.h>
#import <AsyncDisplayKit/ASThread.h>
#import <AsyncDisplayKit/ASRangeController.h>

#pragma mark - _ASCollectionPendingState

Expand All @@ -44,7 +45,7 @@ - (instancetype)init
{
self = [super init];
if (self) {
_rangeMode = ASLayoutRangeModeCount;
_rangeMode = ASLayoutRangeModeUnspecified;
_allowsSelection = YES;
_allowsMultipleSelection = NO;
_inverted = NO;
Expand All @@ -64,7 +65,7 @@ - (instancetype)init
self = [super init];
if (self) {
_tuningParameters = std::vector<std::vector<ASRangeTuningParameters>> (ASLayoutRangeModeCount, std::vector<ASRangeTuningParameters> (ASLayoutRangeTypeCount));
_rangeMode = ASLayoutRangeModeCount;
_rangeMode = ASLayoutRangeModeUnspecified;
}
return self;
}
Expand Down Expand Up @@ -158,7 +159,7 @@ - (void)didLoad
view.allowsSelection = pendingState.allowsSelection;
view.allowsMultipleSelection = pendingState.allowsMultipleSelection;

if (pendingState.rangeMode != ASLayoutRangeModeCount) {
if (pendingState.rangeMode != ASLayoutRangeModeUnspecified) {
[view.rangeController updateCurrentRangeWithMode:pendingState.rangeMode];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

#import <UIKit/UIKit.h>

#import <AsyncDisplayKit/ASRangeController.h>
#import <AsyncDisplayKit/ASCollectionViewProtocols.h>
#import <AsyncDisplayKit/ASBaseDefines.h>
#import <AsyncDisplayKit/ASBatchContext.h>
#import <AsyncDisplayKit/ASDimension.h>
#import <AsyncDisplayKit/ASLayoutRangeType.h>
#import <AsyncDisplayKit/ASScrollDirection.h>

@class ASCellNode;
@class ASCollectionNode;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions AsyncDisplayKit/ASTableNode.mm → Source/ASTableNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#import <AsyncDisplayKit/ASTableView+Undeprecated.h>
#import <AsyncDisplayKit/ASThread.h>
#import <AsyncDisplayKit/ASDisplayNode+Beta.h>
#import <AsyncDisplayKit/ASRangeController.h>

#pragma mark - _ASTablePendingState

Expand All @@ -41,7 +42,7 @@ - (instancetype)init
{
self = [super init];
if (self) {
_rangeMode = ASLayoutRangeModeCount;
_rangeMode = ASLayoutRangeModeUnspecified;
_allowsSelection = YES;
_allowsSelectionDuringEditing = NO;
_allowsMultipleSelection = NO;
Expand Down Expand Up @@ -126,7 +127,7 @@ - (void)didLoad
view.allowsSelectionDuringEditing = pendingState.allowsSelectionDuringEditing;
view.allowsMultipleSelection = pendingState.allowsMultipleSelection;
view.allowsMultipleSelectionDuringEditing = pendingState.allowsMultipleSelectionDuringEditing;
if (pendingState.rangeMode != ASLayoutRangeModeCount) {
if (pendingState.rangeMode != ASLayoutRangeModeUnspecified) {
[view.rangeController updateCurrentRangeWithMode:pendingState.rangeMode];
}
}
Expand Down
1 change: 0 additions & 1 deletion AsyncDisplayKit/ASTableView.h → Source/ASTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#import <UIKit/UIKit.h>

#import <AsyncDisplayKit/ASBaseDefines.h>
#import <AsyncDisplayKit/ASLayoutController.h>
#import <AsyncDisplayKit/ASLayoutRangeType.h>
#import <AsyncDisplayKit/ASTableViewProtocols.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#import <AsyncDisplayKit/ASTextNodeTypes.h>
#import <AsyncDisplayKit/ASAvailability.h>
#import <AsyncDisplayKit/ASBlockTypes.h>
#import <AsyncDisplayKit/ASCollectionViewLayoutController.h>
#import <AsyncDisplayKit/ASContextTransitioning.h>
#import <AsyncDisplayKit/ASControlNode+Subclasses.h>
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
// of patent rights can be found in the PATENTS file in the same directory.
//

#import <AsyncDisplayKit/ASDisplayNode.h>
#import <AsyncDisplayKit/ASControlNode.h>
#import <AsyncDisplayKit/ASImageNode.h>
#import <AsyncDisplayKit/ASRangeController.h>

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -25,8 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
* as well as upscaling (such as providing a URL not suitable for a Retina device). For dev purposes only.
* @param enabled Specify YES to show the label on all ASImageNodes with non-1.0x source-to-bounds pixel ratio.
*/
+ (void)setShouldShowImageScalingOverlay:(BOOL)show;
+ (BOOL)shouldShowImageScalingOverlay;
@property (class, nonatomic) BOOL shouldShowImageScalingOverlay;

@end

Expand All @@ -41,33 +38,19 @@ NS_ASSUME_NONNULL_BEGIN
* overlay rect, but can't be visualized).
* @param enable Specify YES to make this debug feature enabled when messaging the ASControlNode class.
*/
+ (void)setEnableHitTestDebug:(BOOL)enable;
+ (BOOL)enableHitTestDebug;
@property (class, nonatomic) BOOL enableHitTestDebug;

@end

@interface ASRangeController (Debugging)
@interface ASDisplayNode (RangeDebugging)

/**
* Class method to enable a visualization overlay of the all ASRangeController's tuning parameters. For dev purposes only.
* To use, message ASRangeController in the AppDelegate --> [ASRangeController setShouldShowRangeDebugOverlay:YES];
* @param enable Specify YES to make this debug feature enabled when messaging the ASRangeController class.
* Enable a visualization overlay of the all table/collection tuning parameters. For dev purposes only.
* To use, set this in the AppDelegate --> ASDisplayNode.shouldShowRangeDebugOverlay = YES
*/
+ (void)setShouldShowRangeDebugOverlay:(BOOL)show;
+ (BOOL)shouldShowRangeDebugOverlay;

+ (void)layoutDebugOverlayIfNeeded;

- (void)addRangeControllerToRangeDebugOverlay;

- (void)updateRangeController:(ASRangeController *)controller
withScrollableDirections:(ASScrollDirection)scrollableDirections
scrollDirection:(ASScrollDirection)direction
rangeMode:(ASLayoutRangeMode)mode
displayTuningParameters:(ASRangeTuningParameters)displayTuningParameters
preloadTuningParameters:(ASRangeTuningParameters)preloadTuningParameters
interfaceState:(ASInterfaceState)interfaceState;
@property (class, nonatomic) BOOL shouldShowRangeDebugOverlay;

@end


NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ - (void)updateWithVisibleRatio:(CGFloat)visibleRatio

static BOOL __shouldShowRangeDebugOverlay = NO;

@implementation ASRangeController (Debugging)
@implementation ASDisplayNode (RangeDebugging)

+ (void)setShouldShowRangeDebugOverlay:(BOOL)show
{
Expand All @@ -253,6 +253,10 @@ + (BOOL)shouldShowRangeDebugOverlay
return __shouldShowRangeDebugOverlay;
}

@end

@implementation ASRangeController (DebugInternal)

+ (void)layoutDebugOverlayIfNeeded
{
[[_ASRangeDebugOverlayView sharedInstance] setNeedsLayout];
Expand Down Expand Up @@ -306,7 +310,7 @@ + (instancetype)sharedInstance
{
static _ASRangeDebugOverlayView *__rangeDebugOverlay = nil;

if (!__rangeDebugOverlay && [ASRangeController shouldShowRangeDebugOverlay]) {
if (!__rangeDebugOverlay && ASDisplayNode.shouldShowRangeDebugOverlay) {
__rangeDebugOverlay = [[self alloc] initWithFrame:CGRectZero];
[[self keyWindow] addSubview:__rangeDebugOverlay];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ NS_ASSUME_NONNULL_BEGIN

ASDISPLAYNODE_EXTERN_C_BEGIN

FOUNDATION_EXPORT ASRangeTuningParameters const ASRangeTuningParametersZero;

FOUNDATION_EXPORT BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningParameters lhs, ASRangeTuningParameters rhs);

FOUNDATION_EXPORT ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);

FOUNDATION_EXPORT ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASScrollDirection scrollDirection, ASRangeTuningParameters rangeTuningParameters);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN

@class ASCollectionView;

AS_SUBCLASSING_RESTRICTED
@interface ASCollectionViewLayoutController : ASAbstractLayoutController

- (instancetype)initWithCollectionView:(ASCollectionView *)collectionView;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ NS_ASSUME_NONNULL_BEGIN

ASDISPLAYNODE_EXTERN_C_BEGIN

typedef struct {
CGFloat leadingBufferScreenfuls;
CGFloat trailingBufferScreenfuls;
} ASRangeTuningParameters;

struct ASDirectionalScreenfulBuffer {
CGFloat positiveDirection; // Positive relative to iOS Core Animation layer coordinate space.
CGFloat negativeDirection;
Expand Down
Loading

0 comments on commit 73ca6ab

Please sign in to comment.