mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
This reverts commit 5c8818d107.
This commit is contained in:
@@ -125,9 +125,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASCollectionView (Deprecated)
|
||||
|
||||
@property (nonatomic, weak) id<UICollectionViewDelegate> delegate ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode.delegate instead. If you REALLY want to use this, cast to a UICollectionView but don't rely on the return value.");
|
||||
@property (nonatomic, weak) id<UICollectionViewDataSource> dataSource ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode.dataSource instead. If you REALLY want to use this, cast to a UICollectionView but don't rely on the return value.");
|
||||
|
||||
/**
|
||||
* The object that acts as the asynchronous delegate of the collection view
|
||||
*
|
||||
|
||||
@@ -367,10 +367,8 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
|
||||
|
||||
- (void)setDelegate:(id<UICollectionViewDelegate>)delegate
|
||||
{
|
||||
// The compiler will prevent users from calling this,
|
||||
// but we will automatically route to @c asyncDelegate
|
||||
// to support interop with frameworks like TLYShyNavBar.
|
||||
self.asyncDelegate = (id<ASCollectionDelegate>)delegate;
|
||||
// Our UIScrollView superclass sets its delegate to nil on dealloc. Only assert if we get a non-nil value here. We also allow this when we're doing interop.
|
||||
ASDisplayNodeAssert(_asyncDelegateFlags.interop || delegate == nil, @"ASCollectionView uses asyncDelegate, not UICollectionView's delegate property.");
|
||||
}
|
||||
|
||||
- (void)proxyTargetHasDeallocated:(ASDelegateProxy *)proxy
|
||||
|
||||
@@ -69,9 +69,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASTableView (Deprecated)
|
||||
|
||||
@property (nonatomic, weak) id<UITableViewDelegate> delegate ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode.delegate instead. If you REALLY want to use this, cast to UITableView but don't rely on the return value.");
|
||||
@property (nonatomic, weak) id<UITableViewDataSource> dataSource ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode.dataSource instead. If you REALLY want to use this, cast to UITableView but don't rely on the return value.");
|
||||
|
||||
@property (nonatomic, weak) id<ASTableDelegate> asyncDelegate ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode's .delegate property instead.");
|
||||
@property (nonatomic, weak) id<ASTableDataSource> asyncDataSource ASDISPLAYNODE_DEPRECATED_MSG("Use ASTableNode .dataSource property instead.");
|
||||
|
||||
|
||||
@@ -337,10 +337,8 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
|
||||
- (void)setDelegate:(id<UITableViewDelegate>)delegate
|
||||
{
|
||||
// The compiler will prevent users from calling this,
|
||||
// but we will automatically route to @c asyncDelegate
|
||||
// to support interop with frameworks like TLYShyNavBar.
|
||||
self.asyncDelegate = (id<ASTableDelegate>)delegate;
|
||||
// Our UIScrollView superclass sets its delegate to nil on dealloc. Only assert if we get a non-nil value here.
|
||||
ASDisplayNodeAssert(delegate == nil, @"ASTableView uses asyncDelegate, not UITableView's delegate property.");
|
||||
}
|
||||
|
||||
- (id<ASTableDataSource>)asyncDataSource
|
||||
@@ -357,7 +355,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
||||
// the (common) case of nilling the asyncDataSource in the ViewController's dealloc. In this case our _asyncDataSource
|
||||
// will return as nil (ARC magic) even though the _proxyDataSource still exists. It's really important to hold a strong
|
||||
// reference to the old dataSource in this case because calls to ASTableViewProxy will start failing and cause crashes.
|
||||
NS_VALID_UNTIL_END_OF_SCOPE id oldDataSource = super.dataSource;
|
||||
NS_VALID_UNTIL_END_OF_SCOPE id oldDataSource = self.dataSource;
|
||||
|
||||
if (asyncDataSource == nil) {
|
||||
_asyncDataSource = nil;
|
||||
|
||||
@@ -228,6 +228,17 @@ class MosaicCollectionViewLayoutInspector: NSObject, ASCollectionViewLayoutInspe
|
||||
return ASSizeRange.init(min: CGSize.zero, max: layout._headerSizeForSection(section: atIndexPath.section))
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the inspector for the number of supplementary sections in the collection view for the given kind.
|
||||
*/
|
||||
func collectionView(_ collectionView: ASCollectionView, numberOfSectionsForSupplementaryNodeOfKind kind: String) -> UInt {
|
||||
if (kind == UICollectionElementKindSectionHeader) {
|
||||
return UInt((collectionView.dataSource?.numberOfSections!(in: collectionView))!)
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Asks the inspector for the number of supplementary views for the given kind in the specified section.
|
||||
*/
|
||||
@@ -240,6 +251,6 @@ class MosaicCollectionViewLayoutInspector: NSObject, ASCollectionViewLayoutInspe
|
||||
}
|
||||
|
||||
func scrollableDirections() -> ASScrollDirection {
|
||||
return ASScrollDirectionVerticalDirections
|
||||
return ASScrollDirectionVerticalDirections;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user