/
sberpay
/
AgeGate-iOS
Обзор
Документация
Войти
/
sberpay
/
AgeGate-iOS
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
AgeGateExample/CustomView/ActionButton.swift
43 строки
1 KB
SergeyGladkiy
[0.2.0] БДСЧ сценарий
30 июл 2026, 21:57
30 июл 2026, 21:57
cbcdfcb
Код
Авторство
О чём код?
// // ActionButton.swift // AgeGateExample // // Created by Гладкий Сергей Игоревич on 24.07.2026. // import UIKit final class ActionButton: UIButton { private var action: (() -> Void)? init() { super.init(frame: .zero) setupUI() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } func config(title: String, subtitle: String? = nil, action: @escaping () -> Void) { var config = UIButton.Configuration.filled() config.title = title config.subtitle = subtitle config.cornerStyle = .large config.baseBackgroundColor = .systemGreen configuration = config self.action = action } private func setupUI() { translatesAutoresizingMaskIntoConstraints = false heightAnchor.constraint(equalToConstant: 56).isActive = true addTarget(self, action: #selector(tapped), for: .touchUpInside) } @objc private func tapped() { action?() } }