2017年3月22日 星期三

Ep8_How to Send Messages

建立 ChatLogController
MessageController 跳至 ChatLogController
將 UIView 加入 ChatLogController 底部
將 sendButton 加入 UIView
將 textField 加入 UIView
將 textField的資料 上傳至database



建立 ChatLogController


MessageController 點擊 titleView 跳至 ChatLogController


ChatLogController


將 containerView:UIView 加入 ChatLogController


containerView DB在最上方


將ChatLogController:UITableViewController 改為 UIViewControlller


containerView 顯示在最下方



將 ChatLogController:UIViewController 改為 UICollectionViewController






將 sendButton 加入 containerView




建立 TextField
setupInputComponents()




建立分隔線
setupInputComponents()



建立 sendButton Action


印出 TextField 的文字







將 TextField 資料上傳至 database






為每一筆訊息都建立成一筆資料




按 Return 鍵 可以上傳訊息
( 也就是在Simulator按Enter鍵 )




為 Message 加上 name















沒有留言:

張貼留言