<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Have 'sketchEditor.start(with:' keep previously drawn graphics when switching between drawing types in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75674#M759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I'm new to Swift and am building a GIS app for IOS to learn more. Part of the app is giving someone the ability to draw temp graphics on top of the map. Right now when I switch between point/polyline/polygon, the graphics for whatever has been previously drawn are removed and I was wondering if there was a way to keep them there until the "CLEAR" button is clicked.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I believe the answer lies in self.sketchEditor.start(with: nil, creationMode: [draw style])&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;The "nil" is wiping out what was there before, but I cannot figure out what I need to replace it with to have it keep any currently drawn graphics.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;Below is my code, any help would be much appreciated.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//&lt;BR /&gt;// ViewController.swift&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&lt;/P&gt;&lt;P&gt;import UIKit&lt;BR /&gt;import ArcGIS&lt;BR /&gt;import MessageUI&lt;/P&gt;&lt;P&gt;class ViewController: UIViewController {&lt;/P&gt;&lt;P&gt;@IBOutlet weak var mapView: AGSMapView!&lt;BR /&gt; @IBOutlet weak var geometrySegmentedControl: UISegmentedControl!&lt;BR /&gt; @IBOutlet weak var undoBBI: UIButton!&lt;BR /&gt; @IBOutlet weak var clearBBI: UIButton!&lt;BR /&gt; &lt;BR /&gt; private var map: AGSMap!&lt;BR /&gt; private var sketchEditor: AGSSketchEditor!&lt;BR /&gt; &lt;BR /&gt; private func setupMap() {&lt;BR /&gt; let itemID = ""&lt;BR /&gt; let portal = AGSPortal(url: URL(string: "https://www.arcgis.com")!, loginRequired: false)&lt;BR /&gt; let portalItem: AGSPortalItem = AGSPortalItem(portal: portal, itemID: itemID)&lt;BR /&gt; mapView.map = AGSMap(item: portalItem)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; private func showAlert(withStatus: String) {&lt;BR /&gt; let alertController = UIAlertController(title: "Alert", message:&lt;BR /&gt; withStatus, preferredStyle: UIAlertController.Style.alert)&lt;BR /&gt; alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertAction.Style.default,handler: nil))&lt;BR /&gt; present(alertController, animated: true, completion: nil)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; func setupLocationDisplay() {&lt;BR /&gt; mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanMode.compassNavigation&lt;BR /&gt; mapView.locationDisplay.start { [weak self] (error:Error?) -&amp;gt; Void in&lt;BR /&gt; if let error = error {&lt;BR /&gt; self?.showAlert(withStatus: error.localizedDescription)&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; override func viewDidLoad() {&lt;BR /&gt; super.viewDidLoad()&lt;BR /&gt; // Do any additional setup after loading the view.&lt;BR /&gt; &lt;BR /&gt; setupMap()&lt;BR /&gt; &lt;BR /&gt; setupLocationDisplay()&lt;BR /&gt; &lt;BR /&gt; let itemID = ""&lt;BR /&gt; let portal = AGSPortal(url: URL(string: "https://www.arcgis.com")!, loginRequired: false)&lt;BR /&gt; let portalItem: AGSPortalItem = AGSPortalItem(portal: portal, itemID: itemID)&lt;BR /&gt; self.map = AGSMap(item: portalItem)&lt;BR /&gt; &lt;BR /&gt; self.sketchEditor = AGSSketchEditor()&lt;BR /&gt; self.mapView.sketchEditor = self.sketchEditor&lt;BR /&gt; &lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .unset)&lt;BR /&gt; &lt;BR /&gt; self.mapView.map = self.map&lt;BR /&gt; self.mapView.interactionOptions.isMagnifierEnabled = false&lt;BR /&gt; &lt;BR /&gt; NotificationCenter.default.addObserver(self, selector: #selector(ViewController.respondToGeomChanged), name: .AGSSketchEditorGeometryDidChange, object: nil)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; @objc&lt;BR /&gt; func respondToGeomChanged() {&lt;BR /&gt; //Enable/disable UI elements appropriately&lt;BR /&gt; self.undoBBI.isSelected = self.sketchEditor.undoManager.canUndo&lt;BR /&gt; self.clearBBI.isSelected = self.sketchEditor.geometry != nil &amp;amp;&amp;amp; !self.sketchEditor.geometry!.isEmpty&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // MARK: - Actions&lt;BR /&gt; &lt;BR /&gt; @IBAction func geometryValueChanged(_ geometrySegmentedControl: UISegmentedControl) {&lt;BR /&gt; switch geometrySegmentedControl.selectedSegmentIndex {&lt;BR /&gt; case 0://multipoint&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .unset)&lt;BR /&gt; &lt;BR /&gt; case 1://freehand polyline&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .freehandPolyline)&lt;BR /&gt; &lt;BR /&gt; case 2://freehand polygon&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .freehandPolygon)&lt;BR /&gt; &lt;BR /&gt; case 3://multipoint&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .multipoint)&lt;BR /&gt; &lt;BR /&gt; default:&lt;BR /&gt; break&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; self.mapView.sketchEditor = self.sketchEditor&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;@IBAction func undo() {&lt;BR /&gt; if self.sketchEditor.undoManager.canUndo { //extra check, just to be sure&lt;BR /&gt; self.sketchEditor.undoManager.undo()&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @IBAction func clear() {&lt;BR /&gt; self.sketchEditor.clearGeometry()&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jan 2020 16:56:23 GMT</pubDate>
    <dc:creator>StephenStrand3</dc:creator>
    <dc:date>2020-01-22T16:56:23Z</dc:date>
    <item>
      <title>Have 'sketchEditor.start(with:' keep previously drawn graphics when switching between drawing types</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75674#M759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I'm new to Swift and am building a GIS app for IOS to learn more. Part of the app is giving someone the ability to draw temp graphics on top of the map. Right now when I switch between point/polyline/polygon, the graphics for whatever has been previously drawn are removed and I was wondering if there was a way to keep them there until the "CLEAR" button is clicked.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;I believe the answer lies in self.sketchEditor.start(with: nil, creationMode: [draw style])&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;The "nil" is wiping out what was there before, but I cannot figure out what I need to replace it with to have it keep any currently drawn graphics.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;Below is my code, any help would be much appreciated.&lt;/P&gt;&lt;P style="color: #242729; background-color: #ffffff; border: 0px; margin: 0px 0px 1em;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//&lt;BR /&gt;// ViewController.swift&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&amp;nbsp;&lt;BR /&gt;//&lt;/P&gt;&lt;P&gt;import UIKit&lt;BR /&gt;import ArcGIS&lt;BR /&gt;import MessageUI&lt;/P&gt;&lt;P&gt;class ViewController: UIViewController {&lt;/P&gt;&lt;P&gt;@IBOutlet weak var mapView: AGSMapView!&lt;BR /&gt; @IBOutlet weak var geometrySegmentedControl: UISegmentedControl!&lt;BR /&gt; @IBOutlet weak var undoBBI: UIButton!&lt;BR /&gt; @IBOutlet weak var clearBBI: UIButton!&lt;BR /&gt; &lt;BR /&gt; private var map: AGSMap!&lt;BR /&gt; private var sketchEditor: AGSSketchEditor!&lt;BR /&gt; &lt;BR /&gt; private func setupMap() {&lt;BR /&gt; let itemID = ""&lt;BR /&gt; let portal = AGSPortal(url: URL(string: "https://www.arcgis.com")!, loginRequired: false)&lt;BR /&gt; let portalItem: AGSPortalItem = AGSPortalItem(portal: portal, itemID: itemID)&lt;BR /&gt; mapView.map = AGSMap(item: portalItem)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; private func showAlert(withStatus: String) {&lt;BR /&gt; let alertController = UIAlertController(title: "Alert", message:&lt;BR /&gt; withStatus, preferredStyle: UIAlertController.Style.alert)&lt;BR /&gt; alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertAction.Style.default,handler: nil))&lt;BR /&gt; present(alertController, animated: true, completion: nil)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; func setupLocationDisplay() {&lt;BR /&gt; mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanMode.compassNavigation&lt;BR /&gt; mapView.locationDisplay.start { [weak self] (error:Error?) -&amp;gt; Void in&lt;BR /&gt; if let error = error {&lt;BR /&gt; self?.showAlert(withStatus: error.localizedDescription)&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; override func viewDidLoad() {&lt;BR /&gt; super.viewDidLoad()&lt;BR /&gt; // Do any additional setup after loading the view.&lt;BR /&gt; &lt;BR /&gt; setupMap()&lt;BR /&gt; &lt;BR /&gt; setupLocationDisplay()&lt;BR /&gt; &lt;BR /&gt; let itemID = ""&lt;BR /&gt; let portal = AGSPortal(url: URL(string: "https://www.arcgis.com")!, loginRequired: false)&lt;BR /&gt; let portalItem: AGSPortalItem = AGSPortalItem(portal: portal, itemID: itemID)&lt;BR /&gt; self.map = AGSMap(item: portalItem)&lt;BR /&gt; &lt;BR /&gt; self.sketchEditor = AGSSketchEditor()&lt;BR /&gt; self.mapView.sketchEditor = self.sketchEditor&lt;BR /&gt; &lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .unset)&lt;BR /&gt; &lt;BR /&gt; self.mapView.map = self.map&lt;BR /&gt; self.mapView.interactionOptions.isMagnifierEnabled = false&lt;BR /&gt; &lt;BR /&gt; NotificationCenter.default.addObserver(self, selector: #selector(ViewController.respondToGeomChanged), name: .AGSSketchEditorGeometryDidChange, object: nil)&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; @objc&lt;BR /&gt; func respondToGeomChanged() {&lt;BR /&gt; //Enable/disable UI elements appropriately&lt;BR /&gt; self.undoBBI.isSelected = self.sketchEditor.undoManager.canUndo&lt;BR /&gt; self.clearBBI.isSelected = self.sketchEditor.geometry != nil &amp;amp;&amp;amp; !self.sketchEditor.geometry!.isEmpty&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; // MARK: - Actions&lt;BR /&gt; &lt;BR /&gt; @IBAction func geometryValueChanged(_ geometrySegmentedControl: UISegmentedControl) {&lt;BR /&gt; switch geometrySegmentedControl.selectedSegmentIndex {&lt;BR /&gt; case 0://multipoint&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .unset)&lt;BR /&gt; &lt;BR /&gt; case 1://freehand polyline&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .freehandPolyline)&lt;BR /&gt; &lt;BR /&gt; case 2://freehand polygon&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .freehandPolygon)&lt;BR /&gt; &lt;BR /&gt; case 3://multipoint&lt;BR /&gt; self.sketchEditor.start(with: nil, creationMode: .multipoint)&lt;BR /&gt; &lt;BR /&gt; default:&lt;BR /&gt; break&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; self.mapView.sketchEditor = self.sketchEditor&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;@IBAction func undo() {&lt;BR /&gt; if self.sketchEditor.undoManager.canUndo { //extra check, just to be sure&lt;BR /&gt; self.sketchEditor.undoManager.undo()&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; @IBAction func clear() {&lt;BR /&gt; self.sketchEditor.clearGeometry()&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 16:56:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75674#M759</guid>
      <dc:creator>StephenStrand3</dc:creator>
      <dc:date>2020-01-22T16:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Have 'sketchEditor.start(with:' keep previously drawn graphics when switching between drawing types</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75675#M760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you work with the Sketch Editor, it maintains a current geometry (could be a point, polyline, polygon, etc. depending on the creationMode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your&amp;nbsp;&lt;STRONG&gt;respondToGeomChanged&lt;/STRONG&gt; function, you can read the &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_sketch_editor.html#a5d9265c06526edc1ef77da89f0a31e16" rel="nofollow noopener noreferrer" target="_blank"&gt;geometry&lt;/A&gt;&lt;/STRONG&gt; property of the &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_sketch_editor.html" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;STRONG&gt;AGSSketchEditor&lt;/STRONG&gt;&lt;/A&gt;. That function will be called whenever the user has changed the sketched geometry in some way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hold on to that &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_geometry.html" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;STRONG&gt;AGSGeometry&lt;/STRONG&gt;&lt;/A&gt;&amp;nbsp;to pass in to the Sketch Editor next time you call &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_sketch_editor.html#a4810a3a1a71b17d4a17fa9097b96bc74" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;STRONG&gt;start(with:creationMode:)&lt;/STRONG&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like your code is from the Sample app. You could try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; previouslySketchedGeometries &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;AGSSketchCreationMode&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;AGSGeometry&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

