forked from jonkykong/SideMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SideMenuTableViewController.swift
40 lines (30 loc) · 1.26 KB
/
SideMenuTableViewController.swift
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
//
// SideMenuTableViewController.swift
// SideMenu
//
// Created by Jon Kent on 4/5/16.
// Copyright © 2016 CocoaPods. All rights reserved.
//
import SideMenu
class SideMenuTableViewController: UITableViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// refresh cell blur effect in case it changed
tableView.reloadData()
guard let menu = navigationController as? SideMenuNavigationController, menu.blurEffectStyle == nil else {
return
}
// Set up a cool background image for demo purposes
let imageView = UIImageView(image: #imageLiteral(resourceName: "saturn"))
imageView.contentMode = .scaleAspectFit
imageView.backgroundColor = UIColor.black.withAlphaComponent(0.2)
tableView.backgroundView = imageView
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = super.tableView(tableView, cellForRowAt: indexPath) as! UITableViewVibrantCell
if let menu = navigationController as? SideMenuNavigationController {
cell.blurEffectStyle = menu.blurEffectStyle
}
return cell
}
}