Skip to content

Commit

Permalink
Merge pull request #258 from kyleve/kve/rename-list-to-table
Browse files Browse the repository at this point in the history
Rename .list to .table
  • Loading branch information
kyleve authored Jan 23, 2021
2 parents dbb4e12 + 16bca0c commit 4ff41a8
Show file tree
Hide file tree
Showing 34 changed files with 205 additions and 468 deletions.
15 changes: 1 addition & 14 deletions BlueprintUILists/Sources/Deprecations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,5 @@ import BlueprintUI
///

//
// MARK: Deprecated May 29, 2019
// MARK: Deprecated Month XX, 20XX
//

@available(*, unavailable, renamed: "BlueprintItemContent")
public typealias BlueprintItemElement = BlueprintItemContent

@available(*, unavailable, renamed: "BlueprintHeaderFooterContent")
public typealias BlueprintHeaderFooterElement = BlueprintHeaderFooterContent

public extension BlueprintHeaderFooterContent {
@available(*, unavailable, renamed: "elementRepresentation")
var element : Element {
self.elementRepresentation
}
}
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

### Added

- [Introduce support for layout customization for `Item`, `HeaderFooter`, and `Section`](https://github.com/kyleve/Listable/pull/257) for all `ListLayout` types, not just `.list`.
- [Introduce support for layout customization for `Item`, `HeaderFooter`, and `Section`](https://github.com/kyleve/Listable/pull/257) for all `ListLayout` types, not just `.table`.

### Removed

### Changed

- [Rename `.list` layout to `.table`](https://github.com/kyleve/Listable/pull/258), which is clearer, and also reduces confusion between `ListLayout` (the base protocol for layouts), and the specific table-type layout.

### Misc

# Past Releases
Expand Down Expand Up @@ -146,7 +148,7 @@

### Removed

- [Removed support for .`horiztonal` layouts](https://github.com/kyleve/Listable/pull/178) on `.list()` layouts. Now only `.vertical` is supported (this could return at a later date if needed).
- [Removed support for .`horiztonal` layouts](https://github.com/kyleve/Listable/pull/178) on `.table()` layouts. Now only `.vertical` is supported (this could return at a later date if needed).

### Changed

Expand Down Expand Up @@ -215,14 +217,14 @@
Previously, to configure a layout, you would write code like this:

```
list.appearance.layoutType = .list
list.appearance.list.layout.padding = UIEdgeInsets(...)
list.appearance.layoutType = .table
list.appearance.table.layout.padding = UIEdgeInsets(...)
```

Now, you configure the layout like this:

```
list.layout = .list {
list.layout = .table {
$0.layout.padding = UIEdgeInsets(...)
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension Appearance
extension LayoutDescription
{
static var demoLayout : Self {
.list {
.table {
$0.layout = .init(
padding: UIEdgeInsets(top: 30.0, left: 20.0, bottom: 30.0, right: 20.0),
width: .atMost(600.0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ final class CollectionViewBasicDemoViewController : UIViewController
list += self.rows.map { sectionRows in
Section("Demo Section") { section in

section.layouts.list.columns = .init(count: 2, spacing: 10.0)
section.layouts.table.columns = .init(count: 2, spacing: 10.0)

if self.showsSectionHeaders {
section.header = HeaderFooter(DemoHeader(title: "Section Header"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final public class CollectionViewDictionaryDemoViewController : UIViewController
{
self.title = "Dictionary"

self.listView.layout = .list {
self.listView.layout = .table {
$0.layout.set {
$0.padding = UIEdgeInsets(top: 0.0, left: 20.0, bottom: 20.0, right: 20.0)
$0.width = .atMost(600.0)
Expand Down Expand Up @@ -92,7 +92,7 @@ final public class CollectionViewDictionaryDemoViewController : UIViewController
rows += Item(
search,
layouts: .init {
$0.list.width = .fill
$0.table.width = .fill
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class HorizontalLayoutViewController : UIViewController

self.listView.configure { list in

list.layout = .list {
list.layout = .table {
$0.layout.itemSpacing = 20.0
$0.layout.padding = UIEdgeInsets(top: 20.0, left: 20.0, bottom: 20.0, right: 20.0)
}
Expand All @@ -48,7 +48,7 @@ final class HorizontalLayoutViewController : UIViewController

horizontal += Section("cards") { section in

section.layouts.list.columns = .init(count: 2, spacing: 20.0)
section.layouts.table.columns = .init(count: 2, spacing: 20.0)

section += Item(
CardElement(title: "This is the first card", detail: "Isn't it neat?", color: .white(0.90)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class InvoicesPaymentScheduleDemoViewController : UIViewController

func setAppearance()
{
self.list.layout = .list {
self.list.layout = .table {
$0.layout.set {
$0.padding = UIEdgeInsets(top: 20.0, left: 10.0, bottom: 20.0, right: 10.0)
$0.interSectionSpacingWithFooter = 30.0
Expand Down Expand Up @@ -102,7 +102,7 @@ final class InvoicesPaymentScheduleDemoViewController : UIViewController
sizing: .thatFits(),

layouts: .init {
$0.list.itemSpacing = 20.0
$0.table.itemSpacing = 20.0
}
)

Expand Down Expand Up @@ -145,7 +145,7 @@ final class InvoicesPaymentScheduleDemoViewController : UIViewController
},
sizing: .thatFits(),
layouts: .init {
$0.list.itemSpacing = 20
$0.table.itemSpacing = 20
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class ItemizationEditorViewController : UIViewController

list += Section(SectionIdentifier.variations) { section in

section.layouts.list.columns = .init(count: 2, spacing: 20.0)
section.layouts.table.columns = .init(count: 2, spacing: 20.0)
section.header = HeaderFooter(Header(title: variationsTitle), sizing: .thatFits())
section.footer = HeaderFooter(Footer(text: footerText), sizing: .thatFits())

Expand All @@ -97,7 +97,7 @@ final class ItemizationEditorViewController : UIViewController
list += itemization.modifiers.map { set in
Section(SectionIdentifier.modifier(set.name)) { section in

section.layouts.list.columns = .init(count: 2, spacing: 20.0)
section.layouts.table.columns = .init(count: 2, spacing: 20.0)

section.header = HeaderFooter(Header(title: set.name), sizing: .thatFits())
section.footer = HeaderFooter(Footer(text: "Choose modifiers"), sizing: .thatFits())
Expand All @@ -118,7 +118,7 @@ final class ItemizationEditorViewController : UIViewController

list += Section(SectionIdentifier.discounts) { section in

section.layouts.list.columns = .init(count: 2, spacing: 20.0)
section.layouts.table.columns = .init(count: 2, spacing: 20.0)
section.header = HeaderFooter(Header(title: "Discounts"), sizing: .thatFits())

section += self.availableOptions.allDiscounts.map { discount in
Expand All @@ -134,7 +134,7 @@ final class ItemizationEditorViewController : UIViewController

list += Section(SectionIdentifier.taxes) { section in

section.layouts.list.columns = .init(count: 2, spacing: 20.0)
section.layouts.table.columns = .init(count: 2, spacing: 20.0)
section.header = HeaderFooter(Header(title: "Taxes"), sizing: .thatFits())

section += self.availableOptions.allTaxes.map { tax in
Expand All @@ -155,7 +155,7 @@ final class ItemizationEditorViewController : UIViewController
}

var listLayout : LayoutDescription {
.list {
.table {
$0.stickySectionHeaders = false

$0.sizing = .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class KeyboardTestingViewController : UIViewController
{
self.view = self.listView

self.listView.layout = .list {
self.listView.layout = .table {
$0.layout.itemSpacing = 10.0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class MultiSelectViewController : ListViewController

list.behavior.selectionMode = .multiple

list.layout = .list {
list.layout = .table {
$0.layout.itemSpacing = 10.0
$0.layout.padding = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class SpacingCustomizationViewController : UIViewController

self.listView.configure { list in

list.layout = .list {
list.layout = .table {
$0.layout.set {
$0.padding = UIEdgeInsets(top: 20.0, left: 20.0, bottom: 20.0, right: 20.0)
$0.itemSpacing = 20.0
Expand All @@ -42,7 +42,7 @@ final class SpacingCustomizationViewController : UIViewController

list += Section("custom-50") { section in

section.layouts.list = .init(customInterSectionSpacing: 50)
section.layouts.table = .init(customInterSectionSpacing: 50)

section += Item(
CardElement(title: "Default Row In 50 Spacing Section", color: .white(0.95)),
Expand All @@ -52,7 +52,7 @@ final class SpacingCustomizationViewController : UIViewController

list += Section("custom-100") { section in

section.layouts.list = .init(customInterSectionSpacing: 100)
section.layouts.table = .init(customInterSectionSpacing: 100)

section += Item(
CardElement(title: "Default Row In 100 Spacing Section", color: .white(0.95)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class SwipeActionsViewController: UIViewController {

list.animatesChanges = animated

list.layout = .list { [weak self] in
list.layout = .table { [weak self] in
guard let self = self else { return }

if #available(iOS 11, *) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class WidthCustomizationViewController : UIViewController

self.listView.configure { list in

list.layout = .list {
list.layout = .table {
$0.layout.set {
$0.padding = UIEdgeInsets(top: 20.0, left: 20.0, bottom: 20.0, right: 20.0)
$0.itemSpacing = 20.0
Expand All @@ -35,7 +35,7 @@ final class WidthCustomizationViewController : UIViewController

list += Section("default") { section in

section.layouts.list.width = .default
section.layouts.table.width = .default

section += Item(
CardElement(title: "Default Row In Default Section", color: .white(0.95)),
Expand All @@ -45,7 +45,7 @@ final class WidthCustomizationViewController : UIViewController

list += Section("fill") { section in

section.layouts.list.width = .fill
section.layouts.table.width = .fill

section += Item(
CardElement(title: "Default Row In Fill Section", color: .white(0.95)),
Expand All @@ -55,7 +55,7 @@ final class WidthCustomizationViewController : UIViewController

list += Section("custom-1") { section in

section.layouts.list.width = .custom(.init(
section.layouts.table.width = .custom(.init(
padding: HorizontalPadding(uniform: 10.0),
width: .atMost(200.0),
alignment: .left
Expand All @@ -66,15 +66,15 @@ final class WidthCustomizationViewController : UIViewController
CardElement(title: "Default Row In Left Section", color: .white(0.95)),
sizing: .thatFits(),
layouts: .init {
$0.list.width = .default
$0.table.width = .default
}
)

section += Item(
CardElement(title: "Left Aligned In Left Section", color: .white(0.95)),
sizing: .thatFits(),
layouts: .init {
$0.list.width = .custom(.init(
$0.table.width = .custom(.init(
padding: HorizontalPadding(uniform: 10.0),
width: .atMost(200.0),
alignment: .left
Expand All @@ -87,7 +87,7 @@ final class WidthCustomizationViewController : UIViewController
CardElement(title: "Center Aligned In Left Section", color: .white(0.95)),
sizing: .thatFits(),
layouts: .init {
$0.list.width = .custom(.init(
$0.table.width = .custom(.init(
padding: HorizontalPadding(uniform: 10.0),
width: .atMost(200.0),
alignment: .center
Expand All @@ -100,7 +100,7 @@ final class WidthCustomizationViewController : UIViewController
CardElement(title: "Right Aligned In Left Section", color: .white(0.95)),
sizing: .thatFits(),
layouts: .init {
$0.list.width = .custom(.init(
$0.table.width = .custom(.init(
padding: HorizontalPadding(uniform: 10.0),
width: .atMost(200.0),
alignment: .right
Expand Down
Loading

0 comments on commit 4ff41a8

Please sign in to comment.