An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alpha-wallet-ios/AlphaWallet/Settings/ViewControllers/WellDoneViewController.swift

62 lines
2.3 KiB

// Copyright SIX DAY LLC. All rights reserved.
import UIKit
enum WellDoneAction {
case other
}
protocol WellDoneViewControllerDelegate: class {
func didPress(action: WellDoneAction, sender: UIView, in viewController: WellDoneViewController)
}
class WellDoneViewController: UIViewController {
weak var delegate: WellDoneViewControllerDelegate?
override func viewDidLoad() {
super.viewDidLoad()
let imageView = UIImageView(image: R.image.mascot_happy())
imageView.translatesAutoresizingMaskIntoConstraints = false
let descriptionLabel = UILabel()
descriptionLabel.translatesAutoresizingMaskIntoConstraints = false
descriptionLabel.text = R.string.localizable.welldoneDescriptionLabelText()
descriptionLabel.font = Fonts.regular(size: Fonts.labelSize)
descriptionLabel.textColor = Colors.darkBlue
descriptionLabel.numberOfLines = 0
descriptionLabel.textAlignment = .center
let otherButton = Button(size: .normal, style: .solid)
otherButton.translatesAutoresizingMaskIntoConstraints = false
otherButton.setTitle(R.string.localizable.welldoneShareLabelText(), for: .normal)
otherButton.addTarget(self, action: #selector(other(_:)), for: .touchUpInside)
let stackView = [
imageView,
//titleLabel,
descriptionLabel,
.spacer(height: 10),
.spacer(),
otherButton,
].asStackView(axis: .vertical, spacing: 10, alignment: .center)
stackView.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .white
view.addSubview(stackView)
NSLayoutConstraint.activate([
stackView.topAnchor.constraint(greaterThanOrEqualTo: view.topAnchor),
stackView.leadingAnchor.constraint(equalTo: view.readableContentGuide.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: view.readableContentGuide.trailingAnchor),
stackView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
stackView.bottomAnchor.constraint(lessThanOrEqualTo: view.bottomAnchor),
otherButton.widthAnchor.constraint(equalToConstant: 240),
])
}
@objc private func other(_ sender: UIView) {
delegate?.didPress(action: .other, sender: sender, in: self)
}
}