Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If user pick up colour instead of </p> <pre><code>self.BackgroundView.backgroundColor = [UIColor colorWithRed:248.0/255.0 green:242.0/255.0 blue:229.0/255.0 alpha:1.0]; </code></pre> <p>You can do</p> <pre><code> UIColor *backgroundColor = [UIColor colorWithRed:248.0/255.0 green:242.0/255.0 blue:229.0/255.0 alpha:1.0]; self.BackgroundView.backgroundColor = backgroundColor; NSData *backgroundColorData = [NSKeyedArchiver archivedDataWithRootObject:backgroundColor]; UIColor *tintColor = [UIColor colorWithRed:103.0/255.0 green:10.0/255.0 blue:10.0/255.0 alpha:1.0]; [[[self navigationController] navigationBar] setTintColor:tintColor]; NSData *tintColorData = [NSKeyedArchiver archivedDataWithRootObject: tintColor]; UIColor *textColor = [UIColor colorWithRed:131.0/255.0 green:21.0/255.0 blue:21.0/255.0 alpha:1.0]; self.QuoteText.textColor = textColor; NSData *textColorData = [NSKeyedArchiver archivedDataWithRootObject: textColor]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject: backgroundColorData forKey:@"BACKGCOLOR"]; [defaults setObject:tintColorData forKey:@"TINTCOLOR"]; [defaults setObject:textColorData forKey:@"TEXTCOLOR"]; [defaults synchronize]; </code></pre> <p>You do the same for tint and text colour (just use different key).</p> <p>In the view controller where you want to change your view colour in viewDidLoad you do:</p> <pre><code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSData *backgColorData = [defaults objectForKey:@"BACKGCOLOR"]; UIColor *backgColor = [NSKeyedUnarchiver unarchiveObjectWithData:backgColorData]; NSData *tintColorData = [defaults objectForKey:@"TINTCOLOR"]; UIColor *tintColor = [NSKeyedUnarchiver unarchiveObjectWithData:tintColorData]; NSData *textColorData = [defaults objectForKey:@"TEXTCOLOR"]; UIColor *textColor = [NSKeyedUnarchiver unarchiveObjectWithData: textColorData]; if (backgColor) self.BackgroundView.backgroundColor = backgColor; if (tintColor) [[[self navigationController] navigationBar] setTintColor:tintColor]; if (textColor) self.QuoteText.textColor = textColor; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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