瀏覽代碼

make ChatInputBar mandatory as InputBarAccessoryView

cyberta 4 年之前
父節點
當前提交
23aec2572c
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      deltachat-ios/Chat/Views/DraftArea.swift

+ 5 - 4
deltachat-ios/Chat/Views/DraftArea.swift

@@ -1,4 +1,3 @@
-
 import UIKit
 import DcCore
 import InputBarAccessoryView
@@ -67,12 +66,14 @@ public class DraftArea: UIView, InputItem {
     }
 
     public func configureDraftArea(draft: DraftModel) {
+        guard let  chatInputBar = inputBarAccessoryView as? ChatInputBar else {
+            safe_fatalError("Expecting inputBarAccessoryView of type ChatInputBar")
+            return
+        }
         quotePreview.configure(draft: draft)
         mediaPreview.configure(draft: draft)
         documentPreview.configure(draft: draft)
-        if let chatInputBar = inputBarAccessoryView as? ChatInputBar {
-            chatInputBar.configure(draft: draft)
-        }
+        chatInputBar.configure(draft: draft)
     }
 
     public func cancel() {