![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/bitwit/BWSwipeRevealCell
**Note: Use version 1.0.1 for Swift 2.3 support and version 2.0.0 or higher for Swift 3 support **
There are two main classes available - BWSwipeCell
and BWSwipeRevealCell
BWSwipeCell - Only contains the pan gesture handling, and is useful mainly for heavy customization through subclassing if all you need is a leg up on swipe interactions
BWSwipeRevealCell - Is an out of the box solution that lets you set images and colors for 1 action on the left and right of the table cell. BWSwipeRevealCell is a subclass of BWSwipeCell.
After setting BWSwipeRevealCell
as your table cell's type in the storyboard and setting a delegate. Use this code in your controller:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! BWSwipeRevealCell
swipeCell.bgViewLeftImage = UIImage(named:"Done")!.withRenderingMode(.alwaysTemplate)
swipeCell.bgViewLeftColor = UIColor.green
swipeCell.bgViewRightImage = UIImage(named:"Delete")!.withRenderingMode(.alwaysTemplate)
swipeCell.bgViewRightColor = UIColor.red
swipeCell.type = .springRelease
swipeCell.delegate = self // Or whatever your delegate might be
return cell
}
var type:BWSwipeCellType
Can be .springRelease
, .swipeThrough
or .slidingDoor
. Defaults to .springRelease
var revealDirection: BWSwipeCellRevealDirection
Can be .both
, .left
or .right
. Defaults to .both
(readonly) var state: BWSwipeCellState
Can be .normal
, .pastThresholdLeft
or .pastThresholdRight
var threshold: CGFloat
The point at which pan elasticity starts, and state
changes. Defaults to the height of the UITableViewCell
(i.e. when it form a perfect square)
(readonly) var progress:CGFloat
A number between 0 and 1 to indicate progress toward reaching threshold in the current swiping direction. Useful for changing UI gradually as the user swipes.
var shouldExceedThreshold: Bool
Control whether or not the cell pans past the threshold point
var panElasticityFactor: CGFloat
Control how much elasticity there is past threshold, if it can be exceeded. Default is 0.7
and 1.0
would mean no elastic resistance
var animationDuration: Double
Animation duration. Defaults to 0.2
weak var delegate: BWSwipeCellDelegate?
Set the delegate on the cell
@objc public protocol BWSwipeCellDelegate: NSObjectProtocol {
optional func swipeCellDidStartSwiping(cell: BWSwipeCell)
optional func swipeCellDidSwipe(cell: BWSwipeCell)
optional func swipeCellWillRelease(cell: BWSwipeCell)
optional func swipeCellDidCompleteRelease(cell: BWSwipeCell)
optional func swipeCellDidChangeState(cell: BWSwipeCell)
}
var bgViewInactiveColor: UIColor
var bgViewLeftColor: UIColor
var bgViewRightColor: UIColor
Colors for inactive, and activated states for left and right
var bgViewLeftImage: UIImage?
var bgViewRightImage: UIImage?
Images for the left and right actions
weak var delegate: BWSwipeRevealCellDelegate?
@objc public protocol BWSwipeRevealCellDelegate:BWSwipeCellDelegate {
optional func swipeCellActivatedAction(cell: BWSwipeCell, isActionLeft: Bool)
}
Set the delegate on the cell
Some brief ideas on ways to improve this library
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.