@@ -45,6 +45,8 @@ final class TutorialDetailViewController: UIViewController {
4545 }
4646
4747 private func configureAttribute( ) {
48+ view. backgroundColor = BitnagilColor . gray99
49+
4850 titleLabel. text = tutorial. title
4951 titleLabel. font = BitnagilFont ( style: . title3, weight: . semiBold) . font
5052 titleLabel. textColor = BitnagilColor . gray10
@@ -60,7 +62,6 @@ final class TutorialDetailViewController: UIViewController {
6062
6163 private func configureLayout( ) {
6264 let safeArea = view. safeAreaLayoutGuide
63- view. backgroundColor = BitnagilColor . gray99
6465
6566 view. addSubview ( titleLabel)
6667 view. addSubview ( descriptionLabel)
@@ -74,15 +75,17 @@ final class TutorialDetailViewController: UIViewController {
7475
7576 descriptionLabel. snp. makeConstraints { make in
7677 make. top. equalTo ( titleLabel. snp. bottom) . offset ( Layout . descriptionLabelTopSpacing)
77- make. leading. equalTo ( safeArea) . offset ( Layout . horizontalMargin)
78- make. trailing. equalTo ( safeArea) . inset ( Layout . horizontalMargin)
78+ make. horizontalEdges. equalTo ( safeArea) . inset ( Layout . horizontalMargin)
7979 make. height. equalTo ( Layout . descriptionLabelHeight)
8080 }
8181
8282 tutorialImage. snp. makeConstraints { make in
8383 make. top. equalTo ( descriptionLabel. snp. bottom) . offset ( Layout . tutorialImageTopSpacing)
84- make. leading. equalTo ( safeArea) . offset ( Layout . horizontalMargin)
85- make. trailing. equalTo ( safeArea) . inset ( Layout . horizontalMargin)
84+ make. horizontalEdges. equalTo ( safeArea) . inset ( Layout . horizontalMargin)
85+ if let image = tutorialImage. image {
86+ let aspectRatio = image. size. height / image. size. width
87+ make. height. equalTo ( tutorialImage. snp. width) . multipliedBy ( aspectRatio)
88+ }
8689 }
8790 }
8891}
0 commit comments