mirror of
https://github.com/dashared/GDproject.git
synced 2024-11-29 02:54:30 +03:00
Slight changes
This commit is contained in:
parent
12b1bfd07e
commit
46b3bdf1cf
@ -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?()
|
||||
}
|
||||
|
||||
|
@ -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)"
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user