Skip to content

Instantly share code, notes, and snippets.

@russell-archer
Created October 8, 2018 23:13
Show Gist options
  • Save russell-archer/9b7772ff6116c6aebdfe1f3c7dff89f8 to your computer and use it in GitHub Desktop.
Save russell-archer/9b7772ff6116c6aebdfe1f3c7dff89f8 to your computer and use it in GitHub Desktop.
ShowRandomColor. Use the ColorGenerator to set the UIView background color
//
// ViewController.swift
// ShowRandomColor
//
// Created by Russell Archer on 05/10/2018.
// Copyright © 2018 Russell Archer. All rights reserved.
//
import UIKit
import ColorGenerator
class ViewController: UIViewController {
@IBOutlet weak var colorView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
setColor()
}
func setColor() {
let colorInfo = Generate.randomColor()
colorView.backgroundColor = colorInfo.color
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment