Skip to content

一款好用的QQ附近、探探卡片堆叠布局,可以设置堆叠和循环效果。

License

Notifications You must be signed in to change notification settings

CocoaJerry/CardView

 
 

Repository files navigation

GXCardView

卡片式布局(探探附近/QQ配对),可以设置卡片堆叠效果,可以设置循环效果。 有建议可以联系QQ交流群:1101980843,喜欢就给个star哦,谢谢关注!

先上demo菜单效果

Requirements

Usage in you Podfile:

pod 'GXCardView-Swift'
pod 'GXCardView'

GXCardViewDataSource

func numberOfItems(in cardView: GXCardView) -> Int
func cardView(_ cardView: GXCardView, cellForItemAt indexPath: IndexPath) -> GXCardCell

GXCardViewDelegate

@objc optional func cardView(_ cardView: GXCardView, didSelectItemAt index: Int)
@objc optional func cardView(_ cardView: GXCardView, didRemove cell: GXCardCell, forItemAt index: Int, direction: GXCardCell.SwipeDirection)
@objc optional func cardView(_ cardView: GXCardView, didRemoveLast cell: GXCardCell, forItemAt index: Int, direction: GXCardCell.SwipeDirection)
@objc optional func cardView(_ cardView: GXCardView, didDisplay cell: GXCardCell, forItemAt index: Int)
@objc optional func cardView(_ cardView: GXCardView, didMove cell: GXCardCell, forItemAt index: Int, move point: CGPoint, direction: GXCardCell.SwipeDirection)

可以设置参数

/// 卡片可见数量(默认3)
 open var visibleCount: Int = 3
 /// 卡片与卡片之间的insets(从上至下,正负皆可)
 open var cardInsets: UIEdgeInsets = UIEdgeInsets(top: 10, left: 10, bottom: -10, right: 10)
 /// 侧滑最大角度(默认15°)
 open var maxAngle: CGFloat = 15.0
 /// 是否重复(默认false)
 open var isRepeat: Bool = false
 /// 最大移除距离(默认屏幕的1/4)
 open var maxRemoveDistance: CGFloat = GX_ScreenWidth * 0.25
 /// 是否需要移除动画结束才可以再次拖拽
 open var isPanAnimatedEnd: Bool = false

License

MIT

About

一款好用的QQ附近、探探卡片堆叠布局,可以设置堆叠和循环效果。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 97.3%
  • Ruby 2.7%