Browse Source

preview drafted documents

cyberta 4 years ago
parent
commit
88c4ca818a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      deltachat-ios/Chat/Views/DocumentPreview.swift

+ 7 - 0
deltachat-ios/Chat/Views/DocumentPreview.swift

@@ -10,6 +10,7 @@ public class DocumentPreview: DraftPreview {
         view.translatesAutoresizingMaskIntoConstraints = false
         view.allowLayoutChange = false
         view.fileTitle.numberOfLines = 2
+        view.isUserInteractionEnabled = true
         return view
     }()
 
@@ -23,6 +24,8 @@ public class DocumentPreview: DraftPreview {
             fileView.constraintAlignTrailingTo(mainContentView),
             mainContentView.constraintHeightTo(75, priority: .required)
         ])
+        let gestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(fileViewTapped))
+        fileView.addGestureRecognizer(gestureRecognizer)
     }
     
     override public func cancel() {
@@ -42,4 +45,8 @@ public class DocumentPreview: DraftPreview {
             isHidden = true
         }
     }
+
+    @objc func fileViewTapped() {
+        delegate?.onAttachmentTapped()
+    }
 }