Add + Update screen : PlayMusic
This commit is contained in:
+17
@@ -37,6 +37,7 @@ class Button: UIButton {
|
||||
|
||||
/// Simple tap implementation
|
||||
typealias Closure = () -> ()
|
||||
typealias ClosureClick = (_ down: Bool) -> ()
|
||||
|
||||
|
||||
class ClosureSleeve {
|
||||
@@ -59,5 +60,21 @@ extension UIControl {
|
||||
sleeve,
|
||||
objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN)
|
||||
}
|
||||
|
||||
func tapClassic(_ closure: @escaping ClosureClick) {
|
||||
self.tap(for: .touchDown) { // [weak self] in
|
||||
closure(true)
|
||||
}
|
||||
self.tap(for: .touchUpInside) { // [weak self] in
|
||||
closure(false)
|
||||
}
|
||||
self.tap(for: .touchUpOutside) { // [weak self] in
|
||||
closure(false)
|
||||
}
|
||||
self.tap(for: .touchCancel) { // [weak self] in
|
||||
closure(false)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user