From e662826e120d12f06f35e92437c554734b449fa0 Mon Sep 17 00:00:00 2001 From: Jerome Boursier Date: Fri, 20 Mar 2020 23:20:46 +0100 Subject: [PATCH] Changed `nullable` keyword to `_Nullable` and added a missing `return` --- Source/IGListKit/IGListBindingSectionController.m | 2 +- .../IGListBindingSectionControllerSelectionDelegate.h | 8 ++++---- Source/IGListKit/IGListSectionController.h | 2 +- Source/IGListKit/IGListSectionController.m | 2 +- .../IGListKit/Internal/IGListAdapter+UICollectionView.m | 2 +- Tests/Objects/IGListTestSection.m | 2 +- Tests/Objects/IGTestBindingWithoutDeselectionDelegate.m | 2 +- Tests/Objects/IGTestDiffingSectionController.m | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/IGListKit/IGListBindingSectionController.m b/Source/IGListKit/IGListBindingSectionController.m index 2e9667c90..439cac511 100644 --- a/Source/IGListKit/IGListBindingSectionController.m +++ b/Source/IGListKit/IGListBindingSectionController.m @@ -151,7 +151,7 @@ - (void)didUnhighlightItemAtIndex:(NSInteger)index { } #if !TARGET_OS_TV -- (nullable UIContextMenuConfiguration *)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { +- (UIContextMenuConfiguration * _Nullable)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { return [self.selectionDelegate sectionController:self contextMenuConfigurationForItemAtIndex:index point:point viewModel:self.viewModels[index]]; } #endif diff --git a/Source/IGListKit/IGListBindingSectionControllerSelectionDelegate.h b/Source/IGListKit/IGListBindingSectionControllerSelectionDelegate.h index 9f3ae811a..b7a21d7f6 100644 --- a/Source/IGListKit/IGListBindingSectionControllerSelectionDelegate.h +++ b/Source/IGListKit/IGListBindingSectionControllerSelectionDelegate.h @@ -71,10 +71,10 @@ didUnhighlightItemAtIndex:(NSInteger)index @return An object that conforms to `UIContextMenuConfiguration`. */ -- (nullable UIContextMenuConfiguration *)sectionController:(IGListBindingSectionController *)sectionController - contextMenuConfigurationForItemAtIndex:(NSInteger)index - point:(CGPoint)point - viewModel:(id)viewModel API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos); +- (UIContextMenuConfiguration * _Nullable)sectionController:(IGListBindingSectionController *)sectionController + contextMenuConfigurationForItemAtIndex:(NSInteger)index + point:(CGPoint)point + viewModel:(id)viewModel API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos); @end diff --git a/Source/IGListKit/IGListSectionController.h b/Source/IGListKit/IGListSectionController.h index a5d15f2e1..85fae029c 100644 --- a/Source/IGListKit/IGListSectionController.h +++ b/Source/IGListKit/IGListSectionController.h @@ -121,7 +121,7 @@ NS_SWIFT_NAME(ListSectionController) @note The default implementation does nothing. **Calling super is not required.** */ -- (nullable UIContextMenuConfiguration *)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos); +- (UIContextMenuConfiguration * _Nullable)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos); /** Identifies whether an object can be moved through interactive reordering. diff --git a/Source/IGListKit/IGListSectionController.m b/Source/IGListKit/IGListSectionController.m index ed2b418ca..5943b3a2a 100644 --- a/Source/IGListKit/IGListSectionController.m +++ b/Source/IGListKit/IGListSectionController.m @@ -88,7 +88,7 @@ - (void)didHighlightItemAtIndex:(NSInteger)index {} - (void)didUnhighlightItemAtIndex:(NSInteger)index {} -- (nullable UIContextMenuConfiguration *)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { +- (UIContextMenuConfiguration * _Nullable)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { return nil; } diff --git a/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m b/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m index b1c77ff89..35d7c8c6a 100644 --- a/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m +++ b/Source/IGListKit/Internal/IGListAdapter+UICollectionView.m @@ -240,7 +240,7 @@ - (UIContextMenuConfiguration *)collectionView:(UICollectionView *)collectionVie // forward this method to the delegate b/c this implementation will steal the message from the proxy id collectionViewDelegate = self.collectionViewDelegate; if ([collectionViewDelegate respondsToSelector:@selector(collectionView:contextMenuConfigurationForItemAtIndexPath:point:)]) { - [collectionViewDelegate collectionView:collectionView contextMenuConfigurationForItemAtIndexPath:indexPath point:point]; + return [collectionViewDelegate collectionView:collectionView contextMenuConfigurationForItemAtIndexPath:indexPath point:point]; } IGListSectionController * sectionController = [self sectionControllerForSection:indexPath.section]; diff --git a/Tests/Objects/IGListTestSection.m b/Tests/Objects/IGListTestSection.m index 247291a47..cf662d00c 100644 --- a/Tests/Objects/IGListTestSection.m +++ b/Tests/Objects/IGListTestSection.m @@ -60,7 +60,7 @@ - (void)didUnhighlightItemAtIndex:(NSInteger)index { self.wasUnhighlighted = YES; } -- (nullable UIContextMenuConfiguration *)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { +- (UIContextMenuConfiguration * _Nullable)contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point { self.requestedContextMenu = YES; return nil; } diff --git a/Tests/Objects/IGTestBindingWithoutDeselectionDelegate.m b/Tests/Objects/IGTestBindingWithoutDeselectionDelegate.m index 53bde9d10..4f4f1d2af 100644 --- a/Tests/Objects/IGTestBindingWithoutDeselectionDelegate.m +++ b/Tests/Objects/IGTestBindingWithoutDeselectionDelegate.m @@ -32,7 +32,7 @@ - (void)sectionController:(nonnull IGListBindingSectionController *)sectionContr } -- (nullable UIContextMenuConfiguration *)sectionController:(nonnull IGListBindingSectionController *)sectionController +- (UIContextMenuConfiguration * _Nullable)sectionController:(nonnull IGListBindingSectionController *)sectionController contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point viewModel:(nonnull id)viewModel API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos) { diff --git a/Tests/Objects/IGTestDiffingSectionController.m b/Tests/Objects/IGTestDiffingSectionController.m index 3d94be52f..c4fd91323 100644 --- a/Tests/Objects/IGTestDiffingSectionController.m +++ b/Tests/Objects/IGTestDiffingSectionController.m @@ -65,7 +65,7 @@ - (void)sectionController:(IGListBindingSectionController *)sectionController di self.unhighlightedViewModel = viewModel; } -- (nullable UIContextMenuConfiguration *)sectionController:(IGListBindingSectionController *)sectionController contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point viewModel:(id)viewModel API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos) { +- (UIContextMenuConfiguration * _Nullable)sectionController:(IGListBindingSectionController *)sectionController contextMenuConfigurationForItemAtIndex:(NSInteger)index point:(CGPoint)point viewModel:(id)viewModel API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos) { self.contextMenuViewModel = viewModel; return nil; }