Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MBP-6915 Adapter apply 인터페이스 개선 #45

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

ppth0608
Copy link
Contributor

Background

CollectionViewAdapter의 apply 함수 인터페이스를 개선해요.
apply시 CollectionViewAdapterUpdateStrategy 인자를 받는 함수를 추가했어요.

/// The approaches for updating the content of a `UICollectionView`.
public enum CollectionViewAdapterUpdateStrategy {
  
  /// Performs animated batch updates by calling `performBatchUpdates(…)` with the new content.
  case animatedBatchUpdates

  /// Performs non-animated batch updates by wrapping a call to `performBatchUpdates(…)` with the
  /// new content within a `UIView.performWithoutAnimation(…)` closure.
  ///
  /// More performant than `reloadData`, as it does not recreate and reconfigure all visible
  /// cells.
  case nonanimatedBatchUpdates

  /// Performs non-animated updates by calling `reloadData()`, which recreates and reconfigures
  /// all visible cells.
  ///
  /// UIKit engineers have suggested that we should never need to call `reloadData` on updates,
  /// and instead just use batch updates for all content updates.
  case reloadData
}

Copy link
Contributor

@jaxtynSong jaxtynSong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@OhKanghoon OhKanghoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깔꼼하네요 👍

@OhKanghoon OhKanghoon merged commit 7b2c060 into main Sep 26, 2024
1 check passed
@OhKanghoon OhKanghoon deleted the feature/ben/MBP-6915-add-update-strategy-option branch September 26, 2024 08:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants