-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup and fixes for CollectionViewDriver
- remove hidden supplementary view hacks, close #47 - fix `SupplementaryViewKind` models, close #56 - `RegistrationMethod` --> `ViewRegistrationMethod` (and remove nesting, since this will apply to all cells in #18) - make `kind` a property of `SupplementaryViewInfo` - Remove `typealias Section`, only used in one place and doesn't add any value
- Loading branch information
1 parent
766e31a
commit 1c2e8d1
Showing
10 changed files
with
63 additions
and
50 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
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
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,38 @@ | ||
// | ||
// PlanGrid | ||
// https://www.plangrid.com | ||
// https://medium.com/plangrid-technology | ||
// | ||
// Documentation | ||
// https://plangrid.github.io/ReactiveLists | ||
// | ||
// GitHub | ||
// https://github.com/plangrid/ReactiveLists | ||
// | ||
// License | ||
// Copyright © 2018-present PlanGrid, Inc. | ||
// Released under an MIT license: https://opensource.org/licenses/MIT | ||
// | ||
|
||
import Foundation | ||
|
||
/// The method for registering cells and supplementary views | ||
public enum ViewRegistrationMethod { | ||
/// Class-based views | ||
case viewClass(AnyClass) | ||
/// Nib-based views | ||
case nib(name: String, bundle: Bundle?) | ||
} | ||
|
||
extension ViewRegistrationMethod: Equatable { | ||
public static func == (lhs: ViewRegistrationMethod, rhs: ViewRegistrationMethod) -> Bool { | ||
switch (lhs, rhs) { | ||
case let (.viewClass(lhsClass), .viewClass(rhsClass)): | ||
return lhsClass == rhsClass | ||
case let (.nib(lhsName, lhsBundle), .nib(rhsName, rhsBundle)): | ||
return lhsName == rhsName && lhsBundle == rhsBundle | ||
default: | ||
return false | ||
} | ||
} | ||
} |
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