mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
571 B
Swift
33 lines
571 B
Swift
7 years ago
|
//
|
||
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import UIKit
|
||
|
|
||
|
@objc
|
||
|
public class OWSButton: UIButton {
|
||
|
|
||
|
@objc
|
||
|
var block: () -> Void = { }
|
||
|
|
||
|
// MARK: -
|
||
|
|
||
|
@objc
|
||
|
init(block: @escaping () -> Void = { }) {
|
||
|
super.init(frame: .zero)
|
||
|
self.block = block
|
||
|
self.addTarget(self, action: #selector(didTap), for: .touchUpInside)
|
||
|
}
|
||
|
|
||
|
required init?(coder aDecoder: NSCoder) {
|
||
|
fatalError("init(coder:) has not been implemented")
|
||
|
}
|
||
|
|
||
|
// MARK: -
|
||
|
|
||
|
@objc
|
||
|
func didTap() {
|
||
|
block()
|
||
|
}
|
||
|
}
|