@@ -25,86 +25,30 @@ extension MessageView: ConfigurableItem {
2525
2626 public struct Model : Equatable , AlignmentProvider {
2727
28- // MARK: - Nested types
29-
30- public struct MessageStyle : Equatable {
31-
32- public let textColor : UIColor
33- public let font : UIFont
34- public let backgroundColor : UIColor
35-
36- public init ( textColor: UIColor = . black, font: UIFont = . systemFont( ofSize: 16 ) , backgroundColor: UIColor = . white) {
37- self . textColor = textColor
38- self . font = font
39- self . backgroundColor = backgroundColor
40- }
41-
42- }
43-
44- public enum TextType : Equatable {
45- case string( String )
46- /// Mind that attributed string may re-configure other model's properties.
47- case attributedString( NSAttributedString )
48- }
49-
50- public struct BorderStyle : Equatable {
51-
52- public let cornerRadius : CGFloat
53- public let maskedCorners : CACornerMask
54- public let borderWidth : CGFloat
55- public let borderColor : CGColor
56-
57- public init ( cornerRadius: CGFloat ,
58- maskedCorners: CACornerMask ,
59- borderWidth: CGFloat = 0 ,
60- borderColor: CGColor = UIColor . clear. cgColor) {
61- self . cornerRadius = cornerRadius
62- self . maskedCorners = maskedCorners
63- self . borderWidth = borderWidth
64- self . borderColor = borderColor
65- }
66-
67- }
68-
6928 // MARK: - Public properties
7029
71- public let text : TextType
72- public let style : MessageStyle
73- public var textAlignment : NSTextAlignment
30+ public let text : TextValue = . string( " " )
31+ public let textStyle : TextStyle = . init( )
32+ public let textLayout : TextLayout = . init( )
33+ public let backgroundStyle : BackgroundStyle = . solid( . clear)
7434 public var alignment : Alignment
75- public let internalEdgeInsets : UIEdgeInsets
35+ public let internalEdgeInsets : UIEdgeInsets = . zero
7636 public let borderStyle : BorderStyle
7737
78- // MARK: - Initialization
79-
80- public init ( text: TextType ,
81- style: MessageStyle ,
82- textAlignment: NSTextAlignment ,
83- viewAlignment: Alignment ,
84- internalEdgeInsets: UIEdgeInsets ,
85- borderStyle: BorderStyle ) {
86- self . text = text
87- self . style = style
88- self . textAlignment = textAlignment
89- self . alignment = viewAlignment
90- self . internalEdgeInsets = internalEdgeInsets
91- self . borderStyle = borderStyle
92- }
93-
9438 }
9539
9640 // MARK: - Methods
9741
9842 public func configure( with model: Model ) {
99- self . backgroundColor = model. style. backgroundColor
100-
101- textView. backgroundColor = . clear
102- textView. isEditable = false
103- textView. isScrollEnabled = false
104- configureTextView ( textView, with: model)
105- textView. textColor = model. style. textColor
106- textView. font = model. style. font
107- textView. textAlignment = model. textAlignment
43+ // self.backgroundColor = model.style.backgroundColor
44+ //
45+ // textView.backgroundColor = .clear
46+ // textView.isEditable = false
47+ // textView.isScrollEnabled = false
48+ // configureTextView(textView, with: model)
49+ // textView.textColor = model.style.textColor
50+ // textView.font = model.style.font
51+ // textView.textAlignment = model.textAlignment
10852
10953 wrap ( subview: textView, with: model. internalEdgeInsets)
11054
0 commit comments