質問編集履歴

2

ソースの修正

2019/07/15 10:59

投稿

takahiro00
takahiro00

スコア84

test CHANGED
File without changes
test CHANGED
@@ -24,11 +24,7 @@
24
24
 
25
25
  色々調べた結果、Podfileに「pod 'MessageInputBar'」を追加して、
26
26
 
27
- import MessageInputBarをする必要があるようなので、追加したのですが、
27
+ import MessageInputBarをする必要があるようなので、追加したのですが、うまくいかず。。。
28
-
29
- messageInputBar付近で、以下のようなエラーが出てしまいます。。。。
30
-
31
- ![イメージ説明](eeb3a960209731e4670da699c20bb506.png)
32
28
 
33
29
 
34
30
 
@@ -90,8 +86,6 @@
90
86
 
91
87
  self.messagesCollectionView.scrollToBottom()
92
88
 
93
- messageInputBar = MessageInputBar()
94
-
95
89
  self.becomeFirstResponder()
96
90
 
97
91
  }
@@ -380,11 +374,11 @@
380
374
 
381
375
 
382
376
 
383
- extension ViewController: MessageInputBarDelegate {
377
+ extension ViewController: MessageKit.MessageInputBarDelegate {
384
378
 
385
379
  // メッセージ送信ボタンをタップした時の挙動
386
380
 
387
- func messageInputBar(_ inputBar: MessageInputBar, didPressSendButtonWith text: String) {
381
+ func messageInputBar(_ inputBar: MessageKit.MessageInputBar, didPressSendButtonWith text: String) {
388
382
 
389
383
  print("send")
390
384
 
@@ -430,8 +424,6 @@
430
424
 
431
425
 
432
426
 
433
-
434
-
435
427
  ```
436
428
 
437
429
 

1

ソースの修正

2019/07/15 10:59

投稿

takahiro00
takahiro00

スコア84

test CHANGED
File without changes
test CHANGED
@@ -20,6 +20,20 @@
20
20
 
21
21
 
22
22
 
23
+ ------以下ソースを修正しました。-----
24
+
25
+ 色々調べた結果、Podfileに「pod 'MessageInputBar'」を追加して、
26
+
27
+ import MessageInputBarをする必要があるようなので、追加したのですが、
28
+
29
+ messageInputBar付近で、以下のようなエラーが出てしまいます。。。。
30
+
31
+ ![イメージ説明](eeb3a960209731e4670da699c20bb506.png)
32
+
33
+
34
+
35
+
36
+
23
37
  ご教授お願いいたします。
24
38
 
25
39
  ### 該当のソースコード
@@ -32,6 +46,8 @@
32
46
 
33
47
  import MessageKit
34
48
 
49
+ import MessageInputBar
50
+
35
51
 
36
52
 
37
53
  class ViewController: MessagesViewController {
@@ -74,6 +90,10 @@
74
90
 
75
91
  self.messagesCollectionView.scrollToBottom()
76
92
 
93
+ messageInputBar = MessageInputBar()
94
+
95
+ self.becomeFirstResponder()
96
+
77
97
  }
78
98
 
79
99
 
@@ -92,7 +112,7 @@
92
112
 
93
113
  messageInputBar.sendButton.tintColor = UIColor.lightGray
94
114
 
95
-
115
+
96
116
 
97
117
  // メッセージ入力時に一番下までスクロール
98
118
 
@@ -104,16 +124,36 @@
104
124
 
105
125
 
106
126
 
107
-
108
-
109
127
  // サンプル用に適当なメッセージ
110
128
 
111
129
  func getMessages() -> [MockMessage] {
112
130
 
113
131
  return [
114
132
 
133
+ createMessage(text: "あ"),
134
+
135
+ createMessage(text: "い"),
136
+
137
+ createMessage(text: "う"),
138
+
139
+ createMessage(text: "え"),
140
+
115
141
  createMessage(text: "お"),
116
142
 
143
+ createMessage(text: "か"),
144
+
145
+ createMessage(text: "き"),
146
+
147
+ createMessage(text: "く"),
148
+
149
+ createMessage(text: "け"),
150
+
151
+ createMessage(text: "こ"),
152
+
153
+ createMessage(text: "さ"),
154
+
155
+ createMessage(text: "し"),
156
+
117
157
  createMessage(text: "すせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん"),
118
158
 
119
159
  ]
@@ -390,6 +430,8 @@
390
430
 
391
431
 
392
432
 
433
+
434
+
393
435
  ```
394
436
 
395
437