Commit f7eaa5c0 authored by toby's avatar toby

move imageForColor to utils, launch screen

parent 24e9d3f1
......@@ -69,4 +69,15 @@ func randomTransition() -> BGTransition {
var start = randomColor()
var end = randomColor()
return BGTransition(duration: duration, startColor: start, endColor: end)
}
func imageFromColor(color: UIColor) -> UIImage {
let rect = CGRectMake(0, 0, 35, 20)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
CGContextSetFillColorWithColor(context, color.CGColor)
CGContextFillRect(context, rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
\ No newline at end of file
......@@ -62,17 +62,6 @@ class ColorDetailViewController: UITableViewController, UITableViewDataSource, U
return label
}
private func imageFromColor(color: UIColor) -> UIImage {
let rect = CGRectMake(0, 0, 35, 20)
UIGraphicsBeginImageContext(rect.size)
let context = UIGraphicsGetCurrentContext()
CGContextSetFillColorWithColor(context, color.CGColor)
CGContextFillRect(context, rect)
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return image
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
......
......@@ -23,7 +23,11 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Main</string>
<string>LaunchScreen</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundleDisplayName</key>
<string></string>
<key>UIMainStoryboardFile</key>
<string></string>
<key>UIRequiredDeviceCapabilities</key>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment