@@ -41,7 +41,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
41 let textStorage = MarklightTextStorage()
41 let textStorage = MarklightTextStorage()
43 static var draft: String = ""
43 static var draft: String = ""
44− static var hashTagsDraft: [String] = ["tt"]
44+ static var hashTagsDraft: [String] = [ ]
46 var textView: UITextView!
46 var textView: UITextView!
@@ -72,7 +72,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
74 setUpTextView()
74 setUpTextView()
75− setUpAccessoryView()
75+ // setUpAccessoryView()
76 //setUpTagsView()
76 //setUpTagsView()
@@ -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))
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
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)
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]
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?()