WWTouchEffectButton

Swift-5.6 iOS-14.0 TAG Swift Package Manager-SUCCESS LICENSE

Introduction - 简介

Installation with Swift Package Manager

dependencies: [
    .package(url: "https://github.com/William-Weng/WWTouchEffectButton.git", .upToNextMajor(from: "1.0.0"))
]

WWTouchEffectButtonDelegate

函式 功能
touch(_:event:) 点击的事件
longPress(_:state:) 长按的状态

Example

import UIKit
import WWPrint
import WWTouchEffectButton

final class ViewController: UIViewController {
    
    @IBOutlet weak var myTouchEffectButton: WWTouchEffectButton!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        myTouchEffectButton.delegate = self
    }
}

extension ViewController: WWTouchEffectButtonDelegate {
    
    func touch(_ button: WWTouchEffectButton, event: UIControl.Event) {
        wwPrint("event => \(event)")
    }
    
    func longPress(_ button: WWTouchEffectButton, state: UIGestureRecognizer.State) {
        wwPrint("state => \(state)")
    }
}