Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestClass {
- @objc static func testFunction() {
- print("testFunction")
- }
- }
- // MARK: - Назначаете:
- yourButton.addTarget(TestClass.self, action: #selector(TestClass.testFunction), for: .touchUpInside)
- class CustomButton: UIButton {
- override func awakeFromNib() {
- super.awakeFromNib()
- addTarget(self, action: #selector(buttonAction), for: .touchUpInside)
- }
- @objc func buttonAction() {
- print("Test")
- }
- }
Add Comment
Please, Sign In to add comment