Skip to content

为View添加拓展,实现单击,双击,长按,滑动事件.

Notifications You must be signed in to change notification settings

WangLiquan/EWViewTappedExtension

Repository files navigation

EWViewTappedExtension

996.icu

使用拓展与runtime,为UIView添加手势事件

使用方法:

将UIView+TappedExtension.swift文件拖入项目,调用时:

tapView.whenTapped {
    EWToast.showTopWithText(text: "点击事件", duration: 1)
}
tapView.whenUpSwiped {
    EWToast.showCenterWithText(text: "上滑事件", duration: 1)
}
tapView.whenLeftSwiped {
    EWToast.showCenterWithText(text: "左滑事件", duration: 1)
}
tapView.whenRightSwiped {
    EWToast.showCenterWithText(text: "右滑事件", duration: 1)
}
tapView.whenDownSwiped {
    EWToast.showCenterWithText(text: "下滑事件", duration: 1)
}
tapView.whenLongPressed {
    EWToast.showCenterWithText(text: "长按事件", duration: 1)
}
tapView.whenDoubleTapped {
    EWToast.showBottomWithText(text: "双击事件", duration: 1)
}

效果图预览

About

为View添加拓展,实现单击,双击,长按,滑动事件.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages