added iOS source code
[wl-app.git] / iOS / WolneLektury / Screens / Menu / Cells / MenuSupportUsTableViewCell.swift
1 //
2 //  MenuSupportUsTableViewCell.swift
3 //  WolneLektury
4 //
5 //  Created by Pawel Dabrowski on 30/05/2018.
6 //  Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
7 //
8
9 import UIKit
10
11 protocol MenuSupportUsTableViewCellDelegate: class{
12     
13     func menuSupportUsButtonTapped()
14 }
15
16 class MenuSupportUsTableViewCell: WLTableViewCell {
17     weak var delegate: MenuSupportUsTableViewCellDelegate?
18     @IBOutlet weak var button: UIButton!
19     
20     class func instance(delegate: MenuSupportUsTableViewCellDelegate?) -> MenuSupportUsTableViewCell{
21         let cell = MenuSupportUsTableViewCell.instance(type: MenuSupportUsTableViewCell.self)
22         cell.delegate = delegate
23         return cell
24     }
25
26     override func awakeFromNib() {
27         super.awakeFromNib()
28         button.layer.cornerRadius = 15
29         button.text = "support_us".localized.uppercased()
30         backgroundColor = UIColor.clear
31         contentView.backgroundColor = UIColor.clear
32     }
33
34     override func setSelected(_ selected: Bool, animated: Bool) {
35         super.setSelected(selected, animated: animated)
36
37         // Configure the view for the selected state
38     }
39     
40     @IBAction func buttonAction(_ sender: Any) {
41         delegate?.menuSupportUsButtonTapped()
42     }
43     
44     override func getHeight() -> CGFloat {
45         return 50
46     }
47 }