-
Notifications
You must be signed in to change notification settings - Fork 0
/
FacebookStatusCellController.swift
56 lines (43 loc) · 2.01 KB
/
FacebookStatusCellController.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// FacebookStatusCellController.swift
// comblie
//
// Created by Cal on 10/30/15.
// Copyright © 2015 Comblie. All rights reserved.
//
import UIKit
class FacebookStatusCellController: UITableViewCell {
@IBOutlet weak var postAuthor: UILabel!
@IBOutlet weak var profileImage: UIView!
@IBOutlet weak var lineSeparator: UIView!
@IBOutlet weak var lineHeight: NSLayoutConstraint!
var parent : UITableViewController!
var VC : CommentsController!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
self.profileImage.layer.cornerRadius = CGFloat(self.profileImage
.frame.height/2)
self.lineHeight.constant = CGFloat(0.5)
}
override func setSelected(selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
self.lineSeparator.backgroundColor = UIColor(red: 236/255, green: 236/255, blue: 236/255, alpha: 1)
}
override func setHighlighted(highlighted: Bool, animated: Bool) {
self.lineSeparator.backgroundColor = UIColor(red: 236/255, green: 236/255, blue: 236/255, alpha: 1)
self.postAuthor.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "openProfile"))
}
// MARK: Actions
func openProfile() {
let profileView = self.window?.rootViewController?.storyboard?.instantiateViewControllerWithIdentifier("PublicProfile")
self.parent.parentViewController!.navigationController?.pushViewController(profileView!, animated: true)
}
@IBAction func enlarge(sender: UIButton) {
VC = self.window?.rootViewController?.storyboard?.instantiateViewControllerWithIdentifier("Comments") as! CommentsController
VC.postHeight = self.contentView.frame.height
self.window?.rootViewController?.presentViewController(VC, animated: true, completion: nil)
UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.Default
}
}