forked from teodorpatras/SideMenuController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentViewController.swift
More file actions
51 lines (41 loc) · 1.58 KB
/
Copy pathContentViewController.swift
File metadata and controls
51 lines (41 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// ContentViewController.swift
// Example
//
// Created by Teodor Patras on 16/06/16.
// Copyright © 2016 teodorpatras. All rights reserved.
//
import UIKit
import SideMenuController
class ContentViewController: UIViewController, SideMenuControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBar.barTintColor = randomColor
sideMenuController?.delegate = self
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
print("\(#function) -- \(self)")
}
override func viewWillDisappear(animated: Bool) {
super.viewWillDisappear(animated)
print("\(#function) -- \(self)")
}
@IBAction func presentAction() {
presentViewController(ViewController.fromStoryboard, animated: true, completion: nil)
}
var randomColor: UIColor {
let colors = [UIColor(hue:0.65, saturation:0.33, brightness:0.82, alpha:1.00),
UIColor(hue:0.57, saturation:0.04, brightness:0.89, alpha:1.00),
UIColor(hue:0.55, saturation:0.35, brightness:1.00, alpha:1.00),
UIColor(hue:0.38, saturation:0.09, brightness:0.84, alpha:1.00)]
let index = Int(arc4random_uniform(UInt32(colors.count)))
return colors[index]
}
func sideMenuControllerDidHide(sideMenuController: SideMenuController) {
print(#function)
}
func sideMenuControllerDidReveal(sideMenuController: SideMenuController) {
print(#function)
}
}