Fix: TokenScript view for token view was not scrolling

pull/2183/head
Hwee-Boon Yar 4 years ago
parent 866b81a1c6
commit cac5fdd8a8
  1. 1
      AlphaWallet/Tokens/ViewControllers/TokenInstanceViewController.swift
  2. 14
      AlphaWallet/UI/Views/TokenCardRowView.swift

@ -205,6 +205,7 @@ class TokenInstanceViewController: UIViewController, TokenVerifiableStatusViewCo
rowView = {
let view = TokenCardRowView(server: .main, tokenView: .view, showCheckbox: false, assetDefinitionStore: assetDefinitionStore)
view.isStandalone = true
view.tokenScriptRendererView.isWebViewInteractionEnabled = true
return view
}()
}

@ -44,13 +44,6 @@ class TokenCardRowView: UIView, TokenCardRowViewProtocol {
}
}
}
lazy private var tokenScriptRendererView: TokenInstanceWebView = {
//TODO pass in keystore or wallet address instead
let walletAddress = EtherKeystore.current!.address
let webView = TokenInstanceWebView(server: server, walletAddress: walletAddress, assetDefinitionStore: assetDefinitionStore)
webView.delegate = self
return webView
}()
//These are necessary because non-TokenScript views have margins whereas TokenScript views doesn't
private var constraintsWithLeadingMarginsThatDependsOnWhetherTokenScriptIsUsed: [NSLayoutConstraint] = []
@ -63,6 +56,13 @@ class TokenCardRowView: UIView, TokenCardRowViewProtocol {
var checkboxImageView = UIImageView(image: R.image.ticket_bundle_unchecked())
var stateLabel = UILabel()
var tokenView: TokenView
lazy var tokenScriptRendererView: TokenInstanceWebView = {
//TODO pass in keystore or wallet address instead
let walletAddress = EtherKeystore.current!.address
let webView = TokenInstanceWebView(server: server, walletAddress: walletAddress, assetDefinitionStore: assetDefinitionStore)
webView.delegate = self
return webView
}()
var showCheckbox: Bool {
didSet {
checkboxImageView.isHidden = !showCheckbox

Loading…
Cancel
Save