forked from MessageKit/MessageKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMessageViewController.swift
More file actions
53 lines (47 loc) · 2.55 KB
/
IMessageViewController.swift
File metadata and controls
53 lines (47 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// IMessageViewController.swift
// ChatExample
//
// Created by Steven Deutsch on 12/17/17.
// Copyright © 2017 MessageKit. All rights reserved.
//
import MessageKit
internal class IMessageViewController: MessagesViewController {
override func viewDidLoad() {
super.viewDidLoad()
iMessage()
}
func defaultStyle() {
let newMessageInputBar = MessageInputBar()
newMessageInputBar.sendButton.tintColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1)
//newMessageInputBar.delegate = self
messageInputBar = newMessageInputBar
reloadInputViews()
}
func iMessage() {
defaultStyle()
messageInputBar.isTranslucent = false
messageInputBar.backgroundView.backgroundColor = .red
messageInputBar.separatorLine.isHidden = true
messageInputBar.inputTextView.backgroundColor = UIColor(red: 245/255, green: 245/255, blue: 245/255, alpha: 1)
messageInputBar.inputTextView.placeholderTextColor = UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 1)
messageInputBar.inputTextView.textContainerInset = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 36)
messageInputBar.inputTextView.placeholderLabelInsets = UIEdgeInsets(top: 8, left: 20, bottom: 8, right: 36)
messageInputBar.inputTextView.layer.borderColor = UIColor(red: 200/255, green: 200/255, blue: 200/255, alpha: 1).cgColor
messageInputBar.inputTextView.layer.borderWidth = 1.0
messageInputBar.inputTextView.layer.cornerRadius = 16.0
messageInputBar.inputTextView.layer.masksToBounds = true
messageInputBar.inputTextView.scrollIndicatorInsets = UIEdgeInsets(top: 8, left: 0, bottom: 8, right: 0)
messageInputBar.setRightStackViewWidthConstant(to: 36, animated: false)
messageInputBar.setStackViewItems([messageInputBar.sendButton], forStack: .right, animated: true)
messageInputBar.sendButton.imageView?.backgroundColor = UIColor(red: 69/255, green: 193/255, blue: 89/255, alpha: 1)
messageInputBar.sendButton.contentEdgeInsets = UIEdgeInsets(top: 2, left: 2, bottom: 2, right: 2)
messageInputBar.sendButton.setSize(CGSize(width: 36, height: 36), animated: true)
messageInputBar.sendButton.image = #imageLiteral(resourceName: "ic_up")
messageInputBar.sendButton.title = nil
messageInputBar.sendButton.imageView?.layer.cornerRadius = 16
messageInputBar.sendButton.backgroundColor = .clear
messageInputBar.textViewPadding.right = -38
messageInputBar.textViewPadding.top = 20
}
}