2 // MenuBottomTableViewCell.swift
5 // Created by Pawel Dabrowski on 30/05/2018.
6 // Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
10 protocol MenuBottomTableViewCellDelegate: class{
12 func menuBottomProfileButtonTapped()
13 func menuBottomSignOutButtonButtonTapped()
16 class MenuBottomTableViewCell: WLTableViewCell {
17 weak var delegate: MenuBottomTableViewCellDelegate?
18 @IBOutlet weak var titleLabel: UILabel!
19 @IBOutlet weak var showProfileButton: UIButton!
20 @IBOutlet weak var signOutButton: UIButton!
22 class func instance(delegate: MenuBottomTableViewCellDelegate?) -> MenuBottomTableViewCell{
23 let cell = MenuBottomTableViewCell.instance(type: MenuBottomTableViewCell.self)
24 cell.delegate = delegate
28 override func awakeFromNib() {
31 showProfileButton.layer.cornerRadius = 13
32 showProfileButton.layer.borderColor = UIColor.white.cgColor
33 showProfileButton.layer.borderWidth = 1
35 let titleText = NSMutableAttributedString(attributedString: NSAttributedString(string: "logged_as".localized + "\n", font: UIFont.systemFont(ofSize: 10)))
36 titleText.append(NSAttributedString(string: "Zuzanna Stańska", font: UIFont.systemFont(ofSize: 12)))
37 titleLabel.attributedText = titleText
38 showProfileButton.text = "show_profile".localized
39 signOutButton.text = "sign_out".localized
41 let bgColor = Constants.Colors.menuTintColor()
42 backgroundColor = bgColor
43 contentView.backgroundColor = bgColor
46 override func getHeight() -> CGFloat {
50 @IBAction func signoutButtonAction(_ sender: Any) {
51 delegate?.menuBottomSignOutButtonButtonTapped()
54 @IBAction func profileButtonAction(_ sender: Any) {
55 delegate?.menuBottomProfileButtonTapped()