<?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 'init() is unavailable' when i instant AGSItem in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/init-is-unavailable-when-i-instant-agsitem/m-p/1131777#M7255</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="截屏2022-01-08 下午12.52.22.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31035i1C0A1818CEF4CCA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="截屏2022-01-08 下午12.52.22.png" alt="截屏2022-01-08 下午12.52.22.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;xcode:13.1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;macOS:12.1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;有人可以帮我解答吗？谢谢&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 08 Jan 2022 05:04:05 GMT</pubDate>
    <dc:creator>jackhh</dc:creator>
    <dc:date>2022-01-08T05:04:05Z</dc:date>
    <item>
      <title>'init() is unavailable' when i instant AGSItem</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/init-is-unavailable-when-i-instant-agsitem/m-p/1131777#M7255</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="截屏2022-01-08 下午12.52.22.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/31035i1C0A1818CEF4CCA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="截屏2022-01-08 下午12.52.22.png" alt="截屏2022-01-08 下午12.52.22.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;xcode:13.1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;macOS:12.1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;FONT&gt;有人可以帮我解答吗？谢谢&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 05:04:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/init-is-unavailable-when-i-instant-agsitem/m-p/1131777#M7255</guid>
      <dc:creator>jackhh</dc:creator>
      <dc:date>2022-01-08T05:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: 'init() is unavailable' when i instant AGSItem</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/init-is-unavailable-when-i-instant-agsitem/m-p/1131783#M7257</link>
      <description>&lt;P&gt;Hi Jack,&lt;/P&gt;&lt;P&gt;`AGSItem` is the base class for portal item and local item:&amp;nbsp;&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_item.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/ios/api-reference/interface_a_g_s_item.html&lt;/A&gt;&amp;nbsp;, so you cannot directly initialize that.&lt;/P&gt;&lt;P&gt;Can you explain what is your usecase for initializing a local item? It might come with some local map packages, but I didn't encounter a case that it needs to be instantiated.&lt;/P&gt;&lt;P&gt;You may want to initialize an `AGSPortalItem` instead, if you want to access a resource from ArcGIS Online or Enterprise.&lt;/P&gt;&lt;P&gt;You can refer to this snippet to configure a portal item:&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-ios/blob/3fbca3cd60a87ec15f0df0c0f55531e62d0ee911/arcgis-ios-sdk-samples/Features/Feature%20collection%20layer%20(portal%20item)/FeatureCollectionLayerFromPortalViewController.swift#L36" target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-runtime-samples-ios/blob/3fbca3cd60a87ec15f0df0c0f55531e62d0ee911/arcgis-ios-sdk-samples/Features/Feature%20collection%20layer%20(portal%20item)/FeatureCollectionLayerFromPortalViewController.swift#L36&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say you have a public web map on AGOL, use the following snippet to access it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="swift"&gt;let map = AGSMap(item: AGSPortalItem(
    portal: .arcGISOnline(withLoginRequired: false),
    itemID: "{your-webmap-id}"
))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S. please ask the question in English when possible, so that other folks can better help you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 07:43:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/init-is-unavailable-when-i-instant-agsitem/m-p/1131783#M7257</guid>
      <dc:creator>Ting</dc:creator>
      <dc:date>2022-01-08T07:43:43Z</dc:date>
    </item>
  </channel>
</rss>

