Slight changes

This commit is contained in:
Darya Rednikina 2019-05-14 00:57:01 +03:00
parent 12b1bfd07e
commit 46b3bdf1cf
3 changed files with 10 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
let textStorage = MarklightTextStorage()
static var draft: String = ""
static var hashTagsDraft: [String] = ["tt"]
static var hashTagsDraft: [String] = [ ]
var textView: UITextView!
@ -72,7 +72,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
setUpMD()
setUpTextView()
setUpAccessoryView()
// setUpAccessoryView()
//setUpTagsView()
}
@ -141,7 +141,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
func setUpTextView(){
view.addConstraint(bottomTextViewConstraint)
view1.addSubview(textView)
textView.edgesToSuperview(insets: .top(8) + .left(8) + .bottom(40+8) + .right(8))
textView.edgesToSuperview(insets: .top(8) + .left(8) + .bottom(8) + .right(8))
if #available(iOS 11.0, *) {
textView.smartDashesType = .no
@ -210,7 +210,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
}
func setUpMD(){
textStorage.marklightTextProcessor.codeColor = UIColor.orange
textStorage.marklightTextProcessor.codeColor = UIColor.gray
textStorage.marklightTextProcessor.quoteColor = UIColor.darkGray
textStorage.marklightTextProcessor.syntaxColor = UIColor.blue
textStorage.marklightTextProcessor.codeFontName = "Courier"
@ -233,6 +233,9 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
// MARK:- new post
@objc func newPost(){
Model.createAndPublish(body: [Model.Attachments(markdown: textView!.text)], tags: currentTags)
NewPostViewController.draft = ""
NewPostViewController.hashTagsDraft = []
// adding row to uiTableView after adding new post
// myProtocol?.addPost(post: p)
moveBackToParentVC?()
@ -247,7 +250,7 @@ class NewPostViewController: UIViewController, UITextViewDelegate, TagsReceiver
[weak self]
_ in
NewPostViewController.draft = self?.textView.text ?? ""
NewPostViewController.hashTagsDraft = /*self?.tagsField.tags.map { $0.text } ??*/ []
NewPostViewController.hashTagsDraft = self?.currentTags ?? []
self?.moveBackToParentVC?()
}

View File

@ -87,7 +87,7 @@ class PostViewCell: UITableViewCell
nameLabel.setTitle("\(post.user?.firstName ?? "") \(post.user?.lastName ?? "")", for: .normal)
nameLabel.addTarget(self, action: #selector(displayProfile), for: .touchUpInside)
if let user = post.user{
fullNameLabel.text = "\(user.firstName) \(user.middleName) \(user.lastName)"
fullNameLabel.text = "\(user.faculty.name)"
}
else {
fullNameLabel.text = "\(post.authorId)"

View File

@ -172,7 +172,7 @@ class DialogViewController: UIViewController, UpdatableGroup, UITableViewDelegat
messageTextView.edgesToSuperview(excluding: .right)
messageTextView.rightToLeft(of: sendButton)
tableView.edgesToSuperview(excluding: .bottom, insets: .top(self.navigationController?.navigationBar.frame.size.height ?? 0))
tableView.edgesToSuperview(excluding: .bottom)
tableView.bottomToTop(of: messageSendView)
self.view.layoutSubviews()