forked from ra1028/DifferenceKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DifferentiableSection is now inherited from Differentiable
- Loading branch information
Showing
4 changed files
with
45 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
/// Represents the section of collection that has model and elements that identified and can be compared to whether has updated. | ||
public protocol DifferentiableSection { | ||
/// A type representing the model for differentiated with other section. | ||
associatedtype Model: Differentiable | ||
public protocol DifferentiableSection: Differentiable { | ||
/// A type representing the elements in section. | ||
associatedtype Collection: Swift.Collection where Collection.Element: Differentiable | ||
|
||
/// The model of section for differentiated with other section. | ||
var model: Model { get } | ||
/// The collection of element in the section. | ||
var elements: Collection { get } | ||
|
||
/// Creates a section from the model and the elements. | ||
/// Creates a new section reproding the given source section with replacing the elements. | ||
/// | ||
/// - Parameters: | ||
/// - model: A model of section. | ||
/// - elements: The collection of element in the section. | ||
init<C: Swift.Collection>(model: Model, elements: C) where C.Element == Collection.Element | ||
/// - source: A source section to reproduce. | ||
/// - elements: The collection of elements for the new section. | ||
init<C: Swift.Collection>(source: Self, elements: C) where C.Element == Collection.Element | ||
} |
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