<?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 Getting Elevation completion handlers results none in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-elevation-completion-handlers-results-none/m-p/1149445#M7267</link>
    <description>&lt;P&gt;Hi Ive been trying to get an elevation based on a point. here is my code, but the get elevation part dont respond to the completion handler&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let surface = AGSSurface()
                // Create an elevation source.
                let elevationURL = URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")
                let elevationSource = AGSArcGISTiledElevationSource(url: elevationURL!)
                surface.elevationSources.append(elevationSource)
                elevationSource.load { error in
                    if error == nil {
                        // Add the elevation source to the surface.
                        surface.elevation(for: hasCurrentPoint) { elevation, error in
                            print("vince!!!")
                        }
                    }
                }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 05:32:32 GMT</pubDate>
    <dc:creator>VinceCarloSantos</dc:creator>
    <dc:date>2022-03-02T05:32:32Z</dc:date>
    <item>
      <title>Getting Elevation completion handlers results none</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-elevation-completion-handlers-results-none/m-p/1149445#M7267</link>
      <description>&lt;P&gt;Hi Ive been trying to get an elevation based on a point. here is my code, but the get elevation part dont respond to the completion handler&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let surface = AGSSurface()
                // Create an elevation source.
                let elevationURL = URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")
                let elevationSource = AGSArcGISTiledElevationSource(url: elevationURL!)
                surface.elevationSources.append(elevationSource)
                elevationSource.load { error in
                    if error == nil {
                        // Add the elevation source to the surface.
                        surface.elevation(for: hasCurrentPoint) { elevation, error in
                            print("vince!!!")
                        }
                    }
                }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 05:32:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-elevation-completion-handlers-results-none/m-p/1149445#M7267</guid>
      <dc:creator>VinceCarloSantos</dc:creator>
      <dc:date>2022-03-02T05:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Elevation completion handlers results none</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-elevation-completion-handlers-results-none/m-p/1149569#M7269</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/566170"&gt;@VinceCarloSantos&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I'm betting that the AGSSurface() is deallocated before the completion block is called. Just set up an instance level variable to hold on to the surface.&lt;/P&gt;&lt;P&gt;Incidentally, you don't need to explicitly call load(). When you call any asynchronous method on a loadable object, we'll automatically load it if it isn't already loaded. That can help to make your code a little cleaner.&lt;/P&gt;&lt;P&gt;You can start to avoid these sorts of issues by adopting Swift Concurrency. You can read more about that in &lt;A href="https://community.esri.com/t5/arcgis-runtime-sdks-blog/swift-concurrency-and-runtime/ba-p/1118809" target="_blank"&gt;this blog post&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;P&gt;Nick.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 14:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/getting-elevation-completion-handlers-results-none/m-p/1149569#M7269</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2022-03-02T14:44:21Z</dc:date>
    </item>
  </channel>
</rss>

