@@ -2,7 +2,7 @@ import UIKit
22import Then
33import SnapKit
44
5- final class JobisToast : UIView {
5+ final class JobisToast : UIStackView {
66 private let imageView = UIImageView ( ) . then {
77 $0. image = DesignSystemAsset . Icons. toastIcon. image
88 }
@@ -13,7 +13,8 @@ final class JobisToast: UIView {
1313 textLabel. setJobisText ( text, font: . subHeadLine, color: . GrayScale. gray90)
1414 configureView ( )
1515 }
16- required init ? ( coder: NSCoder ) {
16+
17+ required init ( coder: NSCoder ) {
1718 fatalError ( " init(coder:) has not been implemented " )
1819 }
1920
@@ -22,20 +23,18 @@ final class JobisToast: UIView {
2223 self . layer. borderColor = UIColor . GrayScale. gray40. cgColor
2324 self . layer. borderWidth = 1
2425 self . backgroundColor = . GrayScale. gray30
26+ self . axis = . horizontal
27+ self . spacing = 4
28+ self . layoutMargins = . init( top: 12 , left: 16 , bottom: 12 , right: 16 )
29+ self . isLayoutMarginsRelativeArrangement = true
2530
2631 [
2732 imageView,
2833 textLabel
29- ] . forEach { self . addSubview ( $0) }
34+ ] . forEach { self . addArrangedSubview ( $0) }
3035
3136 imageView. snp. makeConstraints {
32- $0. leading. top. bottom. equalToSuperview ( ) . inset ( 12 )
3337 $0. width. height. equalTo ( 24 )
3438 }
35- textLabel. snp. makeConstraints {
36- $0. trailing. equalToSuperview ( ) . inset ( 16 )
37- $0. top. bottom. equalToSuperview ( ) . inset ( 12 )
38- $0. leading. equalTo ( imageView. snp. trailing) . offset ( 4 )
39- }
4039 }
4140}
0 commit comments