mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[2.0] add helpful deprecation messages (#2437)
[2.0] add helpful deprecation messages
This commit is contained in:
@@ -145,7 +145,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* @param layout The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.
|
||||
*/
|
||||
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout ASDISPLAYNODE_DEPRECATED;
|
||||
- (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout ASDISPLAYNODE_DEPRECATED_MSG("Please use ASCollectionNode instead of ASCollectionView.");
|
||||
|
||||
/**
|
||||
* Initializes an ASCollectionView
|
||||
@@ -155,7 +155,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @param frame The frame rectangle for the collection view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This frame is passed to the superclass during initialization.
|
||||
* @param layout The layout object to use for organizing items. The collection view stores a strong reference to the specified object. Must not be nil.
|
||||
*/
|
||||
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout ASDISPLAYNODE_DEPRECATED;
|
||||
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout ASDISPLAYNODE_DEPRECATED_MSG("Please use ASCollectionNode instead of ASCollectionView.");
|
||||
|
||||
/**
|
||||
* Tuning parameters for a range type in full mode.
|
||||
@@ -167,7 +167,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @see ASLayoutRangeMode
|
||||
* @see ASLayoutRangeType
|
||||
*/
|
||||
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED;
|
||||
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Set the tuning parameters for a range type in full mode.
|
||||
@@ -178,7 +178,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @see ASLayoutRangeMode
|
||||
* @see ASLayoutRangeType
|
||||
*/
|
||||
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Tuning parameters for a range type in the specified mode.
|
||||
@@ -191,7 +191,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @see ASLayoutRangeMode
|
||||
* @see ASLayoutRangeType
|
||||
*/
|
||||
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED;
|
||||
- (ASRangeTuningParameters)tuningParametersForRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Set the tuning parameters for a range type in the specified mode.
|
||||
@@ -203,7 +203,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @see ASLayoutRangeMode
|
||||
* @see ASLayoutRangeType
|
||||
*/
|
||||
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeMode:(ASLayoutRangeMode)rangeMode rangeType:(ASLayoutRangeType)rangeType ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Perform a batch of updates asynchronously, optionally disabling all animations in the batch. This method must be called from the main thread.
|
||||
@@ -215,7 +215,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
||||
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
||||
*/
|
||||
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)performBatchAnimated:(BOOL)animated updates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Perform a batch of updates asynchronously. This method must be called from the main thread.
|
||||
@@ -226,7 +226,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* Boolean parameter that contains the value YES if all of the related animations completed successfully or
|
||||
* NO if they were interrupted. This parameter may be nil. If supplied, the block is run on the main thread.
|
||||
*/
|
||||
- (void)performBatchUpdates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)performBatchUpdates:(nullable __attribute((noescape)) void (^)())updates completion:(nullable void (^)(BOOL finished))completion ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Reload everything from scratch, destroying the working range and all cached nodes.
|
||||
@@ -235,14 +235,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* the main thread.
|
||||
* @warning This method is substantially more expensive than UICollectionView's version.
|
||||
*/
|
||||
- (void)reloadDataWithCompletion:(nullable void (^)())completion ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)reloadDataWithCompletion:(nullable void (^)())completion ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Reload everything from scratch, destroying the working range and all cached nodes.
|
||||
*
|
||||
* @warning This method is substantially more expensive than UICollectionView's version.
|
||||
*/
|
||||
- (void)reloadData ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)reloadData ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.
|
||||
@@ -250,19 +250,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @warning This method is substantially more expensive than UICollectionView's version and will block the main thread
|
||||
* while all the cells load.
|
||||
*/
|
||||
- (void)reloadDataImmediately ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)reloadDataImmediately ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode's -reloadDataWithCompletion: followed by -waitUntilAllUpdatesAreCommitted instead.");
|
||||
|
||||
/**
|
||||
* Triggers a relayout of all nodes.
|
||||
*
|
||||
* @discussion This method invalidates and lays out every cell node in the collection.
|
||||
*/
|
||||
- (void)relayoutItems ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)relayoutItems ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.
|
||||
*/
|
||||
- (void)waitUntilAllUpdatesAreCommitted ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)waitUntilAllUpdatesAreCommitted ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Registers the given kind of supplementary node for use in creating node-backed supplementary views.
|
||||
@@ -274,7 +274,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* methods. This method will register an internal backing view that will host the contents of the supplementary nodes
|
||||
* returned from the data source.
|
||||
*/
|
||||
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)registerSupplementaryNodeOfKind:(NSString *)elementKind ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Inserts one or more sections.
|
||||
@@ -284,7 +284,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)insertSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)insertSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Deletes one or more sections.
|
||||
@@ -294,7 +294,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)deleteSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)deleteSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Reloads the specified sections.
|
||||
@@ -304,7 +304,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)reloadSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)reloadSections:(NSIndexSet *)sections ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Moves a section to a new location.
|
||||
@@ -316,7 +316,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Inserts items at the locations identified by an array of index paths.
|
||||
@@ -326,7 +326,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)insertItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Deletes the items specified by an array of index paths.
|
||||
@@ -336,7 +336,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)deleteItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Reloads the specified items.
|
||||
@@ -346,7 +346,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)reloadItemsAtIndexPaths:(NSArray<NSIndexPath *> *)indexPaths ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Moves the item at a specified location to a destination location.
|
||||
@@ -358,7 +358,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* @discussion This method must be called from the main thread. The asyncDataSource must be updated to reflect the changes
|
||||
* before this method is called.
|
||||
*/
|
||||
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath ASDISPLAYNODE_DEPRECATED;
|
||||
- (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Query the sized node at @c indexPath for its calculatedSize.
|
||||
@@ -367,14 +367,14 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*
|
||||
* This method is deprecated. Call @c calculatedSize on the node of interest instead. First deprecated in version 2.0.
|
||||
*/
|
||||
- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED;
|
||||
- (CGSize)calculatedSizeForNodeAtIndexPath:(NSIndexPath *)indexPath ASDISPLAYNODE_DEPRECATED_MSG("Call -calculatedSize on the node of interest instead.");
|
||||
|
||||
/**
|
||||
* Similar to -visibleCells.
|
||||
*
|
||||
* @return an array containing the nodes being displayed on screen.
|
||||
*/
|
||||
- (NSArray<__kindof ASCellNode *> *)visibleNodes AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED;
|
||||
- (NSArray<__kindof ASCellNode *> *)visibleNodes AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
/**
|
||||
* Similar to -indexPathForCell:.
|
||||
@@ -388,15 +388,15 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* for use with your data source and @c ASCollectionNode, call @c indexPathForNode: on the
|
||||
* collection node instead.
|
||||
*/
|
||||
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED;
|
||||
- (nullable NSIndexPath *)indexPathForNode:(ASCellNode *)cellNode AS_WARN_UNUSED_RESULT ASDISPLAYNODE_DEPRECATED_MSG("Use ASCollectionNode method instead.");
|
||||
|
||||
@end
|
||||
|
||||
ASDISPLAYNODE_DEPRECATED
|
||||
ASDISPLAYNODE_DEPRECATED_MSG("Renamed to ASCollectionDataSource.")
|
||||
@protocol ASCollectionViewDataSource <ASCollectionDataSource>
|
||||
@end
|
||||
|
||||
ASDISPLAYNODE_DEPRECATED
|
||||
ASDISPLAYNODE_DEPRECATED_MSG("Renamed to ASCollectionDelegate.")
|
||||
@protocol ASCollectionViewDelegate <ASCollectionDelegate>
|
||||
@end
|
||||
|
||||
@@ -416,7 +416,7 @@ ASDISPLAYNODE_DEPRECATED
|
||||
* `constrainedSizeForNodeAtIndexPath`
|
||||
* please file a github issue if you would like this to be restored.
|
||||
*/
|
||||
- (UIEdgeInsets)collectionView:(ASCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section __deprecated_msg("This method does nothing for 1.9.7+ due to incorrect implementation previously, see the header file for more information.");
|
||||
- (UIEdgeInsets)collectionView:(ASCollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section ASDISPLAYNODE_DEPRECATED_MSG("This method does nothing for 1.9.7+ due to incorrect implementation previously, see the header file for more information.");
|
||||
|
||||
/**
|
||||
* Asks the delegate for the size of the header in the specified section.
|
||||
|
||||
Reference in New Issue
Block a user