O-O-wl / SwiftAction

TargetAction Expressed Swift by removing @objc ⚡️🥊

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftAction

build pod build platform license

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

SwiftAction is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'SwiftAction'

Usage

  • addAction
       button.addAction(for: .touchDown) {
           $0.backgroundColor = .red
       }
       
       button.addAction(for: .touchUpInside) {
           $0.backgroundColor = .blue
       }
       
       button.addAction(for: .touchDragInside, action: buttonDragInside)
  • removeAction
   deinit {
       UIControl.Event.all.forEach {
           self.button.removeAction(for: $0)
       }
   }

Author

O-O-wl, o.o.wl.soft@gmail.com

License

SwiftAction is available under the MIT license. See the LICENSE file for more info.

About

TargetAction Expressed Swift by removing @objc ⚡️🥊

License:MIT License


Languages

Language:Swift 89.0%Language:Ruby 11.0%