Skip to content

Commit 1bb3292

Browse files
author
Reed Es
committed
No longer with Identifiable constraint on Element
1 parent 18cb2d6 commit 1bb3292

7 files changed

+7
-11
lines changed

Sources/DetailerDeleteButton.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
import SwiftUI
2020

2121
public struct DetailerDeleteButton<Element, Content>: View
22-
where Element: Identifiable, Content: View
22+
where Content: View
2323
{
2424
public typealias CanDelete = (Element) -> Bool
25-
public typealias OnDelete = (Element.ID) -> Void
25+
public typealias OnDelete = (Element) -> Void
2626

2727
// MARK: Parameters
2828

@@ -62,7 +62,7 @@ public struct DetailerDeleteButton<Element, Content>: View
6262
// MARK: Views
6363

6464
public var body: some View {
65-
Button(action: { onDelete?(element.id) }) {
65+
Button(action: { onDelete?(element) }) {
6666
label()
6767
}
6868
.keyboardShortcut(.delete, modifiers: [])

Sources/DetailerEditButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import SwiftUI
2222
/// * Assumes the user will be allowed to edit (canEdit==true) even if no canEdit provided (canEdit==nil).
2323
///
2424
public struct DetailerEditButton<Element, Content>: View
25-
where Element: Identifiable, Content: View
25+
where Content: View
2626
{
2727
public typealias CanEdit = (Element) -> Bool
2828
public typealias OnEdit = (Element) -> Void

Sources/DetailerViewButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import SwiftUI
2020

2121
public struct DetailerViewButton<Element, Content>: View
22-
where Element: Identifiable, Content: View
22+
where Content: View
2323
{
2424
public typealias OnView = (Element) -> Void
2525

Sources/EditDetailerContextMenu.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
import SwiftUI
2020

2121
public struct EditDetailerContextMenu<Element>: ViewModifier
22-
where Element: Identifiable
2322
{
2423
public typealias CanEdit = (Element) -> Bool
2524
public typealias CanDelete = (Element) -> Bool
26-
public typealias OnDelete = (Element.ID) -> Void
25+
public typealias OnDelete = (Element) -> Void
2726
public typealias OnEdit = (Element) -> Void
2827

2928
private let element: Element

Sources/EditDetailerSwipeMenu.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ import SwiftUI
2020

2121
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
2222
public struct EditDetailerSwipeMenu<Element>: ViewModifier
23-
where Element: Identifiable
2423
{
2524
public typealias CanEdit = (Element) -> Bool
2625
public typealias CanDelete = (Element) -> Bool
27-
public typealias OnDelete = (Element.ID) -> Void
26+
public typealias OnDelete = (Element) -> Void
2827
public typealias OnEdit = (Element) -> Void
2928

3029
private let element: Element

Sources/ViewDetailerContextMenu.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import SwiftUI
2020

2121
public struct ViewDetailerContextMenu<Element>: ViewModifier
22-
where Element: Identifiable
2322
{
2423
private var element: Element
2524
@Binding private var toView: Element?

Sources/ViewDetailerSwipeMenu.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import SwiftUI
2020

2121
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
2222
public struct ViewDetailerSwipeMenu<Element>: ViewModifier
23-
where Element: Identifiable
2423
{
2524
private var element: Element
2625
@Binding private var toView: Element?

0 commit comments

Comments
 (0)