Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Fixed text editing
Browse files Browse the repository at this point in the history
  • Loading branch information
vquach2404 committed Aug 4, 2020
1 parent 5f7979c commit 25daa78
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@ class EditFeaturesWithFeatureLinkedAnnotationViewController: UIViewController, A
// Inflate the edit attribute layout.
let alert = UIAlertController(title: "Edit feature attributes", message: "Edit the 'AD_ADDRESS' and 'ST_STR_NAM' attributes.", preferredStyle: .alert)
alert.addTextField()
alert.addTextField()
alert.textFields?[0].text = String(describing: self.selectedFeature?.attributes["AD_ADDRESS"])
alert.textFields?[1].text = String(describing: self.selectedFeature?.attributes["ST_STR_NAM"])
alert.textFields?[0].keyboardType = .asciiCapable
alert.textFields?[0].text = "\(selectedFeature.attributes["AD_ADDRESS"]!)"
alert.textFields?[1].text = selectedFeature.attributes["ST_STR_NAM"] as? String
alert.textFields?[0].keyboardType = .asciiCapableNumberPad
alert.textFields?[1].keyboardType = .asciiCapable
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel))
alert.addAction(UIAlertAction(title: "Done", style: .default) { _ in
let addressTextField = alert.textFields?[0]
let streetTextField = alert.textFields?[1]
selectedFeature.attributes["AD_ADDRESS"] = addressTextField?.text
selectedFeature.attributes["ST_STR_NAM"] = streetTextField?.text
// self.selectedFeature?.attributes["AD_ADDRESS"] = "146546"
// self.selectedFeature?.attributes["ST_STR_NAM"] = "Wood"
selectedFeature.featureTable?.update(selectedFeature)
})
self.present(alert, animated: true, completion: nil)
Expand Down

0 comments on commit 25daa78

Please sign in to comment.