git.iko.soy/dashared/GDproject
on master help sign in
Slight changes
46b3bdfDarya Rednikina
GDproject/Controller/ News and channels/NewPostViewController.swift+8−5
@@ -41,7 +41,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
41 let textStorage = MarklightTextStorage()
41 let textStorage = MarklightTextStorage()
42
42
43 static var draft: String = ""
43 static var draft: String = ""
44− static var hashTagsDraft: [String] = ["tt"]
44+ static var hashTagsDraft: [String] = [ ]
45
45
46 var textView: UITextView!
46 var textView: UITextView!
47
47
@@ -72,7 +72,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
72
72
73 setUpMD()
73 setUpMD()
74 setUpTextView()
74 setUpTextView()
75− setUpAccessoryView()
75+ // setUpAccessoryView()
76 //setUpTagsView()
76 //setUpTagsView()
77 }
77 }
78
78
@@ -141,7 +141,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
141 func setUpTextView(){
141 func setUpTextView(){
142 view.addConstraint(bottomTextViewConstraint)
142 view.addConstraint(bottomTextViewConstraint)
143 view1.addSubview(textView)
143 view1.addSubview(textView)
144− textView.edgesToSuperview(insets: .top(8) + .left(8) + .bottom(40+8) + .right(8))
144+ textView.edgesToSuperview(insets: .top(8) + .left(8) + .bottom(8) + .right(8))
145
145
146 if #available(iOS 11.0, *) {
146 if #available(iOS 11.0, *) {
147 textView.smartDashesType = .no
147 textView.smartDashesType = .no
@@ -210,7 +210,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
210 }
210 }
211
211
212 func setUpMD(){
212 func setUpMD(){
213− textStorage.marklightTextProcessor.codeColor = UIColor.orange
213+ textStorage.marklightTextProcessor.codeColor = UIColor.gray
214 textStorage.marklightTextProcessor.quoteColor = UIColor.darkGray
214 textStorage.marklightTextProcessor.quoteColor = UIColor.darkGray
215 textStorage.marklightTextProcessor.syntaxColor = UIColor.blue
215 textStorage.marklightTextProcessor.syntaxColor = UIColor.blue
216 textStorage.marklightTextProcessor.codeFontName = "Courier"
216 textStorage.marklightTextProcessor.codeFontName = "Courier"
@@ -233,6 +233,9 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
233 // MARK:- new post
233 // MARK:- new post
234 @objc func newPost(){
234 @objc func newPost(){
235 Model.createAndPublish(body: [Model.Attachments(markdown: textView!.text)], tags: currentTags)
235 Model.createAndPublish(body: [Model.Attachments(markdown: textView!.text)], tags: currentTags)
236+
237+ NewPostViewController.draft = ""
238+ NewPostViewController.hashTagsDraft = []
236 // adding row to uiTableView after adding new post
239 // adding row to uiTableView after adding new post
237 // myProtocol?.addPost(post: p)
240 // myProtocol?.addPost(post: p)
238 moveBackToParentVC?()
241 moveBackToParentVC?()
@@ -247,7 +250,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
247 [weak self]
250 [weak self]
248 _ in
251 _ in
249 NewPostViewController.draft = self?.textView.text ?? ""
252 NewPostViewController.draft = self?.textView.text ?? ""
250− NewPostViewController.hashTagsDraft = /*self?.tagsField.tags.map { $0.text } ??*/ []
253+ NewPostViewController.hashTagsDraft = self?.currentTags ?? []
251 self?.moveBackToParentVC?()
254 self?.moveBackToParentVC?()
252 }
255 }
253
256
GDproject/Controller/ News and channels/PostViewCell.swift+1−1
@@ -87,7 +87,7 @@ class PostViewCell: UITableViewCell
87 nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
87 nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
88 nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)
88 nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)
89 if let user = post.user{
89 if let user = post.user{
90− fullNameLabel.text = "\(user.firstName) \(user.middleName) \(user.lastName)"
90+ fullNameLabel.text = "\(user.faculty.name)"
91 }
91 }
92 else {
92 else {
93 fullNameLabel.text = "\(post.authorId)"
93 fullNameLabel.text = "\(post.authorId)"
GDproject/Controller/Messages/Dialog/DialogViewController.swift+1−1
@@ -172,7 +172,7 @@ class DialogViewController: UIViewController, UpdatableGroup, UITableViewDelegat
172 messageTextView.edgesToSuperview(excluding: .right)
172 messageTextView.edgesToSuperview(excluding: .right)
173 messageTextView.rightToLeft(of: sendButton)
173 messageTextView.rightToLeft(of: sendButton)
174
174
175− tableView.edgesToSuperview(excluding: .bottom, insets: .top(self.navigationController?.navigationBar.frame.size.height ?? 0))
175+ tableView.edgesToSuperview(excluding: .bottom)
176 tableView.bottomToTop(of: messageSendView)
176 tableView.bottomToTop(of: messageSendView)
177
177
178 self.view.layoutSubviews()
178 self.view.layoutSubviews()