@objc
func &lt;SPAN class="token function"&gt;respondToGeomChanged&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;//Enable/disable UI elements appropriately&lt;/SPAN&gt;
    undoBBI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEnabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;undoManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;canUndo
    clearBBI&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEnabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; nil &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry&lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isEmpty
    
    &lt;SPAN class="comment token"&gt;// Store the current geometry for this mode&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;isSketchValid &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        previouslySketchedGeometries&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;creationMode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// MARK: - Actions&lt;/SPAN&gt;

@IBAction func &lt;SPAN class="token function"&gt;geometryValueChanged&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_ segmentedControl&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; UISegmentedControl&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; creationMode&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; AGSSketchCreationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;unset
    
    &lt;SPAN class="keyword token"&gt;switch&lt;/SPAN&gt; segmentedControl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;selectedSegmentIndex &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;point
        creationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;point
    &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;polyline
        creationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;polyline
    &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;freehand polyline
        creationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;freehandPolyline
    &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;polygon
        creationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;polygon
    &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;freehand polygon
        creationMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;freehandPolygon
    &lt;SPAN class="keyword token"&gt;default&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
    
    &lt;SPAN class="comment token"&gt;// If we previously drew something for this mode, get hold of it…&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;let&lt;/SPAN&gt; previousGeometryForMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; previouslySketchedGeometries&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;creationMode&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    
    self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sketchEditor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;start&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;with&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; previousGeometryForMode&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; creationMode&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; creationMode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    
    self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sketchEditor &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; self&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sketchEditor
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:55:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75675#M760</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2021-12-10T22:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Have 'sketchEditor.start(with:' keep previously drawn graphics when switching between drawing types</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75676#M761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nicholas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the quick and helpful response. I modified my code with your suggestions and it now saves each type of drawing. There is one hurdle left and that is that when I switch my Segmented Control between the drawing types, it only shows the one that is currently active on the control. I'm going to try and sort that out next, thank you for the huge step forward!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 18:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/have-sketcheditor-start-with-keep-previously-drawn/m-p/75676#M761</guid>
      <dc:creator>StephenStrand3</dc:creator>
      <dc:date>2020-01-22T18:58:56Z</dc:date>
    </item>
  </channel>
</rss>

