-
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.
Browse files
Browse the repository at this point in the history
This still needs all kinds of work to correctly model how collection view supplementary views work, but this is a start. We're artificially (and implicitly) restricted to headers and footers. We'll probably have to keep this limitation for 1.0. This aims to make a more general transition easier. - Make `kind` a property of `SupplementaryViewInfo` - Make `ViewRegistrationMethod` a proper type on its own (which we can use for cell registration in #18)
- Loading branch information
1 parent
cfaa9ae
commit 6a92a4d
Showing
7 changed files
with
70 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// 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 | ||
import UIKit | ||
|
||
/// 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