git.iko.soy/dashared/GDproject
on master help sign in
improved hashtag styling, finished profile
df5de7cDarya Rednikina
GDproject/Controller/News/FullPostController.swift+14−5
@@ -20,6 +20,8 @@ class FullPostController: UITableViewController {
20
20
21 setUpNavigationBar()
21 setUpNavigationBar()
22 tableView.separatorStyle = .none
22 tableView.separatorStyle = .none
23+
24+
23 }
25 }
24
26
25 func setUpNavigationBar(){
27 func setUpNavigationBar(){
@@ -53,16 +55,23 @@ class FullPostController: UITableViewController {
53 }
55 }
54
56
55
57
56−// override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?
58+ override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView?
57−// {
59+ {
58−//
60+ switch section {
61+ case 0:
62+ let v = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 1))
63+ v.backgroundColor = .white
64+ return v
65+ default:
66+ return nil
67+ }
59−// }
68+ }
60
69
61
70
62 override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
71 override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
63 switch section {
72 switch section {
64 case 0:
73 case 0:
65− return 50
74+ return 1
66 default:
75 default:
67 return 0
76 return 0
68 }
77 }
GDproject/Controller/News/PostViewCell.swift+16−12
@@ -101,7 +101,7 @@ class PostViewCell: UITableViewCell
101 //nameStackView.height(46)
101 //nameStackView.height(46)
102 nameStackView.edgesToSuperview(excluding: .bottom, insets: .left(20) + .right(20) + .top(8))
102 nameStackView.edgesToSuperview(excluding: .bottom, insets: .left(20) + .right(20) + .top(8))
103
103
104− let mainView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 50))
104+ let mainView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 30))
105
105
106 let scrollView = UIScrollView()
106 let scrollView = UIScrollView()
107
107
@@ -116,10 +116,10 @@ class PostViewCell: UITableViewCell
116 for hash in post!.hashtags {
116 for hash in post!.hashtags {
117 let button = UIButton()
117 let button = UIButton()
118 button.setTitle("#" + hash, for: .normal)
118 button.setTitle("#" + hash, for: .normal)
119− button.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
119+ //button.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 1)
120− button.layer.cornerRadius = 10
120+ //button.layer.cornerRadius = 10
121− button.titleLabel?.font = UIFont.systemFont(ofSize: 14)
121+ button.titleLabel?.font = UIFont.monospacedDigitSystemFont(ofSize: 15, weight: .semibold)
122− button.setTitleColor(.black, for: .normal)
122+ button.setTitleColor(#colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1), for: .normal)
123 buttons.append(button)
123 buttons.append(button)
124 }
124 }
125
125
@@ -128,18 +128,22 @@ class PostViewCell: UITableViewCell
128 scrollView.addSubview(stackViewHashTags)
128 scrollView.addSubview(stackViewHashTags)
129
129
130 stackViewHashTags.axis = .horizontal
130 stackViewHashTags.axis = .horizontal
131− stackViewHashTags.alignment = .center
131+ stackViewHashTags.spacing = 17
132− stackViewHashTags.spacing = 20
133
132
134− stackViewHashTags.edgesToSuperview(insets: .left(20) + .top(10) + .right(20))
133+ // edgesToSuperview(insets: .left(20) + .top(10) + .right(20))
134+ stackViewHashTags.horizontalToSuperview(insets: .left(20) + .right(20))
135+ stackViewHashTags.verticalToSuperview()
135
136
137+ stackViewHashTags.distribution = .fillProportionally
138+ stackViewHashTags.alignment = .center
139+
136− scrollView.contentSize = CGSize(width: 500, height: 50)
140+ scrollView.contentSize = CGSize(width: 500, height: 30)
137
141
138
142
139 contentView.addSubview(mainView)
143 contentView.addSubview(mainView)
140 mainView.edgesToSuperview(excluding: [.top, .bottom])
144 mainView.edgesToSuperview(excluding: [.top, .bottom])
141− mainView.topToBottom(of: nameStackView)
145+ mainView.topToBottom(of: nameStackView, offset: 5)
142− mainView.height(50)
146+ mainView.height(30)
143
147
144 let stackView = MyStackView(arrangedSubviews: views)
148 let stackView = MyStackView(arrangedSubviews: views)
145 stackView.isFull = full
149 stackView.isFull = full
@@ -148,7 +152,7 @@ class PostViewCell: UITableViewCell
148 if !full {
152 if !full {
149 stackView.height(300, relation: .equalOrLess, isActive: true)
153 stackView.height(300, relation: .equalOrLess, isActive: true)
150 }
154 }
151− stackView.topToBottom(of: mainView, offset: 16, relation: .equal, isActive: true)
155+ stackView.topToBottom(of: mainView, offset: 0, relation: .equal, isActive: true)
152 stackView.edgesToSuperview(excluding: [.top, .bottom], insets: .left(16) + .right(16))
156 stackView.edgesToSuperview(excluding: [.top, .bottom], insets: .left(16) + .right(16))
153
157
154 let commentsSharesStackView = UIStackView(arrangedSubviews: [ commentsLabel, shareButton])
158 let commentsSharesStackView = UIStackView(arrangedSubviews: [ commentsLabel, shareButton])