@@ -8,7 +8,7 @@ public enum MessageStyle {
88
99public final class MessageViewController : UIViewController {
1010 // Blur effect view.
11- private lazy var blurView : BlurView = . init( )
11+ private lazy var blurView : UIVisualEffectView = . init( effect : UIBlurEffect ( style : . extraLight ) )
1212 /// Text label.
1313 public private( set) lazy var textLabel : UILabel = . init( )
1414 /// Info image view.
@@ -30,7 +30,7 @@ public final class MessageViewController: UIViewController {
3030 public override func viewDidLoad( ) {
3131 super. viewDidLoad ( )
3232 view. addSubview ( blurView)
33- blurView. addSubviews ( textLabel, imageView, borderView)
33+ blurView. contentView . addSubviews ( textLabel, imageView, borderView)
3434 setupSubviews ( )
3535 handleStateUpdate ( )
3636 }
@@ -123,7 +123,7 @@ public final class MessageViewController: UIViewController {
123123 delay: 0.5 ,
124124 options: [ . beginFromCurrentState] ,
125125 animations: ( { [ weak self] in
126- self ? . blurView. effectView . effect = UIBlurEffect ( style: blurStyle)
126+ self ? . blurView. effect = UIBlurEffect ( style: blurStyle)
127127 } ) ,
128128 completion: ( { [ weak self] _ in
129129 self ? . animate ( blurStyle: blurStyle == . light ? . extraLight : . light)
@@ -181,11 +181,11 @@ extension MessageViewController {
181181 private func makeCollapsedConstraints( ) -> [ NSLayoutConstraint ] {
182182 let padding : CGFloat = 10
183183 var constraints = [
184- imageView. centerYAnchor . constraint ( equalTo: blurView. centerYAnchor ) ,
184+ imageView. topAnchor . constraint ( equalTo: blurView. topAnchor , constant : 18 ) ,
185185 imageView. widthAnchor. constraint ( equalToConstant: 30 ) ,
186186 imageView. heightAnchor. constraint ( equalToConstant: 27 ) ,
187187
188- textLabel. topAnchor. constraint ( equalTo: imageView. topAnchor) ,
188+ textLabel. topAnchor. constraint ( equalTo: imageView. topAnchor, constant : - 3 ) ,
189189 textLabel. leadingAnchor. constraint ( equalTo: imageView. trailingAnchor, constant: 10 )
190190 ]
191191
0 commit comments