Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions UCLA Radio/Assets.xcassets/background.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "trianglify.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions UCLA Radio/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13770" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="DuL-GS-bCM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="DuL-GS-bCM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13770"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down
16 changes: 11 additions & 5 deletions UCLA Radio/menu/MenuViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ private let reuseIdentifier = "MenuCell"
private let headerReuseIdentifier = "MenuHeaderView"
private let sectionInset: CGFloat = 25
private let itemSpacing: CGFloat = 15
private let atractiveColorSchemes = ["BuGn", "BuPu", "RdPu", "Reds", "Oranges","Greens", "Blues", "Purples", "PuRd"]

class MenuItem {
let title: String
Expand All @@ -37,7 +36,7 @@ class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDe
private var items = [MenuItem]()

var tableView = UITableView(frame: CGRect.zero, style: .grouped)
var triangleView: TrianglifyView!
var triangleView: UIView!

// MARK: - ViewController Life Cycle

Expand All @@ -46,7 +45,7 @@ class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDe

view.backgroundColor = UIColor.clear

triangleView = TrianglifyView()
triangleView = UIView()
view.addSubview(triangleView)
triangleView.translatesAutoresizingMaskIntoConstraints = false

Expand Down Expand Up @@ -74,8 +73,15 @@ class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDe
navigationController.setNavigationBarHidden(true, animated: true)
}

// randomly set color scheme
triangleView.colorScheme = atractiveColorSchemes[Int(arc4random_uniform(UInt32(atractiveColorSchemes.count)))]
// set the background image

UIGraphicsBeginImageContext(self.view.frame.size)
UIImage(named: "background")?.draw(in: self.view.bounds)

if let image = UIGraphicsGetImageFromCurrentImageContext(){
UIGraphicsEndImageContext()
self.view.backgroundColor = UIColor(patternImage: image)
}

AnalyticsManager.sharedInstance.trackPageWithValue("Menu / Now Playing")
}
Expand Down