git.iko.soy/dashared/GDproject
on master help sign in
Slight changes
commit46b3bdf1cf4ef593c62565a71b892b6f8541a071 authorDarya Rednikina <rednikina.com@yandex.ru> dateTue 14 May 2019, 00:57 (7 years ago) parent12b1bfd
3 files changed+10−7
GDproject/Controller/ News and channels/NewPostViewController.swift+8−5 GDproject/Controller/ News and channels/PostViewCell.swift+1−1 GDproject/Controller/Messages/Dialog/DialogViewController.swift+1−1
GDproject/Controller/ News and channels/NewPostViewController.swift+8−5
@@ -41,7 +41,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
4141 let textStorage = MarklightTextStorage()
4242
4343 static var draft: String = ""
44− static var hashTagsDraft: [String] = ["tt"]
44+ static var hashTagsDraft: [String] = [ ]
4545
4646 var textView: UITextView!
4747
@@ -72,7 +72,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
7272
7373 setUpMD()
7474 setUpTextView()
75− setUpAccessoryView()
75+ // setUpAccessoryView()
7676 //setUpTagsView()
7777 }
7878
@@ -141,7 +141,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
141141 func setUpTextView(){
142142 view.addConstraint(bottomTextViewConstraint)
143143 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))
145145
146146 if #available(iOS 11.0, *) {
147147 textView.smartDashesType = .no
@@ -210,7 +210,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
210210 }
211211
212212 func setUpMD(){
213− textStorage.marklightTextProcessor.codeColor = UIColor.orange
213+ textStorage.marklightTextProcessor.codeColor = UIColor.gray
214214 textStorage.marklightTextProcessor.quoteColor = UIColor.darkGray
215215 textStorage.marklightTextProcessor.syntaxColor = UIColor.blue
216216 textStorage.marklightTextProcessor.codeFontName = "Courier"
@@ -233,6 +233,9 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
233233 // MARK:- new post
234234 @objc func newPost(){
235235 Model.createAndPublish(body: [Model.Attachments(markdown: textView!.text)], tags: currentTags)
236+
237+ NewPostViewController.draft = ""
238+ NewPostViewController.hashTagsDraft = []
236239 // adding row to uiTableView after adding new post
237240 // myProtocol?.addPost(post: p)
238241 moveBackToParentVC?()
@@ -247,7 +250,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
247250 [weak self]
248251 _ in
249252 NewPostViewController.draft = self?.textView.text ?? ""
250− NewPostViewController.hashTagsDraft = /*self?.tagsField.tags.map { $0.text } ??*/ []
253+ NewPostViewController.hashTagsDraft = self?.currentTags ?? []
251254 self?.moveBackToParentVC?()
252255 }
253256
GDproject/Controller/ News and channels/PostViewCell.swift+1−1
@@ -87,7 +87,7 @@ class PostViewCell: UITableViewCell
8787 nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
8888 nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)
8989 if let user = post.user{
90− fullNameLabel.text = "\(user.firstName) \(user.middleName) \(user.lastName)"
90+ fullNameLabel.text = "\(user.faculty.name)"
9191 }
9292 else {
9393 fullNameLabel.text = "\(post.authorId)"
GDproject/Controller/Messages/Dialog/DialogViewController.swift+1−1
@@ -172,7 +172,7 @@ class DialogViewController: UIViewController, UpdatableGroup, UITableViewDelegat
172172 messageTextView.edgesToSuperview(excluding: .right)
173173 messageTextView.rightToLeft(of: sendButton)
174174
175− tableView.edgesToSuperview(excluding: .bottom, insets: .top(self.navigationController?.navigationBar.frame.size.height ?? 0))
175+ tableView.edgesToSuperview(excluding: .bottom)
176176 tableView.bottomToTop(of: messageSendView)
177177
178178 self.view.layoutSubviews()