From 4d6315ef11a55ee3d0764d3a71e56a6da7bd90ad Mon Sep 17 00:00:00 2001 From: Yang Xu Date: Fri, 8 Jan 2021 18:30:30 +0800 Subject: [PATCH] fix --- README.md | 18 ++++++++++++++++++ Sources/SwipeCell/ViewExtension.swift | 7 ------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 758619a..7616744 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,24 @@ ScrollView{ } ``` +Get Cell Status +```swift +HStack{ + Text("Cell Status:") + Text(status.rawValue) + .foregroundColor(.red) + //get the cell status from Environment + .transformEnvironment(\.cellStatus, transform: { cellStatus in + let temp = cellStatus + DispatchQueue.main.async { + self.status = temp + } + }) +} +.frame(maxWidth:.infinity,alignment: .center) +.frame(height:100) +.swipeCell(cellPosition: .both, leftSlot: slot, rightSlot: slot) +``` * dismissSwipeCell 在editmode下支持选择 diff --git a/Sources/SwipeCell/ViewExtension.swift b/Sources/SwipeCell/ViewExtension.swift index 605419e..0afbc0a 100644 --- a/Sources/SwipeCell/ViewExtension.swift +++ b/Sources/SwipeCell/ViewExtension.swift @@ -75,13 +75,6 @@ extension Notification.Name { public static let swipeCellReset = Notification.Name("com.swipeCell.reset") } -extension View { - public func debug() -> Self { - print(Mirror(reflecting: self).subjectType) - return self - } -} - public struct CellStatusKey: EnvironmentKey { public static var defaultValue: CellStatus = .showCell }