-
Notifications
You must be signed in to change notification settings - Fork 33
Swipe Action Updates #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swipe Action Updates #489
Conversation
| guard let swipeActions = self.model.leadingSwipeActions else { | ||
| assertionFailure("Cannot showLeadingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | ||
| return | ||
| } | ||
|
|
||
| guard swipeActions.actions.isEmpty == false else { | ||
| assertionFailure("Cannot showLeadingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | ||
| return | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐴
| guard let swipeActions = self.model.leadingSwipeActions else { | |
| assertionFailure("Cannot showLeadingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | |
| return | |
| } | |
| guard swipeActions.actions.isEmpty == false else { | |
| assertionFailure("Cannot showLeadingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | |
| return | |
| } | |
| guard self.model.leadingSwipeActions?.isEmpty == false else { | |
| assertionFailure("Cannot showLeadingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | |
| return | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started with this, but explicitly split it into two asserts, so when hitting the breakpoint, you'd understand if there was a swipe actions config vs if the swipe actions array was empty.
| guard let swipeActions = self.model.trailingSwipeActions else { | ||
| assertionFailure("Cannot showTrailingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | ||
| return | ||
| } | ||
|
|
||
| guard swipeActions.actions.isEmpty == false else { | ||
| assertionFailure("Cannot showTrailingSwipeActions for `\(self.model.identifier)`, as no swipe actions have been provided.") | ||
| return | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same hobbyhorse here to take or leave.
| /// Pass in `true` to expand the actions (typically only used when deleting the row) | ||
| /// or `false` to collapse them. | ||
| public typealias CompletionHandler = (_ expandActions: Bool) -> Void | ||
| public typealias OnDidPerformAction = (OnDidPerformActionAnimation) -> Void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but nice updates!
* origin/main: Prep 11.0 release Paged list layouts now support using bounds, instead of itemInsets. Prep 10.3.1 release Update CHANGELOG iOS 17.0b1 first responder changes
|
Note, build is failing due to something around xrOS: XcodesOrg/XcodesApp#401 |
* origin/main: Swipe Action Updates (#489)
…rovements * origin/main: (123 commits) Update CHANGELOG.md (#508) Revert "Supplementary Tracking Fixes (#433)" Revert "Force layout before appear, to avoid animated updates (#505)" Force layout before appear, to avoid animated updates (#505) Update workaround versions (#506) Fix supplementary view + contained first responder reuse issue (#507) Supplementary Tracking Fixes (#433) Release 13.0.0 (#504) Update KeyboardObserver (#499) CONV-1435: Gravity layout frame change fix - Before: Layout gravity doesn't take into account frame changes. For example, when the orientation changes the scroll position (relative to the bottom) changes - After: Layout gravity takes frame changes into account so the when the frame changes the scroll position relative to the bottom remains unchanged Release 12.0.0 (#501) CONV-1435: Add scroll indicator insets to customScrollViewInsets (#500) CONV-1435: Gravity layout - Adds a new Chat App demo and a new behavior called verticalLayoutGravity. When verticalLayoutGravity is set to bottom, scrolling works the way you would expect for a messaging app. expose onKeyboardFrameWillChange on ListProperties onKeyboardFrameWillChange: Improve CHANGELOG, DocC CONV-1435: Custom keyboard adjustment mode - Adds a .custom KeyboardAdjustmentMode to fully customize inset behavior remove contentOffset from isContentScrollable calculation, improve comment Add ListView#isContentScrollable property - Add this property to ListView. It will be used in conjunction with upcoming so-called gravity scrolling changes to workaround an animation issue with paging Update CI script to reference the `xcodesorg/made/xcodes` package for installing simulator runtimes. (#494) Swipe Action Updates (#489) ...
A few changes I need for the delete button work in Market:
Apply*Infoto theBlueprintEnvironment: This allows us to magically wire up tapping the remove button exposes the swipe actions in the Market implementation: https://github.com/squareup/market/pull/6261SwipeActionproperty andtypealiasnames to align better with what each actually does.true/falseflag passed to the swipe action completion with an enum, so it's clear from the callsite what the argument is actually for.Checklist
Please do the following before merging:
Mainsection.