Skip to content

Commit

Permalink
explicit names for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Reed Es committed Mar 3, 2022
1 parent bdfabae commit 8413f6f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ iOS

Swift open-source libraries (by the same author):

* [SwiftDetailer](https://github.com/openalloc/SwiftDetailer) - multi-platform SwiftUI component for editing fielded data
* [SwiftTabler](https://github.com/openalloc/SwiftTabler) - multi-platform SwiftUI component for displaying (and interacting with) tabular data
* [AllocData](https://github.com/openalloc/AllocData) - standardized data formats for investing-focused apps and tools
* [FINporter](https://github.com/openalloc/FINporter) - library and command-line tool to transform various specialized finance-related formats to the standardized schema of AllocData
Expand Down
19 changes: 9 additions & 10 deletions Sources/EditDetailerContextMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//

import SwiftUI
import Detailer

public struct EditDetailerContextMenu<Element>: ViewModifier
where Element: Identifiable
Expand All @@ -34,9 +33,9 @@ public struct EditDetailerContextMenu<Element>: ViewModifier

public init(_ element: Element,
_ toEdit: Binding<Element?>,
_ canEdit: @escaping CanEdit = { _ in true },
_ canDelete: @escaping CanDelete = { _ in true },
_ onDelete: OnDelete? = nil)
canEdit: @escaping CanEdit = { _ in true },
canDelete: @escaping CanDelete = { _ in true },
onDelete: OnDelete? = nil)
{
self.element = element
_toEdit = toEdit
Expand All @@ -48,15 +47,15 @@ public struct EditDetailerContextMenu<Element>: ViewModifier
// convenience to unwrap bound element
public init(_ element: Binding<Element>,
_ toEdit: Binding<Element?>,
_ canEdit: @escaping CanEdit = { _ in true },
_ canDelete: @escaping CanDelete = { _ in true },
_ onDelete: OnDelete? = nil)
canEdit: @escaping CanEdit = { _ in true },
canDelete: @escaping CanDelete = { _ in true },
onDelete: OnDelete? = nil)
{
self.init(element.wrappedValue,
toEdit,
canEdit,
canDelete,
onDelete)
canEdit: canEdit,
canDelete: canDelete,
onDelete: onDelete)
}

private var isDeleteAvailable: Bool {
Expand Down
18 changes: 9 additions & 9 deletions Sources/EditDetailerSwipeMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public struct EditDetailerSwipeMenu<Element>: ViewModifier

public init(_ element: Element,
_ toEdit: Binding<Element?>,
_ canEdit: @escaping CanEdit = { _ in true },
_ canDelete: @escaping CanDelete = { _ in true },
_ onDelete: OnDelete? = nil)
canEdit: @escaping CanEdit = { _ in true },
canDelete: @escaping CanDelete = { _ in true },
onDelete: OnDelete? = nil)
{
self.element = element
_toEdit = toEdit
Expand All @@ -48,15 +48,15 @@ public struct EditDetailerSwipeMenu<Element>: ViewModifier
// convenience to unwrap bound element
public init(_ element: Binding<Element>,
_ toEdit: Binding<Element?>,
_ canEdit: @escaping CanEdit = { _ in true },
_ canDelete: @escaping CanDelete = { _ in true },
_ onDelete: OnDelete? = nil)
canEdit: @escaping CanEdit = { _ in true },
canDelete: @escaping CanDelete = { _ in true },
onDelete: OnDelete? = nil)
{
self.init(element.wrappedValue,
toEdit,
canEdit,
canDelete,
onDelete)
canEdit: canEdit,
canDelete: canDelete,
onDelete: onDelete)
}

private var isDeleteAvailable: Bool {
Expand Down

0 comments on commit 8413f6f

Please sign in to comment.