Skip to content

Commit

Permalink
♻️ 리뷰 사항 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Dec 4, 2023
1 parent 4cb3792 commit 76e884a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
12 changes: 6 additions & 6 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackInteractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {
}

func setInitialPlaybackCell() {
guard let parentView else { return }
guard let index else { return }
guard let parentView,
let index else { return }
let response: Models.SetInitialPlaybackCell.Response
switch parentView {
case .home:
Expand Down Expand Up @@ -124,8 +124,8 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {
}

func playTeleportVideo(with request: PlaybackModels.DisplayPlaybackVideo.Request) {
guard let isTeleport else { return }
guard let posts else { return }
guard let isTeleport,
let posts else { return }
if isTeleport {
if request.indexPathRow == 1 || request.indexPathRow == (posts.count - 2) {
let response: Models.DisplayPlaybackVideo.Response = Models.DisplayPlaybackVideo.Response(prevCell: prevCell, curCell: request.curCell)
Expand All @@ -142,8 +142,8 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {
}

func configurePlaybackCell() {
guard let posts else { return }
guard let parentView else { return }
guard let posts,
let parentView else { return }
let response: Models.ConfigurePlaybackCell.Response
switch parentView {
case .home:
Expand Down
5 changes: 0 additions & 5 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ enum PlaybackModels {
let videoURL: URL
}

struct PlaybackViewInfo {
let parentView: ParentView
let videos: [PlaybackVideo]
}

// MARK: - UseCase Load Video List

enum LoadPlaybackVideoList {
Expand Down
16 changes: 14 additions & 2 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ final class PlaybackViewController: BaseViewController {
playerSlider.value = Float(CMTimeGetSeconds(currentTime) / CMTimeGetSeconds(duration))
}

private func slowShowPlayerSlider() async {
do {
try await Task.sleep(nanoseconds: 1_000_000_00)
playerSlider.isHidden = false
} catch {
os_log("Falie Waiting show Player Slider")
}
}

@objc private func didChangedSliderValue(_ sender: LOSlider) {
let request: Models.SeekVideo.Request = Models.SeekVideo.Request(currentLocation: Float64(sender.value))
interactor?.controlPlaybackMovie(with: request)
Expand Down Expand Up @@ -173,8 +182,11 @@ extension PlaybackViewController: PlaybackDisplayLogic {
curCell.playbackView.playPlayer()
setPlayerSlider(at: curCell.playbackView)
// Slider가 원점으로 돌아가는 시간 필요
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) {
self.playerSlider.isHidden = false
// DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1) {
// self.playerSlider.isHidden = false
// }
Task {
await slowShowPlayerSlider()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions iOS/Layover/Layover/Scenes/Playback/PlaybackWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ final class PlaybackWorker {

func makeInfiniteScroll(posts: [Post]) -> [Post] {
var tempVideos: [Post] = posts
var tempLastVideo: Post = posts[tempVideos.count-1]
var tempFirstVideo: Post = posts[1]
let tempLastVideo: Post = posts[tempVideos.count-1]
let tempFirstVideo: Post = posts[1]
tempVideos.insert(tempLastVideo, at: 0)
tempVideos.append(tempFirstVideo)
return tempVideos
Expand Down
7 changes: 7 additions & 0 deletions iOS/Layover/Layover/Scenes/Profile/ProfileModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import UIKit

enum ProfileModels {

struct Member: Hashable {
let identifier: Int
let username: String
let introduce: String?
let profileImageURL: URL?
}

enum FetchProfile {
struct Request {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ extension ProfileViewController: ProfileDisplayLogic {
thumbnailCollectionView.dataSource = videoDatasource
var snapshot = NSDiffableDataSourceSnapshot<Section, AnyHashable>()
snapshot.appendSections([.profileInfo, .thumnail])
snapshot.appendItems([Member(identifier: 0,
snapshot.appendItems([Models.Member(identifier: 0,
username: viewModel.nickname,
introduce: viewModel.introduce,
profileImageURL: viewModel.profileImageURL)],
Expand Down

0 comments on commit 76e884a

Please sign in to comment.