-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for setting default HeaderFooter properties via HeaderFoo…
…terContent's defaultHeaderFooterProperties.
- Loading branch information
Showing
7 changed files
with
112 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
32 changes: 32 additions & 0 deletions
32
ListableUI/Sources/HeaderFooter/DefaultHeaderFooterProperties.swift
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,32 @@ | ||
// | ||
// DefaultHeaderFooterProperties.swift | ||
// ListableUI | ||
// | ||
// Created by Kyle Van Essen on 6/27/21. | ||
// | ||
|
||
import Foundation | ||
|
||
|
||
/// Allows specifying default properties to apply to a header / footer when it is initialized, | ||
/// if those values are not provided to the initializer. | ||
/// Only non-nil values are used – if you do not want to provide a default value, | ||
/// simply leave the property nil. | ||
/// | ||
/// The order of precedence used when assigning values is: | ||
/// 1) The value passed to the initializer. | ||
/// 2) The value from `defaultHeaderFooterProperties` on the contained `HeaderFooterContent`, if non-nil. | ||
/// 3) A standard, default value. | ||
public struct DefaultHeaderFooterProperties<Content:HeaderFooterContent> | ||
{ | ||
public var sizing : Sizing? | ||
public var layouts : HeaderFooterLayouts? | ||
|
||
public init( | ||
sizing : Sizing? = nil, | ||
layouts : HeaderFooterLayouts? = nil | ||
) { | ||
self.sizing = sizing | ||
self.layouts = layouts | ||
} | ||
} |
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