PanGestureView 0.2

PanGestureView 0.2

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2016年8月
SPM支持 SPM

Arvindh Sukumar 维护。




  • Arvindh Sukumar

PanGestureView 允许您在用户拖动视图时附加自定义操作。想象一下它是一个可滑动 UITableViewCell,但作为通用的 UIView。

GIF 1

安装

使用 Cocoapods 安装: pod 'PanGestureView', '~> 0.1'

使用方法

将 PanGestureView 的一个实例添加为任何视图的子视图。您需要的其他任何子视图都可以添加到 PanGestureView 的 contentView 中。

动作可以添加如下

let action = PanGestureAction(swipeDirection: PanGestureViewSwipeDirection.Right, image: UIImage(named: ...)!)

// BG color of the actionView
action.backgroundColor = UIColor(...)

// Tint color of the provided UIImage. Images are automatically converted to their template versions using `imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)`
action.tintColor = UIColor(...)

// Trigger handling
action.didTriggerBlock = {
    direction in

    // Handle action

}

panGestureView.addAction(action)

每个滑动方向支持一个动作。

许可证

PanGestureView 在 MIT 许可证下可用。