mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
* Tidy the header imports, forward declaring classes and protocols where appropriate to avoid import cycles and using the framework/system header notation for imports occuring in .h files.
* Perhaps controversially, decomposing ASRangeControllerUpdateRangeProtocol+Beta.h such that the categories on various classes are defined in the classes themselves since that's where the implementation of those categories is provided. * Updating unit tests and import other headers the tests took for granted. The tests could probably import the umbrella header and not have to worry about this. * Updating the "Life without Cocoapods" sample to build and run dependent on ASDK as a static library. * Added a "Life With Frameworks" sample app to build and run dependent on ASDK as a framework, proving the framework targets work.
This commit is contained in:
@@ -10,9 +10,16 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import <UIKit/UICollectionView.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||
#import <AsyncDisplayKit/ASLayoutController.h>
|
||||
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
|
||||
#import <AsyncDisplayKit/ASCollectionView.h>
|
||||
|
||||
@protocol ASCollectionViewLayoutFacilitatorProtocol;
|
||||
@protocol ASCollectionDelegate;
|
||||
@protocol ASCollectionDataSource;
|
||||
@class ASCollectionView;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -104,4 +111,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@end
|
||||
|
||||
@interface ASCollectionNode (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASCollectionInternal.h"
|
||||
#import "ASCollectionViewLayoutFacilitatorProtocol.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASEnvironmentInternal.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASRangeControllerUpdateRangeProtocol+Beta.h"
|
||||
#import "ASCellNode+Internal.h"
|
||||
#include <vector>
|
||||
|
||||
@interface _ASCollectionPendingState : NSObject
|
||||
|
||||
@@ -14,13 +14,12 @@
|
||||
#import <AsyncDisplayKit/ASCollectionViewProtocols.h>
|
||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||
#import <AsyncDisplayKit/ASBatchContext.h>
|
||||
#import <AsyncDisplayKit/ASCollectionViewFlowLayoutInspector.h>
|
||||
#import <AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h>
|
||||
|
||||
@class ASCellNode;
|
||||
@class ASCollectionNode;
|
||||
@protocol ASCollectionDataSource;
|
||||
@protocol ASCollectionDelegate;
|
||||
@protocol ASCollectionViewLayoutInspecting;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#import "ASBatchFetching.h"
|
||||
#import "ASDelegateProxy.h"
|
||||
#import "ASCellNode+Internal.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASCollectionDataController.h"
|
||||
#import "ASCollectionViewLayoutController.h"
|
||||
#import "ASCollectionViewFlowLayoutInspector.h"
|
||||
@@ -22,8 +21,13 @@
|
||||
#import "ASDisplayNode+Beta.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "UICollectionViewLayout+ASConvenience.h"
|
||||
#import "ASRangeController.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASCollectionView.h"
|
||||
#import "ASRangeControllerUpdateRangeProtocol+Beta.h"
|
||||
#import "_ASDisplayLayer.h"
|
||||
#import "ASCollectionViewLayoutFacilitatorProtocol.h"
|
||||
|
||||
|
||||
static const NSUInteger kASCollectionViewAnimationNone = UITableViewRowAnimationNone;
|
||||
static const ASSizeRange kInvalidSizeRange = {CGSizeZero, CGSizeZero};
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#import "ASMapNode.h"
|
||||
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
|
||||
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASCenterLayoutSpec.h>
|
||||
#import <AsyncDisplayKit/ASThread.h>
|
||||
#import <AsyncDisplayKit/ASInternalHelpers.h>
|
||||
#import <AsyncDisplayKit/ASLayout.h>
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASDisplayNodeExtras.h"
|
||||
#import "ASInsetLayoutSpec.h"
|
||||
#import "ASCenterLayoutSpec.h"
|
||||
#import "ASThread.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASLayout.h"
|
||||
|
||||
@interface ASMapNode()
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASCollectionNode.h>
|
||||
#import <AsyncDisplayKit/ASDataController.h>
|
||||
|
||||
@class ASPagerNode;
|
||||
@class ASPagerFlowLayout;
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#import "ASDelegateProxy.h"
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASPagerFlowLayout.h"
|
||||
#import "ASCollectionView.h"
|
||||
#import "ASCollectionViewProtocols.h"
|
||||
#import "UICollectionViewLayout+ASConvenience.h"
|
||||
|
||||
@interface ASPagerNode () <ASCollectionDataSource, ASCollectionViewDelegateFlowLayout, ASDelegateProxyInterceptor>
|
||||
|
||||
@@ -10,7 +10,13 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/ASTableView.h>
|
||||
#import <UIKit/UITableView.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
|
||||
|
||||
@protocol ASTableDataSource;
|
||||
@protocol ASTableDelegate;
|
||||
@class ASTableView;
|
||||
|
||||
/**
|
||||
* ASTableNode is a node based class that wraps an ASTableView. It can be used
|
||||
@@ -28,3 +34,7 @@
|
||||
@property (weak, nonatomic) id <ASTableDataSource> dataSource;
|
||||
|
||||
@end
|
||||
|
||||
@interface ASTableNode (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
@end
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASRangeControllerUpdateRangeProtocol+Beta.h"
|
||||
#import "ASTableViewInternal.h"
|
||||
#import "ASCellNode+Internal.h"
|
||||
#import "ASTableNode.h"
|
||||
|
||||
@interface _ASTablePendingState : NSObject
|
||||
@property (weak, nonatomic) id <ASTableDelegate> delegate;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#import "ASRangeController.h"
|
||||
#import "ASRangeControllerUpdateRangeProtocol+Beta.h"
|
||||
#import "_ASDisplayLayer.h"
|
||||
#import "ASTableNode.h"
|
||||
|
||||
#import <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
|
||||
@@ -10,9 +10,11 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASTableNode.h"
|
||||
#import <AsyncDisplayKit/ASTableView.h>
|
||||
|
||||
@class ASDataController;
|
||||
@class ASTableNode;
|
||||
@class ASRangeController;
|
||||
|
||||
@interface ASTableView (Internal)
|
||||
|
||||
|
||||
@@ -8,8 +8,14 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
#if TARGET_OS_IOS
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "ASDisplayNode+Subclasses.h"
|
||||
#import "ASVideoNode.h"
|
||||
#import "ASDefaultPlayButton.h"
|
||||
#import "ASEqualityHelpers.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASDisplayNodeExtras.h"
|
||||
#import "ASThread.h"
|
||||
|
||||
static BOOL ASAssetIsEqual(AVAsset *asset1, AVAsset *asset2) {
|
||||
return ASObjectIsEqual(asset1, asset2)
|
||||
|
||||
@@ -74,4 +74,11 @@ typedef ASTraitCollection * _Nonnull (^ASDisplayTraitsForTraitWindowSizeBlock)(C
|
||||
|
||||
@end
|
||||
|
||||
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
|
||||
|
||||
/// Automatically adjust range mode based on view events if the containing node confirms to the ASRangeControllerUpdateRangeProtocol
|
||||
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -20,6 +20,7 @@
|
||||
#import <AsyncDisplayKit/ASEditableTextNode.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASBasicImageDownloader.h>
|
||||
#import <AsyncDisplayKit/ASPINRemoteImageDownloader.h>
|
||||
#import <AsyncDisplayKit/ASMultiplexImageNode.h>
|
||||
#import <AsyncDisplayKit/ASNetworkImageNode.h>
|
||||
#import <AsyncDisplayKit/ASPhotosFrameworkImageRequest.h>
|
||||
@@ -28,6 +29,8 @@
|
||||
#import <AsyncDisplayKit/ASTableNode.h>
|
||||
#import <AsyncDisplayKit/ASCollectionView.h>
|
||||
#import <AsyncDisplayKit/ASCollectionNode.h>
|
||||
#import <AsyncDisplayKit/ASCollectionViewFlowLayoutInspector.h>
|
||||
#import <AsyncDisplayKit/ASCollectionViewLayoutFacilitatorProtocol.h>
|
||||
#import <AsyncDisplayKit/ASCellNode.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASScrollNode.h>
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASCollectionView.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASDataController.h"
|
||||
#import "ASRangeController.h"
|
||||
#import <AsyncDisplayKit/ASCollectionView.h>
|
||||
|
||||
@protocol ASCollectionViewLayoutFacilitatorProtocol;
|
||||
@class ASCollectionNode;
|
||||
@class ASDataController;
|
||||
@class ASRangeController;
|
||||
|
||||
@interface ASCollectionView ()
|
||||
- (instancetype)_initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout layoutFacilitator:(id<ASCollectionViewLayoutFacilitatorProtocol>)layoutFacilitator ownedByNode:(BOOL)ownedByNode;
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "ASDimension.h"
|
||||
#import "ASStackLayoutDefines.h"
|
||||
#import "ASRelativeSize.h"
|
||||
#import <AsyncDisplayKit/ASDimension.h>
|
||||
#import <AsyncDisplayKit/ASStackLayoutDefines.h>
|
||||
#import <AsyncDisplayKit/ASRelativeSize.h>
|
||||
|
||||
@protocol ASEnvironment;
|
||||
@class UITraitCollection;
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASEnvironment.h"
|
||||
#import "ASEnvironmentInternal.h"
|
||||
#import <AsyncDisplayKit/ASAvailability.h>
|
||||
#import "ASAvailability.h"
|
||||
|
||||
ASEnvironmentLayoutOptionsState _ASEnvironmentLayoutOptionsStateMakeDefault()
|
||||
{
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <AsyncDisplayKit/ASCellNode.h>
|
||||
#import <AsyncDisplayKit/ASDisplayNode.h>
|
||||
#import <AsyncDisplayKit/ASDataController.h>
|
||||
#import <AsyncDisplayKit/ASLayoutController.h>
|
||||
#import <AsyncDisplayKit/ASLayoutRangeType.h>
|
||||
#import <AsyncDisplayKit/ASRangeControllerUpdateRangeProtocol+Beta.h>
|
||||
|
||||
#define ASRangeControllerLoggingEnabled 0
|
||||
|
||||
@@ -203,4 +203,23 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@end
|
||||
|
||||
@interface ASRangeController (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
/**
|
||||
* Update the range mode for a range controller to a explicitly set mode until the node that contains the range
|
||||
* controller becomes visible again
|
||||
*
|
||||
* Logic for the automatic range mode:
|
||||
* 1. If there are no visible node paths available nothing is to be done and no range update will happen
|
||||
* 2. The initial range update if the range controller is visible always will be ASLayoutRangeModeCount
|
||||
* (ASLayoutRangeModeMinimum) as it's the initial fetch
|
||||
* 3. The range mode set explicitly via updateCurrentRangeWithMode: will last at least one range update. After that it
|
||||
the range controller will use the explicit set range mode until it becomes visible and a new range update was
|
||||
triggered or a new range mode via updateCurrentRangeWithMode: is set
|
||||
* 4. If range mode is not explicitly set the range mode is variying based if the range controller is visible or not
|
||||
*/
|
||||
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -17,6 +17,7 @@
|
||||
#import "ASMultiDimensionalArrayUtils.h"
|
||||
#import "ASInternalHelpers.h"
|
||||
#import "ASDisplayNode+FrameworkPrivate.h"
|
||||
#import "ASCellNode.h"
|
||||
|
||||
@interface ASRangeController ()
|
||||
{
|
||||
|
||||
@@ -8,12 +8,7 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASLayoutRangeType.h"
|
||||
#import "ASViewController.h"
|
||||
#import "ASRangeController.h"
|
||||
#import "ASCollectionNode.h"
|
||||
#import "ASTableNode.h"
|
||||
|
||||
#import <AsyncDisplayKit/ASLayoutRangeType.h>
|
||||
|
||||
@protocol ASRangeControllerUpdateRangeProtocol <NSObject>
|
||||
|
||||
@@ -34,39 +29,9 @@
|
||||
@end
|
||||
|
||||
|
||||
@interface ASRangeController (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
/**
|
||||
* Update the range mode for a range controller to a explicitly set mode until the node that contains the range
|
||||
* controller becomes visible again
|
||||
*
|
||||
* Logic for the automatic range mode:
|
||||
* 1. If there are no visible node paths available nothing is to be done and no range update will happen
|
||||
* 2. The initial range update if the range controller is visible always will be ASLayoutRangeModeCount
|
||||
* (ASLayoutRangeModeMinimum) as it's the initial fetch
|
||||
* 3. The range mode set explicitly via updateCurrentRangeWithMode: will last at least one range update. After that it
|
||||
the range controller will use the explicit set range mode until it becomes visible and a new range update was
|
||||
triggered or a new range mode via updateCurrentRangeWithMode: is set
|
||||
* 4. If range mode is not explicitly set the range mode is variying based if the range controller is visible or not
|
||||
*/
|
||||
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface ASCollectionNode (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface ASTableNode (ASRangeControllerUpdateRangeProtocol) <ASRangeControllerUpdateRangeProtocol>
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface ASViewController (ASRangeControllerUpdateRangeProtocol)
|
||||
|
||||
/// Automatically adjust range mode based on view events if the containing node confirms to the ASRangeControllerUpdateRangeProtocol
|
||||
@property (nonatomic, assign) BOOL automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
|
||||
@end
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import <AsyncDisplayKit/AsyncDisplayKit.h>
|
||||
#import <AsyncDisplayKit/ASButtonNode.h>
|
||||
|
||||
@interface ASDefaultPlayButton : ASButtonNode
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
//
|
||||
|
||||
#import "ASDefaultPlayButton.h"
|
||||
#import "_ASDisplayLayer.h"
|
||||
|
||||
@implementation ASDefaultPlayButton
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#import "ASDisplayNode.h"
|
||||
#import "ASSentinel.h"
|
||||
#import "ASThread.h"
|
||||
#import "_ASDisplayLayer.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
//
|
||||
|
||||
#import "ASEnvironment.h"
|
||||
#import <AsyncDisplayKit/ASEnvironment.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <CoreGraphics/CGBase.h>
|
||||
|
||||
#import "ASBaseDefines.h"
|
||||
#import <AsyncDisplayKit/ASBaseDefines.h>
|
||||
|
||||
ASDISPLAYNODE_EXTERN_C_BEGIN
|
||||
|
||||
|
||||
Reference in New Issue
Block a user