Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>So, to help others, I will post how I (with help from Apple) solved this.</p> <p>In both root and detail view controllers, I added in styles based on user settings:</p> <p>"Warm Tones", "Cool Tones", "Leather" etc. These translate to code like this:</p> <pre><code>switch (styleKey) { case 0: // BASIC fontName = @"Copperplate"; fontSize = 16; selectedBarColor = [UIColor lightGrayColor]; selectedTintColor = [UIColor lightGrayColor]; selectedFontColor = [UIColor darkGrayColor]; backgroundColor = [UIColor whiteColor]; selectedHighlightColor = UITableViewCellSelectionStyleGray; backgroundImage = nil; detailBackgroundImage = nil; break; </code></pre> <p>Then, whenever a color/style/font is called, I used something like this:</p> <pre><code>cell.selectionStyle = selectedHighlightColor; cell.backgroundColor = backgroundColor; </code></pre> <p>This allowed me to change the settings and styles, but I still had to restart the app each time to see the changes.</p> <p>The fix turned out to be simple.</p> <p>Settings the styles changed the values of the constants (e.g. fontColor) - but I wasn't actually changing the fields.</p> <p>So at the end of the switch statements, all I added was something like this:</p> <pre><code>self.tableView.backgroundColor = backgroundColor; self.navigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:backgroundImage]]; self.navigationController.navigationBar.tintColor = selectedBarColor; self.tableView.separatorColor = selectedTintColor; </code></pre> <p>I had to do this in both view controllers.</p> <p>Also, all this code was part of a routine (changeSettings).</p> <p>This method is being observed to look for changes.</p> <p>The way I handled the in-app preference look and feel (a modal VC) was to use the terrific <a href="http://www.inappsettingskit.com/" rel="nofollow">InAppSettingsKit</a>.</p> <p>I hope this helps others. Most of you will find this a no-brainer I expect, but - having not much brain left - it took me two weeks to figure it out.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload