Created
October 8, 2018 23:13
-
-
Save russell-archer/9b7772ff6116c6aebdfe1f3c7dff89f8 to your computer and use it in GitHub Desktop.
ShowRandomColor. Use the ColorGenerator to set the UIView background color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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