From cac5fdd8a8f9387d989e09cabd876649572c96e8 Mon Sep 17 00:00:00 2001 From: Hwee-Boon Yar Date: Mon, 5 Oct 2020 12:52:44 +0800 Subject: [PATCH] Fix: TokenScript view for token view was not scrolling --- .../TokenInstanceViewController.swift | 1 + AlphaWallet/UI/Views/TokenCardRowView.swift | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/AlphaWallet/Tokens/ViewControllers/TokenInstanceViewController.swift b/AlphaWallet/Tokens/ViewControllers/TokenInstanceViewController.swift index de8ac3283..7d2db338b 100644 --- a/AlphaWallet/Tokens/ViewControllers/TokenInstanceViewController.swift +++ b/AlphaWallet/Tokens/ViewControllers/TokenInstanceViewController.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 }() } diff --git a/AlphaWallet/UI/Views/TokenCardRowView.swift b/AlphaWallet/UI/Views/TokenCardRowView.swift index 720a484db..87da01436 100644 --- a/AlphaWallet/UI/Views/TokenCardRowView.swift +++ b/AlphaWallet/UI/Views/TokenCardRowView.swift @@ -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