diff --git a/MobileWallet.xcodeproj/project.pbxproj b/MobileWallet.xcodeproj/project.pbxproj index dc691208..06a2eebe 100644 --- a/MobileWallet.xcodeproj/project.pbxproj +++ b/MobileWallet.xcodeproj/project.pbxproj @@ -4125,7 +4125,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 0.30.1; + MARKETING_VERSION = 0.31.0; PRODUCT_BUNDLE_IDENTIFIER = com.tari.wallet; PRODUCT_NAME = "Tari Aurora"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4158,7 +4158,7 @@ "@executable_path/Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 0.30.1; + MARKETING_VERSION = 0.31.0; PRODUCT_BUNDLE_IDENTIFIER = com.tari.wallet; PRODUCT_NAME = "Tari Aurora"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenCollectionView.swift b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenCollectionView.swift index f08989ba..da5bae39 100644 --- a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenCollectionView.swift +++ b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenCollectionView.swift @@ -187,10 +187,12 @@ final class TokenCollectionView: DynamicThemeView { } let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(onTapOutsideAction)) - + let longPressGestureRecogninzer = UILongPressGestureRecognizer(target: self, action: #selector(onLongPressAction)) + collectionView.dataSource = dataSource collectionView.delegate = self collectionView.backgroundView?.addGestureRecognizer(tapGestureRecognizer) + collectionView.backgroundView?.addGestureRecognizer(longPressGestureRecogninzer) self.dataSource = dataSource } @@ -246,6 +248,10 @@ final class TokenCollectionView: DynamicThemeView { textField?.becomeFirstResponder() } + @objc private func onLongPressAction() { + let inputView = collectionView.subviews.first { $0 is TokenInputView } + (inputView as? TokenInputView)?.triggerSystemTextMenu() + } // MARK: - First Responder override func resignFirstResponder() -> Bool { diff --git a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenInputView.swift b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenInputView.swift index e8c3ead5..205e528e 100644 --- a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenInputView.swift +++ b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenInputView.swift @@ -53,6 +53,9 @@ final class TokenInputView: DynamicThemeCollectionCell { view.autocorrectionType = .no view.autocapitalizationType = .none view.spellCheckingType = .no + view.isSecureTextEntry = false + view.isUserInteractionEnabled = true + return view }() @@ -136,6 +139,14 @@ final class TokenInputView: DynamicThemeCollectionCell { onEndEditing?(textField.text ?? "") return textField.resignFirstResponder() } + + public func triggerSystemTextMenu() -> Void { + let menuController = UIMenuController.shared + self.becomeFirstResponder() // Ensure the view is first responder + + // Position the menu over the entire view for example: + menuController.showMenu(from: self, rect: self.bounds) + } } extension TokenInputView: UITextFieldDelegate { diff --git a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenView.swift b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenView.swift index db21efc3..1f267e35 100644 --- a/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenView.swift +++ b/MobileWallet/Screens/RestoreWalletFromSeeds/Views/TokenView.swift @@ -124,7 +124,6 @@ final class TokenView: DynamicThemeCollectionCell { deleteIconView.heightAnchor.constraint(equalToConstant: 14.0), deleteIconView.widthAnchor.constraint(equalToConstant: 14.0) ] - NSLayoutConstraint.activate(constraints) } diff --git a/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift b/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift index ed90569b..8a970fb2 100644 --- a/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift +++ b/MobileWallet/Screens/Send/AddAmount/AddAmountViewController.swift @@ -445,9 +445,9 @@ final class AddAmountViewController: DynamicThemeViewController { if paymentInfo.note != nil { let paymentInfo = PaymentInfo(addressComponents: paymentInfo.addressComponents, alias: paymentInfo.alias, yatID: paymentInfo.yatID, amount: paymentInfo.amount, feePerGram: paymentInfo.feePerGram, note: paymentInfo.note) - TransactionProgressPresenter.showTransactionProgress(presenter: self, paymentInfo: paymentInfo, isOneSidedPayment: oneSidedPaymentSwitch.isOn) + TransactionProgressPresenter.showTransactionProgress(presenter: self, paymentInfo: paymentInfo, isOneSidedPayment: true) }else { - let controller = AddNoteViewController(paymentInfo: paymentInfo, isOneSidedPayment: oneSidedPaymentSwitch.isOn) + let controller = AddNoteViewController(paymentInfo: paymentInfo, isOneSidedPayment: true) navigationController?.pushViewController(controller, animated: true) } } @@ -709,6 +709,8 @@ extension AddAmountViewController { oneSidedPaymentSwitch.isUserInteractionEnabled = false oneSidedPaymentSwitch.isOn = true } + + oneSidedPaymentStackView.isHidden = true } private func setupCallbacks() {