Skip to content

Commit

Permalink
🐛 Rewind Scene에서 상단 프로그래스바 하이라이트가 동작하지 않는 현상
Browse files Browse the repository at this point in the history
  • Loading branch information
mingun authored and mingun committed Dec 10, 2023
1 parent b5495e8 commit 16b2aff
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@
INFOPLIST_FILE = RewindJourneyDemo/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
Expand Down Expand Up @@ -321,7 +320,6 @@
INFOPLIST_FILE = RewindJourneyDemo/Info.plist;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
MSFont.registerFonts()

let repository = SpotRepositoryImplementation()
let viewModel = RewindJourneyViewModel(repository: repository)
let viewModel = RewindJourneyViewModel(photoURLs: [URL(string: "https://www.google.com/url?sa=i&url=https%3A%2F%2Fm.youtube.com%2Fwatch%3Fv%3DWs5VJ1Ig1EY&psig=AOvVaw3vmGcqNwsTcGM-J59la6qB&ust=1702326229170000&source=images&cd=vfe&opi=89978449&ved=0CBEQjRxqFwoTCNDNosTZhYMDFQAAAAAdAAAAABAD")!,
URL(string: "https://www.google.com/url?sa=i&url=https%3A%2F%2Fnamu.wiki%2Fw%2F%25EC%25BC%2580%25EC%259D%25B8%2528%25EC%259D%25B8%25ED%2584%25B0%25EB%2584%25B7%2520%25EB%25B0%25A9%25EC%2586%25A1%25EC%259D%25B8%2529%2F%25EB%25B0%2588&psig=AOvVaw0qY6irtYIsc68tIwsIwJF4&ust=1702326282656000&source=images&cd=vfe&opi=89978449&ved=0CBEQjRxqFwoTCOjSpt3ZhYMDFQAAAAAdAAAAABAD")!], repository: repository)
let viewController = RewindJourneyViewController(viewModel: viewModel)

window.rootViewController = viewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public final class MSProgressView: UIProgressView {
// MARK: - Functions: change progress

private func syncProgress(percentage: Float) {
self.progress = percentage
DispatchQueue.main.async { self.progress = percentage }
}

// MARK: - Timer
Expand All @@ -67,6 +67,7 @@ public final class MSProgressView: UIProgressView {
self.progressViewModel.timerPublisher
.sink { [weak self] currentPercentage in
self?.percentage = currentPercentage
print(currentPercentage)
}
.store(in: &timerSubscriber)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ final class MSProgressViewModel {
// MARK: - Functions: Timers

internal func startTimer() {
self.timer = Timer.publish(every: self.timerTimeInterval, on: .main, in: .common)
self.timer = Timer.publish(every: self.timerTimeInterval, on: .current, in: .common)
.autoconnect()
.receive(on: DispatchQueue.global(qos: .background))
.sink { [weak self] _ in
guard let remainingTime = self?.remainingTime,
let timerDuration = self?.timerDuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public final class RewindJourneyViewController: UIViewController {

private var cancellables: Set<AnyCancellable> = []
private var presentingImageIndex: Int? {
didSet { self.changeProgressViews() }
didSet {
print("\(self.presentingImageIndex)번이 선택됨")
self.changeProgressViews()
}
}

// MARK: - Properties: Timer
Expand Down Expand Up @@ -183,6 +186,7 @@ public final class RewindJourneyViewController: UIViewController {
urls.forEach { _ in
let progressView = MSProgressView()
self.progressStackView.addArrangedSubview(progressView)
if self.progressViews == nil { self.progressViews = [] }
self.progressViews?.append(progressView)
}
}
Expand Down

0 comments on commit 16b2aff

Please sign in to comment.