탐색 - 배너 광고 추가

This commit is contained in:
Yu Sung
2023-09-16 01:11:50 +09:00
parent 6e9aaa0c8a
commit 4c9e78f960
3 changed files with 14 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
import SwiftUI
import Kingfisher
import GoogleMobileAds
struct ExplorerView: View {
@@ -83,7 +84,8 @@ struct ExplorerView: View {
} else {
ScrollView(.vertical, showsIndicators: false) {
VStack(spacing: 26.7) {
ForEach(viewModel.explorerSections, id: \.self) { section in
ForEach(0..<viewModel.explorerSections.count, id: \.self) { index in
let section = viewModel.explorerSections[index]
VStack(alignment: .leading, spacing: 13.3) {
if let coloredTitle = section.coloredTitle, let color = section.color {
let titleArray = section.title.components(separatedBy: coloredTitle)
@@ -144,6 +146,15 @@ struct ExplorerView: View {
}
}
.frame(width: screenSize().width - 26.7, alignment: .leading)
if index == 1 {
BannerAdView(adUnitId: EXPLORER_BANNER_AD_UNIT_ID)
.frame(
width: screenSize().width,
height: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(screenSize().width).size.height
)
.padding(.top, 26.7)
}
}
}
}