<?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: Label color - dark mode support? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/label-color-dark-mode-support/m-p/317541#M2796</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We don't have a way to lean on UIKit system colors (one of the side-effects of having a cross-platform core to the Runtime).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While you should be able to manually modify the labels,&amp;nbsp;we don't have an API for this yet. But if you're willing to tinker with some JSON you should be able to get this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On an AGSFeatureLayer there is a &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_layer.html#a8e09614cade89e1a7ee537aa33485ae6"&gt;&lt;STRONG&gt;labelDefinitions&lt;/STRONG&gt;&lt;/A&gt; property. This is an array of &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_label_definition.html"&gt;&lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt;&lt;/A&gt; objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could call &lt;STRONG&gt;toJSON&lt;/STRONG&gt; on each &lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt; in that array, modify the appropriate symbol color and then create a new &lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt; from the modified JSON using &lt;STRONG&gt;AGSLabelDefinition.fromJSON&lt;/STRONG&gt;, and replace the definition in the &lt;STRONG&gt;labelDefinitions&lt;/STRONG&gt; array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's messy but should work. We're working on fleshing out these APIs in future releases, but for now ask that you get the JSON and work with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Jan 2020 00:47:41 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2020-01-29T00:47:41Z</dc:date>
    <item>
      <title>Label color - dark mode support?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/label-color-dark-mode-support/m-p/317540#M2795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a mechanism available to set the label color for a feature class to SystemDefault or one of the other dark mode-aware system colors?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not is there a way to update the label definition to switch colors when traitCollectionDidChange is fired?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've wired up some of our apps to automatically switch to the dark vector map when users toggle on dark mode, but unfortunately it makes the labels unreadable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 20:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/label-color-dark-mode-support/m-p/317540#M2795</guid>
      <dc:creator>MichaelDavis3</dc:creator>
      <dc:date>2020-01-23T20:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Label color - dark mode support?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/label-color-dark-mode-support/m-p/317541#M2796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We don't have a way to lean on UIKit system colors (one of the side-effects of having a cross-platform core to the Runtime).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While you should be able to manually modify the labels,&amp;nbsp;we don't have an API for this yet. But if you're willing to tinker with some JSON you should be able to get this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On an AGSFeatureLayer there is a &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_feature_layer.html#a8e09614cade89e1a7ee537aa33485ae6"&gt;&lt;STRONG&gt;labelDefinitions&lt;/STRONG&gt;&lt;/A&gt; property. This is an array of &lt;A href="https://developers.arcgis.com/ios/latest/api-reference/interface_a_g_s_label_definition.html"&gt;&lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt;&lt;/A&gt; objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could call &lt;STRONG&gt;toJSON&lt;/STRONG&gt; on each &lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt; in that array, modify the appropriate symbol color and then create a new &lt;STRONG&gt;AGSLabelDefinition&lt;/STRONG&gt; from the modified JSON using &lt;STRONG&gt;AGSLabelDefinition.fromJSON&lt;/STRONG&gt;, and replace the definition in the &lt;STRONG&gt;labelDefinitions&lt;/STRONG&gt; array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's messy but should work. We're working on fleshing out these APIs in future releases, but for now ask that you get the JSON and work with that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 00:47:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/label-color-dark-mode-support/m-p/317541#M2796</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2020-01-29T00:47:41Z</dc:date>
    </item>
  </channel>
</rss>

