Skip to content

Commit

Permalink
Merge pull request #201 from boostcampwm2023/iOS/feat#199
Browse files Browse the repository at this point in the history
bug: 재생화면 스택 뷰 재사용 이슈
  • Loading branch information
chopmozzi authored Dec 4, 2023
2 parents 83de941 + 69950b6 commit 6a4721a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions iOS/Layover/Layover/DesignSystem/LOTagStackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ final class LOTagStackView: UIStackView {
addArrangedSubview(button)
}

func resetTagStackView() {
arrangedSubviews.forEach { $0.removeFromSuperview() }
}

private func setUI() {
self.alignment = .fill
self.distribution = .fillProportionally
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ final class PlaybackCell: UICollectionViewCell {
playbackView.descriptionView.titleLabel.text = info.title
playbackView.descriptionView.setText(info.content)
playbackView.profileLabel.text = info.profileName
playbackView.tagStackView.resetTagStackView()
info.tag.forEach { tag in
playbackView.tagStackView.addTag(tag)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ final class PlaybackViewController: BaseViewController {
let window = windowScene?.windows.first
guard let playerSliderWidth: CGFloat = windowScene?.screen.bounds.width else { return }
guard let windowHeight: CGFloat = windowScene?.screen.bounds.height else { return }
guard let tabBarHeight: CGFloat = self.tabBarController?.tabBar.frame.height else {
return
}
guard let tabBarHeight: CGFloat = self.tabBarController?.tabBar.frame.height else { return }
playerSlider.frame = CGRect(x: 0, y: (windowHeight - tabBarHeight - LOSlider.loSliderHeight / 2), width: playerSliderWidth, height: LOSlider.loSliderHeight)
window?.addSubview(playerSlider)
playerSlider.window?.windowLevel = UIWindow.Level.normal + 1
Expand All @@ -151,7 +149,7 @@ final class PlaybackViewController: BaseViewController {
try await Task.sleep(nanoseconds: 1_000_000_00)
playerSlider.isHidden = false
} catch {
os_log("Falie Waiting show Player Slider")
os_log("Fail Waiting show Player Slider")
}
}

Expand Down
3 changes: 2 additions & 1 deletion iOS/Layover/Layover/Scenes/Playback/PlaybackWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ final class PlaybackWorker {

func makeInfiniteScroll(posts: [Post]) -> [Post] {
var tempVideos: [Post] = posts
let tempLastVideo: Post = posts[tempVideos.count-1]
let tempFirstCellIndex: Int = posts.count == 1 ? 1 : 0
let tempLastVideo: Post = posts[tempFirstCellIndex]
let tempFirstVideo: Post = posts[1]
tempVideos.insert(tempLastVideo, at: 0)
tempVideos.append(tempFirstVideo)
Expand Down

0 comments on commit 6a4721a

Please sign in to comment.