<?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 Re: 'featureLayer' is deprecated: Use 'layer' instead in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/featurelayer-is-deprecated-use-layer-instead/m-p/1176406#M7384</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_table.html#a3e88d5da0b6b1c3894b7e2e32440c719" target="_blank"&gt;deprecated &lt;STRONG&gt;featureLayer&lt;/STRONG&gt; property&lt;/A&gt; is of type &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html" target="_self"&gt;AGSFeatureLayer&lt;/A&gt;&lt;/STRONG&gt;, whereas the &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_table.html#a057326e4ef810c14691952aa97e33ae1" target="_blank"&gt;layer&lt;/A&gt;&lt;/STRONG&gt; property that the deprecation warning tells you to use is of type &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_layer.html" target="_blank"&gt;AGSLayer&lt;/A&gt;&lt;/STRONG&gt;. We had to make this change when we introduced Dimension and Annotation layers. You need to cast to AGSFeatureLayer.&lt;/P&gt;&lt;P&gt;Something like this will work:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let pointSymbol: AGSMultilayerPointSymbol = (feature.featureTable?.layer as? AGSFeatureLayer)?.renderer?.symbol(for: feature) as! AGSMultilayerPointSymbol&lt;/LI-CODE&gt;&lt;P&gt;However, the use of a forced unwrap at the end is a bit unnerving to me - it will crash your app if the layer's renderer symbol changes from a AGSMultilayerPointSymbol to some other symbol type (perhaps if the map is authored differently). You might consider something like this:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;func drawCallout(_ feature: AGSFeature) {
    let e: AGSEnvelope = (feature.geometry?.extent)!
    let p: AGSPoint = e.center
    guard let mapView = self.mapView,
          let pointSymbol: AGSMultilayerPointSymbol = (feature.featureTable?.layer as? AGSFeatureLayer)?.renderer?.symbol(for: feature) as? AGSMultilayerPointSymbol else { return }
    var screenPoint: CGPoint = mapView.location(toScreen: p)
    screenPoint.y -= pointSymbol.size/2
    let newp: AGSPoint = mapView.screen(toLocation: screenPoint)
    mapView.callout.show(for: feature, tapLocation: newp, animated: true)
}&lt;/LI-CODE&gt;&lt;P&gt;However, just the first change will work if you're confident your original code is safe.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 14:05:13 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2022-05-23T14:05:13Z</dc:date>
    <item>
      <title>'featureLayer' is deprecated: Use 'layer' instead</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/featurelayer-is-deprecated-use-layer-instead/m-p/1176279#M7382</link>
      <description>&lt;P&gt;Hi, I received this warning on my old app, how do I resolve it if my usage is like this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;func drawCallout(_ feature: AGSFeature) {
          let e: AGSEnvelope = (feature.geometry?.extent)!
          let p: AGSPoint = e.center
          let pointSymbol: AGSMultilayerPointSymbol = (feature.featureTable?.featureLayer?.renderer?.symbol(for: feature)) as! AGSMultilayerPointSymbol
          var screenPoint: CGPoint = (self.mapView as! AGSMapView).location(toScreen: p)
          screenPoint.y -= pointSymbol.size/2
          let newp: AGSPoint = (self.mapView as! AGSMapView).screen(toLocation: screenPoint)
          (self.mapView as! AGSMapView).callout.show(for: feature, tapLocation: newp, animated: true)
     }&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;I cant see the renderer completion for the new 'layer' instead of 'featureLayer'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 03:54:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/featurelayer-is-deprecated-use-layer-instead/m-p/1176279#M7382</guid>
      <dc:creator>VinceCarloSantos</dc:creator>
      <dc:date>2022-05-23T03:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: 'featureLayer' is deprecated: Use 'layer' instead</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/featurelayer-is-deprecated-use-layer-instead/m-p/1176406#M7384</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;The &lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_table.html#a3e88d5da0b6b1c3894b7e2e32440c719" target="_blank"&gt;deprecated &lt;STRONG&gt;featureLayer&lt;/STRONG&gt; property&lt;/A&gt; is of type &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_layer.html" target="_self"&gt;AGSFeatureLayer&lt;/A&gt;&lt;/STRONG&gt;, whereas the &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_feature_table.html#a057326e4ef810c14691952aa97e33ae1" target="_blank"&gt;layer&lt;/A&gt;&lt;/STRONG&gt; property that the deprecation warning tells you to use is of type &lt;STRONG&gt;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_layer.html" target="_blank"&gt;AGSLayer&lt;/A&gt;&lt;/STRONG&gt;. We had to make this change when we introduced Dimension and Annotation layers. You need to cast to AGSFeatureLayer.&lt;/P&gt;&lt;P&gt;Something like this will work:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let pointSymbol: AGSMultilayerPointSymbol = (feature.featureTable?.layer as? AGSFeatureLayer)?.renderer?.symbol(for: feature) as! AGSMultilayerPointSymbol&lt;/LI-CODE&gt;&lt;P&gt;However, the use of a forced unwrap at the end is a bit unnerving to me - it will crash your app if the layer's renderer symbol changes from a AGSMultilayerPointSymbol to some other symbol type (perhaps if the map is authored differently). You might consider something like this:&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;func drawCallout(_ feature: AGSFeature) {
    let e: AGSEnvelope = (feature.geometry?.extent)!
    let p: AGSPoint = e.center
    guard let mapView = self.mapView,
          let pointSymbol: AGSMultilayerPointSymbol = (feature.featureTable?.layer as? AGSFeatureLayer)?.renderer?.symbol(for: feature) as? AGSMultilayerPointSymbol else { return }
    var screenPoint: CGPoint = mapView.location(toScreen: p)
    screenPoint.y -= pointSymbol.size/2
    let newp: AGSPoint = mapView.screen(toLocation: screenPoint)
    mapView.callout.show(for: feature, tapLocation: newp, animated: true)
}&lt;/LI-CODE&gt;&lt;P&gt;However, just the first change will work if you're confident your original code is safe.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 14:05:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/featurelayer-is-deprecated-use-layer-instead/m-p/1176406#M7384</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2022-05-23T14:05:13Z</dc:date>
    </item>
  </channel>
</rss>

