Merge pull request #2924 from AlphaWallet/improve-encapsulation

Improve encapsulation
pull/2930/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit e02ffc0690
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      AlphaWallet/Core/Views/BlockieImageView.swift
  2. 2
      AlphaWallet/Tokens/ViewControllers/TokensViewController.swift

@ -10,7 +10,7 @@ import UIKit
class BlockieImageView: UIView {
private var subscriptionKey: Subscribable<BlockiesImage>.SubscribableKey?
private (set) var button: UIButton = {
private var button: UIButton = {
let imageView = UIButton()
imageView.contentMode = .scaleAspectFit
return imageView
@ -43,7 +43,7 @@ class BlockieImageView: UIView {
button.setImage(newValue, for: .normal)
}
}
convenience init() {
self.init(frame: .zero)
}
@ -71,5 +71,8 @@ class BlockieImageView: UIView {
layer.cornerRadius = frame.width / 2.0
}
func addTarget(_ target: Any?, action: Selector, for controlEvents: UIControl.Event) {
button.addTarget(target, action: action, for: controlEvents)
}
}

@ -250,7 +250,7 @@ class TokensViewController: UIViewController {
}
strongSelf.tableView.reloadData()
}
blockieImageView.button.addTarget(self, action: #selector(blockieButtonSelected), for: .touchUpInside)
blockieImageView.addTarget(self, action: #selector(blockieButtonSelected), for: .touchUpInside)
}
override func viewWillAppear(_ animated: Bool) {

Loading…
Cancel
Save