Skip to content

Commit

Permalink
Mark IGListAdapter, IGListSectionController and IGListBindable as a N…
Browse files Browse the repository at this point in the history
…S_SWIFT_UI_ACTOR

Summary: In order to be ready for Swift 6 and strict concurrency checking, we will mark IGListAdapter, IGListSectionController and IGListBindable as a NS_SWIFT_UI_ACTOR so that swift code that is isolated to the main actor can interact with these instances without needing to wrap in a separate Task or MainActor.run command

Differential Revision: D60775816

fbshipit-source-id: 24424bc625d577a1b237207bec29ccec7ef90e82
  • Loading branch information
corywilhite authored and facebook-github-bot committed Aug 7, 2024
1 parent 0e2db06 commit a28d835
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/IGListKit/IGListAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ typedef void (^IGListUpdaterCompletion)(BOOL finished);
controllers in a collection view.
*/
IGLK_SUBCLASSING_RESTRICTED
NS_SWIFT_UI_ACTOR
NS_SWIFT_NAME(ListAdapter)
@interface IGListAdapter : NSObject

Expand Down
1 change: 1 addition & 0 deletions Source/IGListKit/IGListAdapterUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
`-performUpdateWithCollectionView:fromObjects:toObjects:completion:`.
*/
IGLK_SUBCLASSING_RESTRICTED
NS_SWIFT_UI_ACTOR
NS_SWIFT_NAME(ListAdapterUpdater)
@interface IGListAdapterUpdater : NSObject <IGListUpdatingDelegate>

Expand Down
1 change: 1 addition & 0 deletions Source/IGListKit/IGListBindable.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
A protocol for cells that configure themselves given a view model.
*/
NS_SWIFT_UI_ACTOR
NS_SWIFT_NAME(ListBindable)
@protocol IGListBindable <NSObject>

Expand Down
1 change: 1 addition & 0 deletions Source/IGListKit/IGListDisplayDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Implement this protocol to receive display events for a section controller when it is on screen.
*/
NS_SWIFT_UI_ACTOR
NS_SWIFT_NAME(ListDisplayDelegate)
@protocol IGListDisplayDelegate <NSObject>

Expand Down
1 change: 1 addition & 0 deletions Source/IGListKit/IGListSectionController.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The base class for section controllers used in a list. This class is intended to be subclassed.
*/
NS_SWIFT_UI_ACTOR
NS_SWIFT_NAME(ListSectionController)
@interface IGListSectionController : NSObject

Expand Down

1 comment on commit a28d835

@CliffordGordon
Copy link

Choose a reason for hiding this comment

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

Thanks a lot for sharing. I hope it will help others.

Please sign in to comment.