@@ -69,9 +69,11 @@ class PostViewCell: UITableViewCell
6969
7070 var views: [UIView] = []
7171 var data : [UIImage] = []
72+ var post: Post?
7273
73− func fill(with info: [Media], _ isFullVersoin: Bool)
74+ func fill(with info: [Media], _ isFullVersoin: Bool, post: Post)
7475 {
76+ self.post = post
7577 // important
7678 contentView.subviews.forEach({ $0.removeFromSuperview() })
7779
@@ -99,6 +101,46 @@ class PostViewCell: UITableViewCell
99101 //nameStackView.height(46)
100102 nameStackView.edgesToSuperview(excluding: .bottom, insets: .left(20) + .right(20) + .top(8))
101103
104+ let mainView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 50))
105+
106+ let scrollView = UIScrollView()
107+
108+ scrollView.backgroundColor = .white
109+
110+ mainView.addSubview(scrollView)
111+ scrollView.edgesToSuperview()
112+
113+ scrollView.showsHorizontalScrollIndicator = false
114+
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)
124+ }
125+
126+ let stackViewHashTags = UIStackView(arrangedSubviews: buttons)
127+
128+ scrollView.addSubview(stackViewHashTags)
129+
130+ stackViewHashTags.axis = .horizontal
131+ stackViewHashTags.alignment = .center
132+ stackViewHashTags.spacing = 20
133+
134+ stackViewHashTags.edgesToSuperview(insets: .left(20) + .top(10) + .right(20))
135+
136+ scrollView.contentSize = CGSize(width: 500, height: 50)
137+
138+
139+ contentView.addSubview(mainView)
140+ mainView.edgesToSuperview(excluding: [.top, .bottom])
141+ mainView.topToBottom(of: nameStackView)
142+ mainView.height(50)
143+
102144 let stackView = MyStackView(arrangedSubviews: views)
103145 stackView.isFull = full
104146 stackView.axis = .vertical
@@ -106,7 +148,7 @@ class PostViewCell: UITableViewCell
106148 if !full {
107149 stackView.height(300, relation: .equalOrLess, isActive: true)
108150 }
109− stackView.topToBottom(of: nameStackView, offset: 16, relation: .equal, isActive: true)
151+ stackView.topToBottom(of: mainView, offset: 16, relation: .equal, isActive: true)
110152 stackView.edgesToSuperview(excluding: [.top, .bottom], insets: .left(16) + .right(16))
111153
112154 let commentsSharesStackView = UIStackView(arrangedSubviews: [ commentsLabel, shareButton])