diff --git a/CHANGELOG.md b/CHANGELOG.md index d72bb8e..fba85a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,29 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instagram/IGListKit/releases) on GitHub. +3.0.0 (**upcoming release**) +----- + +This release closes the [3.0.0 milestone](https://github.com/Instagram/IGListKit/milestone/3). + +### Breaking Changes + +- Updated `didSelect` delegate call in `IGListSingleSectionControllerDelegate` to include object. [Sherlouk](https://github.com/Sherlouk) [(#397)](https://github.com/Instagram/IGListKit/pull/397) + +```objc +// OLD +- (void)didSelectSingleSectionController:(IGListSingleSectionController *)sectionController; + +// NEW +- (void)didSelectSectionController:(IGListSingleSectionController *)sectionController + withObject:(id)object; +``` + 2.2.0 ----- This release closes the [2.2.0 milestone](https://github.com/Instagram/IGListKit/milestone/4). -### Enhancements - ### Fixes - Fix bug where emptyView's hidden status is not updated after the number of items is changed with `insertInSectionController:atIndexes:` or related methods. [Peter Edmonston](https://github.com/edmonston) [(#395)](https://github.com/Instagram/IGListKit/pull/395) diff --git a/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionStoryboardViewController.swift b/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionStoryboardViewController.swift index 45a8a0f..6dc1e54 100644 --- a/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionStoryboardViewController.swift +++ b/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionStoryboardViewController.swift @@ -55,13 +55,11 @@ final class SingleSectionStoryboardViewController: UIViewController, IGListAdapt return sectionController } - func emptyView(for listAdapter: IGListAdapter) -> UIView? { - return nil - } + func emptyView(for listAdapter: IGListAdapter) -> UIView? { return nil } // MARK: - IGListSingleSectionControllerDelegate - func didSelect(_ sectionController: IGListSingleSectionController) { + func didSelect(_ sectionController: IGListSingleSectionController, with object: Any) { let section = adapter.section(for: sectionController) + 1 let alert = UIAlertController(title: "Section \(section) was selected \u{1F389}", message: nil, preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Dismiss", style: .default, handler: nil)) diff --git a/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift b/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift index eb9f4b5..c3b8ade 100644 --- a/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift +++ b/Examples/Examples-iOS/IGListKitExamples/ViewControllers/SingleSectionViewController.swift @@ -69,9 +69,11 @@ final class SingleSectionViewController: UIViewController, IGListAdapterDataSour // MARK: - IGListSingleSectionControllerDelegate - func didSelect(_ sectionController: IGListSingleSectionController) { + func didSelect(_ sectionController: IGListSingleSectionController, with object: Any) { let section = adapter.section(for: sectionController) + 1 - let alert = UIAlertController(title: "Section \(section) was selected \u{1F389}", message: nil, preferredStyle: .alert) + let alert = UIAlertController(title: "Section \(section) was selected \u{1F389}", + message: "Cell Object: " + String(describing: object), + preferredStyle: .alert) alert.addAction(UIAlertAction(title: "Dismiss", style: .default, handler: nil)) present(alert, animated: true, completion: nil) } diff --git a/Source/IGListSingleSectionController.h b/Source/IGListSingleSectionController.h index a0ae50d..7d7cf05 100644 --- a/Source/IGListSingleSectionController.h +++ b/Source/IGListSingleSectionController.h @@ -45,8 +45,10 @@ typedef CGSize (^IGListSingleSectionCellSizeBlock)(id item, id