@@ -69,9 +69,11 @@ class PostViewCell: UITableViewCell
70 var views: [UIView] = []
70 var views: [UIView] = []
71 var data : [UIImage] = []
71 var data : [UIImage] = []
73− func fill(with info: [Media], _ isFullVersoin: Bool)
74+ func fill(with info: [Media], _ isFullVersoin: Bool, post: Post)
75 // important
77 // important
76 contentView.subviews.forEach({ $0.removeFromSuperview() })
78 contentView.subviews.forEach({ $0.removeFromSuperview() })
@@ -99,6 +101,46 @@ class PostViewCell: UITableViewCell
99 //nameStackView.height(46)
101 //nameStackView.height(46)
100 nameStackView.edgesToSuperview(excluding: .bottom, insets: .left(20) + .right(20) + .top(8))
102 nameStackView.edgesToSuperview(excluding: .bottom, insets: .left(20) + .right(20) + .top(8))
104+ let mainView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 50))
106+ let scrollView = UIScrollView()
108+ scrollView.backgroundColor = .white
110+ mainView.addSubview(scrollView)
111+ scrollView.edgesToSuperview()
113+ scrollView.showsHorizontalScrollIndicator = false
115+ var buttons: [UIButton] = []
116+ for hash in post!.hashtags {
117+ let button = UIButton()
118+ button.setTitle("#" + hash, for: .normal)
119+ button.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
120+ button.layer.cornerRadius = 10
121+ button.titleLabel?.font = UIFont.systemFont(ofSize: 14)
122+ button.setTitleColor(.black, for: .normal)
123+ buttons.append(button)
126+ let stackViewHashTags = UIStackView(arrangedSubviews: buttons)
128+ scrollView.addSubview(stackViewHashTags)
130+ stackViewHashTags.axis = .horizontal
131+ stackViewHashTags.alignment = .center
132+ stackViewHashTags.spacing = 20
134+ stackViewHashTags.edgesToSuperview(insets: .left(20) + .top(10) + .right(20))
136+ scrollView.contentSize = CGSize(width: 500, height: 50)
139+ contentView.addSubview(mainView)
140+ mainView.edgesToSuperview(excluding: [.top, .bottom])
141+ mainView.topToBottom(of: nameStackView)
102 let stackView = MyStackView(arrangedSubviews: views)
144 let stackView = MyStackView(arrangedSubviews: views)
103 stackView.isFull = full
145 stackView.isFull = full
104 stackView.axis = .vertical
146 stackView.axis = .vertical
@@ -106,7 +148,7 @@ class PostViewCell: UITableViewCell
106 if !full {
148 if !full {
107 stackView.height(300, relation: .equalOrLess, isActive: true)
149 stackView.height(300, relation: .equalOrLess, isActive: true)
109− stackView.topToBottom(of: nameStackView, offset: 16, relation: .equal, isActive: true)
151+ stackView.topToBottom(of: mainView, offset: 16, relation: .equal, isActive: true)
110 stackView.edgesToSuperview(excluding: [.top, .bottom], insets: .left(16) + .right(16))
152 stackView.edgesToSuperview(excluding: [.top, .bottom], insets: .left(16) + .right(16))
112 let commentsSharesStackView = UIStackView(arrangedSubviews: [ commentsLabel, shareButton])
154 let commentsSharesStackView = UIStackView(arrangedSubviews: [ commentsLabel, shareButton])