Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Poppool/Poppool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3842,7 +3842,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = com.poppoolIOS.poppool;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down Expand Up @@ -3880,7 +3880,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0.5;
MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = com.poppoolIOS.poppool;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
Expand Down
4 changes: 2 additions & 2 deletions Poppool/Poppool/Presentation/Admin/AdminReactor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ final class AdminReactor: Reactor {
case .viewDidLoad, .reloadData:
return .concat([
.just(.setIsLoading(true)),
useCase.fetchStoreList(query: nil, page: 0, size: 20)
useCase.fetchStoreList(query: nil, page: 0, size: 100)
.map { .setStores($0.popUpStoreList ?? []) }, // ✅ nil 방지
.just(.setIsLoading(false))
])

case let .updateSearchQuery(query):
return .concat([
.just(.setIsLoading(true)),
useCase.fetchStoreList(query: query, page: 0, size: 20)
useCase.fetchStoreList(query: query, page: 0, size: 100)
.do(onNext: { response in
Logger.log(message: "조회 성공 - 응답 데이터: \(response)", category: .info)
}, onError: { error in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ final class HomeReactor: Reactor {
switch action {
case .changeIndicatorColor(let controller, let row):
if !loginImageBannerSection.isEmpty {
loginImageBannerSection.inputDataList[0].imagePaths[row].isBrightImagePath { [weak controller] isBright in
loginImageBannerSection.inputDataList[0].imagePaths[row - 1].isBrightImagePath { [weak controller] isBright in
controller?.systemStatusBarIsDark.accept(isBright)
}
}
Expand Down Expand Up @@ -272,7 +272,7 @@ final class HomeReactor: Reactor {
if isLoign {
switch indexPath.section {
case 0:
if let id = loginImageBannerSection.inputDataList.first?.idList[indexPath.row] {
if let id = loginImageBannerSection.inputDataList.first?.idList[indexPath.row - 1] {
let controller = DetailController()
controller.reactor = DetailReactor(popUpID: id)
currentController.navigationController?.pushViewController(controller, animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ final class ImageBannerSectionCell: UICollectionViewCell {

let bannerTapped: PublishSubject<Int> = .init()

private var currentIndex: Int = 1
private var stopButtonLeadingConstraints: Constraint?
private var playButtonLeadingConstraints: Constraint?
private var isHiddenPauseButton: Bool = true

// MARK: - init

Expand Down Expand Up @@ -102,7 +104,11 @@ final class ImageBannerSectionCell: UICollectionViewCell {
playButton.isHidden = true
isAutoBannerPlay = true
autoScrollTimer = Timer.scheduledTimer(withTimeInterval: interval, repeats: true) { [weak self] _ in
self?.scrollToNextItem()
guard let self = self else { return }
self.contentCollectionView.scrollToItem(
at: .init(row: self.currentIndex + 1, section: 0),
at: .centeredHorizontally, animated: true
)
}
}
}
Expand Down Expand Up @@ -149,20 +155,6 @@ private extension ImageBannerSectionCell {
func getSection() -> [any Sectionable] {
return [imageSection]
}

// 다음 배너로 스크롤
private func scrollToNextItem() {

let visibleIndexPaths = contentCollectionView.indexPathsForVisibleItems.sorted()
guard let currentIndex = visibleIndexPaths.first else { return }

let nextIndex = IndexPath(
item: (currentIndex.item + 1) % imageSection.dataCount,
section: currentIndex.section
)
contentCollectionView.scrollToItem(at: nextIndex, at: .centeredHorizontally, animated: true)
pageControl.currentPage = nextIndex.item
}

private func findViewController() -> BaseViewController? {
var nextResponder = self.next
Expand Down Expand Up @@ -202,7 +194,11 @@ private extension ImageBannerSectionCell {
.distinctUntilChanged()
.withUnretained(self)
.subscribe { (owner, index) in
owner.pageControl.currentPage = index
var index = index
owner.currentIndex = index
if index == 0 { index = 1 }
if index == owner.imageSection.dataCount - 1 { index = owner.imageSection.dataCount - 2 }
owner.pageControl.currentPage = index - 1
}
.disposed(by: disposeBag)
}
Expand All @@ -216,15 +212,27 @@ extension ImageBannerSectionCell: Inputable {
}

func injection(with input: Input) {
pageControl.numberOfPages = input.imagePaths.count
let stopButtonLeadingOffset = input.imagePaths.count == 3 ? -40 : input.imagePaths.count == 2 ? -36 : 0
stopButtonLeadingConstraints?.update(offset: stopButtonLeadingOffset)
playButtonLeadingConstraints?.update(offset: stopButtonLeadingOffset)
let datas = zip(input.imagePaths, input.idList)
imageSection.inputDataList = datas.map { .init(imagePath: $0.0, id: $0.1) }
if imageSection.isEmpty {
pageControl.numberOfPages = input.imagePaths.count
let stopButtonLeadingOffset = input.imagePaths.count == 3 ? -40 : input.imagePaths.count == 2 ? -36 : 0
stopButtonLeadingConstraints?.update(offset: stopButtonLeadingOffset)
playButtonLeadingConstraints?.update(offset: stopButtonLeadingOffset)
let datas = zip(input.imagePaths, input.idList)
let backContents = datas.suffix(1)
let frontContents = datas.prefix(1)
imageSection.inputDataList = datas.map { .init(imagePath: $0.0, id: $0.1) }
imageSection.inputDataList.append(contentsOf: frontContents.map { .init(imagePath: $0.0, id: $0.1) })
imageSection.inputDataList = backContents.map {.init(imagePath: $0.0, id: $0.1) } + imageSection.inputDataList
DispatchQueue.main.async { [weak self] in
self?.contentCollectionView.scrollToItem(
at: .init(row: 1, section: 0),
at: .centeredHorizontally, animated: false
)
}
}

contentCollectionView.reloadData()

isHiddenPauseButton = input.isHiddenPauseButton
if isFirstResponseAutoScroll {
startAutoScroll()
isFirstResponseAutoScroll = false
Expand Down Expand Up @@ -267,4 +275,23 @@ extension ImageBannerSectionCell: UICollectionViewDelegate, UICollectionViewData
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
bannerTapped.onNext(indexPath.row)
}

func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
if currentIndex == 0 {
contentCollectionView.scrollToItem(
at: .init(row: imageSection.dataCount - 2, section: 0),
at: .centeredHorizontally, animated: false
)
}
if currentIndex == imageSection.dataCount - 1 {
contentCollectionView.scrollToItem(
at: .init(row: 1, section: 0),
at: .centeredHorizontally, animated: false
)
}
if !isHiddenPauseButton {
startAutoScroll()
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@ class BaseViewController: UIViewController {
systemStatusBarIsDark
.withUnretained(self)
.subscribe { (owner, isDark) in
UIView.animate(withDuration: 0.3) { [weak owner] in
if isDark {
owner?.navigationController?.navigationBar.barStyle = .default
} else {
owner?.navigationController?.navigationBar.barStyle = .black
}
if isDark {
owner.navigationController?.navigationBar.barStyle = .default
} else {
owner.navigationController?.navigationBar.barStyle = .black
}

}
.disposed(by: systemStatusBarDisposeBag)
}
Expand Down