Coder Social home page Coder Social logo

taptapuibutton's Introduction

TapTapUIButton

修改Cocoapods源代码!

介绍 Introduce

  • UIButton double click event extension(Objc, swift, xib, selected)
  • iOS按钮双击事件扩展
  • 点赞富一生.

导入(Import)

  • Drag floder UIButton+TapTap.h to your project.
#import "UIButton+TapTap.h"

CocoaPods

pod 'TapTapUIButton'

TapTapUIButton工作原理(How TapTapUIButton works)

  1. 第一次触摸按钮时状态变为isSelected = true,该状态默认持续2s.
  2. 超时后按钮回复原始状态isSelected = false.
  3. 未超时时触摸按钮,触发TapTap事件
  1. When you touch the button for the first time, the status changes to isSelected = true. By default, the status lasts for 2s.
  2. After timeout, the button returns to the original status isSelected = false.
  3. A TapTap event is triggered when a button is touched without timeout.

使用步骤(Steps to use)

  1. 配置按钮normal状态和selected状态下的UI样式
  2. 设置tt_enable为true
  3. 配置回调tt_whenTapTaped:(setTt_whenTapTaped:)或者tt_addTarget:action:
  1. Set the UI style of the button in normal and selected state
  2. Set tt_enable to true
  3. Configure the callback tt_whenTapTaped: or tt_addTarget: action:

在UITableViewCell下工作(Work in UITableViewCell)

  • 在UITableViewCell下使用时,每次cell重新布局时应该调用一次tt_refreshState 。该方法确保按钮的不受cell重用机制的影响。
  • When used UITableViewCell, 'tt_refreshState' should be called each time the cell will dequeue. This method ensures that the button is not affected by the cell reuse mechanism.

在XIB上使用(Use on the XIB)

  • 设置tt_enable为On(Set tt_enable to On) sdl_register

更多(More)

  • 阅读源代码(Read the source code)

Email

taptapuibutton's People

Contributors

meterwhite avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.