-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add HighlightEvent and UnhighlightEvent
- Loading branch information
1 parent
7b2c060
commit 2ed3bf2
Showing
5 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Copyright (c) 2024 Danggeun Market Inc. | ||
// | ||
|
||
import UIKit | ||
|
||
/// This structure encapsulates the highlight event information and contains a closure object for handling the highlight event. | ||
public struct HighlightEvent: ListingViewEvent { | ||
|
||
public struct EventContext { | ||
|
||
/// The index path of the view that was highlighted. | ||
public let indexPath: IndexPath | ||
|
||
/// The component owned by the view that was highlighted. | ||
public let anyComponent: AnyComponent | ||
|
||
/// The content owned by the view that was highlighted. | ||
public let content: UIView? | ||
} | ||
|
||
/// A closure that's called when the cell was highlighted | ||
let handler: (EventContext) -> Void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Copyright (c) 2024 Danggeun Market Inc. | ||
// | ||
|
||
import UIKit | ||
|
||
/// This structure encapsulates the unhighlight event information and contains a closure object for handling the unhighlight event. | ||
public struct UnhighlightEvent: ListingViewEvent { | ||
|
||
public struct EventContext { | ||
|
||
/// The index path of the view that was unhighlight. | ||
public let indexPath: IndexPath | ||
|
||
/// The component owned by the view that was unhighlight. | ||
public let anyComponent: AnyComponent | ||
|
||
/// The content owned by the view that was unhighlight. | ||
public let content: UIView? | ||
} | ||
|
||
/// A closure that's called when the cell was unhighlight | ||
let handler: (EventContext) -> Void | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters