@@ -34,14 +34,14 @@ final class ComponentsOverviewTableViewController: UIViewController {
3434 private let recievedMessageTimeStyle = TextStyle ( color: . gray, font: . systemFont( ofSize: 12 , weight: . light) )
3535 private let recievedMessageTimeLayout = TextLayout ( lineBreakMode: . byWordWrapping, numberOfLines: 0 )
3636 private lazy var recievedMessageTimeModel : LabelView . Model = . build {
37- LabelView . Model . Property . text ( . string( " 17:05 " ) )
38- LabelView . Model . Property . style ( recievedMessageTimeStyle)
39- LabelView . Model . Property . layout ( recievedMessageTimeLayout)
40- LabelView . Model . Property . textAlignment ( . left)
41- LabelView . Model . Property . alignment ( . leading( UIEdgeInsets ( top: 12 ,
42- left: 16 ,
43- bottom: 12 ,
44- right: 0 ) ) )
37+ LabelProperty . text ( . string( " 17:05 " ) )
38+ LabelProperty . style ( recievedMessageTimeStyle)
39+ LabelProperty . layout ( recievedMessageTimeLayout)
40+ LabelProperty . textAlignment ( . left)
41+ LabelProperty . alignment ( . leading( UIEdgeInsets ( top: 12 ,
42+ left: 16 ,
43+ bottom: 12 ,
44+ right: 0 ) ) )
4545 }
4646
4747 private lazy var recievedMessageTimeGenerator = LabelView . rddm. tableGenerator ( with: recievedMessageTimeModel, and: . class)
@@ -50,14 +50,14 @@ final class ComponentsOverviewTableViewController: UIViewController {
5050 private let sentTimeMessageStyle = TextStyle ( color: . gray, font: . systemFont( ofSize: 12 , weight: . light) )
5151 private let sentTimeMessageLayout = TextLayout ( lineBreakMode: . byWordWrapping, numberOfLines: 0 )
5252 private lazy var sentTimeMessageModel : LabelView . Model = . build {
53- LabelView . Model . Property . text ( . string( " 17:32 " ) )
54- LabelView . Model . Property . style ( sentTimeMessageStyle)
55- LabelView . Model . Property . layout ( sentTimeMessageLayout)
56- LabelView . Model . Property . textAlignment ( . right)
57- LabelView . Model . Property . alignment ( . trailing( UIEdgeInsets ( top: 12 ,
58- left: 0 ,
59- bottom: 12 ,
60- right: 16 ) ) )
53+ LabelProperty . text ( . string( " 17:32 " ) )
54+ LabelProperty . style ( sentTimeMessageStyle)
55+ LabelProperty . layout ( sentTimeMessageLayout)
56+ LabelProperty . textAlignment ( . right)
57+ LabelProperty . alignment ( . trailing( UIEdgeInsets ( top: 12 ,
58+ left: 0 ,
59+ bottom: 12 ,
60+ right: 16 ) ) )
6161 }
6262
6363 private lazy var sentMessageTimeGenerator = LabelView . rddm. tableGenerator ( with: sentTimeMessageModel, and: . class)
@@ -66,14 +66,14 @@ final class ComponentsOverviewTableViewController: UIViewController {
6666 private let dateStyle = TextStyle ( color: . black, font: . systemFont( ofSize: 12 , weight: . light) )
6767 private let dateLayout = TextLayout ( lineBreakMode: . byWordWrapping, numberOfLines: 0 )
6868 private lazy var dateModel : LabelView . Model = . build {
69- LabelView . Model . Property . text ( . string( " 24 мая 2023 " ) )
70- LabelView . Model . Property . style ( dateStyle)
71- LabelView . Model . Property . layout ( dateLayout)
72- LabelView . Model . Property . textAlignment ( . center)
73- LabelView . Model . Property . alignment ( . all( UIEdgeInsets ( top: 0 ,
74- left: 0 ,
75- bottom: 12 ,
76- right: 0 ) ) )
69+ LabelProperty . text ( . string( " 24 мая 2023 " ) )
70+ LabelProperty . style ( dateStyle)
71+ LabelProperty . layout ( dateLayout)
72+ LabelProperty . textAlignment ( . center)
73+ LabelProperty . alignment ( . all( UIEdgeInsets ( top: 0 ,
74+ left: 0 ,
75+ bottom: 12 ,
76+ right: 0 ) ) )
7777 }
7878
7979 private lazy var dateGenerator = LabelView . rddm. tableGenerator ( with: dateModel, and: . class)
@@ -84,20 +84,24 @@ final class ComponentsOverviewTableViewController: UIViewController {
8484 private let sentMessageBorderStyle = BorderStyle ( cornerRadius: 9 ,
8585 maskedCorners: [ . layerMinXMinYCorner, . layerMinXMaxYCorner, . layerMaxXMinYCorner] )
8686 private lazy var sentMessageModel : MessageView . Model = . build {
87- MessageView . Model. Property. background ( . solid( . systemBlue) )
88- MessageView . Model. Property. border ( sentMessageBorderStyle)
89- MessageView . Model. Property. style ( sentMessageStyle)
90- MessageView . Model. Property. textAlignment ( . right)
91- MessageView . Model. Property. alignment ( . trailing( UIEdgeInsets ( top: 12 ,
92- left: UIScreen . main. bounds. width / 2 ,
93- bottom: 12 ,
94- right: 16 )
95- ) )
96- MessageView . Model. Property. insets ( UIEdgeInsets ( top: 3 ,
97- left: 5 ,
98- bottom: 3 ,
99- right: 5 ) )
100- MessageView . Model. Property. text ( . string( " Lorem " ) )
87+ if Bool . random ( ) {
88+ MessageProperty . background ( . solid( . systemBlue) )
89+ } else {
90+ MessageProperty . background ( . solid( . rddm) )
91+ }
92+ MessageProperty . border ( sentMessageBorderStyle)
93+ MessageProperty . style ( sentMessageStyle)
94+ MessageProperty . textAlignment ( . right)
95+ MessageProperty . alignment ( . trailing( UIEdgeInsets ( top: 12 ,
96+ left: UIScreen . main. bounds. width / 2 ,
97+ bottom: 12 ,
98+ right: 16 )
99+ ) )
100+ MessageProperty . insets ( UIEdgeInsets ( top: 3 ,
101+ left: 5 ,
102+ bottom: 3 ,
103+ right: 5 ) )
104+ MessageProperty . text ( . string( " Lorem " ) )
101105 }
102106
103107 private lazy var sentMessageGenerator = MessageView . rddm. tableGenerator ( with: sentMessageModel, and: . class)
@@ -113,17 +117,17 @@ final class ComponentsOverviewTableViewController: UIViewController {
113117 borderWidth: 1 ,
114118 borderColor: UIColor . black. cgColor)
115119 private lazy var recievedMessageModel : MessageView . Model = . build {
116- MessageView . Model . Property . border ( recievedMessageBorderStyle)
117- MessageView . Model . Property . style ( recievedMessageStyle)
118- MessageView . Model . Property . alignment ( . leading( UIEdgeInsets ( top: 12 ,
119- left: 16 ,
120- bottom: 12 ,
121- right: UIScreen . main. bounds. width / 2 ) ) )
122- MessageView . Model . Property . insets ( UIEdgeInsets ( top: 3 ,
123- left: 5 ,
124- bottom: 3 ,
125- right: 5 ) )
126- MessageView . Model . Property . text ( . string( " Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet " ) )
120+ MessageProperty . border ( recievedMessageBorderStyle)
121+ MessageProperty . style ( recievedMessageStyle)
122+ MessageProperty . alignment ( . leading( UIEdgeInsets ( top: 12 ,
123+ left: 16 ,
124+ bottom: 12 ,
125+ right: UIScreen . main. bounds. width / 2 ) ) )
126+ MessageProperty . insets ( UIEdgeInsets ( top: 3 ,
127+ left: 5 ,
128+ bottom: 3 ,
129+ right: 5 ) )
130+ MessageProperty . text ( . string( " Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet " ) )
127131 }
128132
129133 private lazy var recievedMessageGenerator = MessageView . rddm. tableGenerator ( with: recievedMessageModel, and: . class)
0 commit comments