Skip to content

Commit

Permalink
readded the didStartEditing
Browse files Browse the repository at this point in the history
Signed-off-by: kcw-grunt <[email protected]>
  • Loading branch information
kcw-grunt committed Jan 15, 2024
1 parent 6026658 commit 1356735
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion litewallet/AddressFieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ struct AddressFieldView: UIViewRepresentable {
}

func updateUIView(_ uiView: UITextField, context _: Context) {
uiView.text = text
DispatchQueue.main.async {
uiView.text = text
}
}

func makeCoordinator() -> Coordinator {
Expand Down
12 changes: 10 additions & 2 deletions litewallet/SendAddressCellView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ struct SendAddressCellView: View {
@ObservedObject
var viewModel = SendAddressCellViewModel()

@State
private var didStartEditing: Bool = false

let actionButtonWidth: CGFloat = 45.0
let textFieldHeight: CGFloat = 45.0

Expand All @@ -20,6 +23,9 @@ struct SendAddressCellView: View {
VStack {
AddressFieldView(placeholder: S.Send.enterLTCAddressLabel.localize(),
text: $viewModel.addressString)
.onTapGesture {
didStartEditing = true
}
.frame(height: textFieldHeight, alignment: .leading)
}
.padding(.leading, swiftUICellPadding)
Expand All @@ -33,9 +39,11 @@ struct SendAddressCellView: View {
HStack {
ZStack {
RoundedRectangle(cornerRadius: 4)
.frame(width: actionButtonWidth, height: 30, alignment: .center)
.frame(width: actionButtonWidth, height: 30,
alignment: .center)
.foregroundColor(Color(UIColor.secondaryButton))
.shadow(color: Color(UIColor.grayTextTint), radius: 3, x: 0, y: 4).padding(.trailing, 3.0)
.shadow(color: Color(UIColor.grayTextTint), radius: 3, x: 0, y: 4)
.padding(.trailing, 3.0)

Text(S.Send.pasteLabel.localize())
.frame(width: actionButtonWidth, height: 30, alignment: .center)
Expand Down
3 changes: 0 additions & 3 deletions litewallet/SendAddressCellViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ class SendAddressCellViewModel: ObservableObject {
@Published
var addressString: String = ""

@Published
var didUpdatePaste: Bool = false

// MARK: - Public Variables

var shouldPasteAddress: (() -> Void)?
Expand Down
1 change: 1 addition & 0 deletions litewallet/SendAddressHostingController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class SendAddressHostingController: UIHostingController<SendAddressCellView> {

init() {
addressString = contentView.viewModel.addressString

super.init(rootView: contentView)
}

Expand Down

0 comments on commit 1356735

Please sign in to comment.