Created
February 26, 2019 08:06
-
-
Save gwennguihal/743e534d239b1b2768a8f8c92973b10d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public final class DecorationBlock { | |
| public let type: DecorationBlockType | |
| unowned var sectionDescriptor: CollectionSectionDescribable | |
| var startItemIndex: Int | |
| var endItemIndex: Int | |
| var firstIndexPath: IndexPath? { | |
| guard let sectionIndex = sectionDescriptor.index else { | |
| return nil | |
| } | |
| return IndexPath(item: startItemIndex, section: sectionIndex) | |
| } | |
| var endIndexPath: IndexPath? { | |
| guard let sectionIndex = sectionDescriptor.index else { | |
| return nil | |
| } | |
| return IndexPath(item: endItemIndex, section: sectionIndex) | |
| } | |
| init(type: DecorationBlockType, startItemIndex: Int, sectionDescriptor: CollectionSectionDescribable) { | |
| self.type = type | |
| self.startItemIndex = startItemIndex | |
| self.endItemIndex = startItemIndex | |
| self.sectionDescriptor = sectionDescriptor | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment