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
16 changes: 11 additions & 5 deletions src/iOS/KickTube/KickTube.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
532F31862D364BC200D2C67E /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 532F31852D364BC200D2C67E /* RxSwift */; };
532F31892D364BCE00D2C67E /* ReactorKit in Frameworks */ = {isa = PBXBuildFile; productRef = 532F31882D364BCE00D2C67E /* ReactorKit */; };
532F318B2D364C2E00D2C67E /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = 532F318A2D364C2E00D2C67E /* .gitignore */; };
535C62AD2D67223C00780496 /* ManipulateDataModel in Frameworks */ = {isa = PBXBuildFile; productRef = 535C62AC2D67223C00780496 /* ManipulateDataModel */; };
53301E712D67007800C0C272 /* ManipulateDataModel in Frameworks */ = {isa = PBXBuildFile; productRef = 53301E702D67007800C0C272 /* ManipulateDataModel */; };
53A863DC2D4FB72E009FF8E2 /* RxDataSources in Frameworks */ = {isa = PBXBuildFile; productRef = 53A863DB2D4FB72E009FF8E2 /* RxDataSources */; };
53FDEFDD2D3E12C400825962 /* ManipulateDataModel in Frameworks */ = {isa = PBXBuildFile; productRef = 5351F2E02D392C600093EB87 /* ManipulateDataModel */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -98,7 +98,7 @@
buildActionMask = 2147483647;
files = (
5305C58C2D62471500144DFF /* ManipulateDataModel in Frameworks */,
535C62AD2D67223C00780496 /* ManipulateDataModel in Frameworks */,
53301E712D67007800C0C272 /* ManipulateDataModel in Frameworks */,
53FDEFDD2D3E12C400825962 /* ManipulateDataModel in Frameworks */,
532F31862D364BC200D2C67E /* RxSwift in Frameworks */,
532F31842D364BC200D2C67E /* RxCocoa in Frameworks */,
Expand Down Expand Up @@ -174,7 +174,7 @@
53C955992D40BC23004D4DA2 /* ManipulateDataModel */,
53A863DB2D4FB72E009FF8E2 /* RxDataSources */,
5320CF802D5206BB00EF722E /* YouTubeiOSPlayerHelper */,
535C62AC2D67223C00780496 /* ManipulateDataModel */,
53301E702D67007800C0C272 /* ManipulateDataModel */,
);
productName = KickTube;
productReference = 532F31322D3649CA00D2C67E /* KickTube.app */;
Expand Down Expand Up @@ -258,7 +258,7 @@
532F31872D364BCE00D2C67E /* XCRemoteSwiftPackageReference "ReactorKit" */,
53A863DA2D4FB72E009FF8E2 /* XCRemoteSwiftPackageReference "RxDataSources" */,
5320CF7F2D5206BB00EF722E /* XCRemoteSwiftPackageReference "youtube-ios-player-helper" */,
535C62AB2D67223C00780496 /* XCRemoteSwiftPackageReference "ManipulateDataModel" */,
53301E6F2D67007800C0C272 /* XCRemoteSwiftPackageReference "ManipulateDataModel" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 532F31332D3649CA00D2C67E /* Products */;
Expand Down Expand Up @@ -661,7 +661,8 @@
minimumVersion = 3.2.0;
};
};
535C62AB2D67223C00780496 /* XCRemoteSwiftPackageReference "ManipulateDataModel" */ = {

53301E6F2D67007800C0C272 /* XCRemoteSwiftPackageReference "ManipulateDataModel" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/KSK9820/ManipulateDataModel.git";
requirement = {
Expand Down Expand Up @@ -705,6 +706,11 @@
package = 532F31872D364BCE00D2C67E /* XCRemoteSwiftPackageReference "ReactorKit" */;
productName = ReactorKit;
};
53301E702D67007800C0C272 /* ManipulateDataModel */ = {
isa = XCSwiftPackageProductDependency;
package = 53301E6F2D67007800C0C272 /* XCRemoteSwiftPackageReference "ManipulateDataModel" */;
productName = ManipulateDataModel;
};
5351F2E02D392C600093EB87 /* ManipulateDataModel */ = {
isa = XCSwiftPackageProductDependency;
productName = ManipulateDataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ final class ChatReactor: Reactor {
return getUnreadMessage()
case .getNewMessage:
// let newMessage = SampleTest.unreads[0].toModel().toModel()

// return .just(.appendNewMessage(newMessage))
return .empty()
case .sendMessage(let message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ final class PlayListViewModel {
let playlistSubject = BehaviorSubject<[KickRoomPlaylistViewModel]>(value: playlist)
let videoListSubject = PublishSubject<[YoutubeVideoViewModel]>()
let validVideoSubject = PublishSubject<[YoutubeVideoViewModel]>()


playlistSubject
.take(1)
.flatMap { [weak self] playlist -> Single<[YoutubeVideoViewModel]> in
guard let self else { return .error(NetworkError.unknown) }

let youtubeID = playlist.compactMap { $0.url.youtubeID }
return self.getYoutubeSearchResult(with: youtubeID)

return self.getYoutubeSearchResult(with: youtubeID)
}
.subscribe(with: self) { owner, value in
owner.videoList = value
Expand Down Expand Up @@ -132,6 +132,17 @@ final class PlayListViewModel {
}
.disposed(by: disposeBag)

videoListSubject
.subscribe(with: self) { owner, value in
guard let roomID = owner.roomID else { return }

let playlist = value.enumerated().map { PlaylistRequestDTO(url: $0.element.id.youtubeLink, order: $0.offset) }
let request = RoomPlaylistRequestDTO(roomID: roomID, playlist: playlist)

owner.changePlaylist(request)
}
.disposed(by: disposeBag)

return Output(playlist: videoListSubject, validVideo: validVideoSubject)
}

Expand Down Expand Up @@ -177,9 +188,11 @@ final class PlayListViewModel {
Task {
do {
_ = try await self.session.send(playlistRequest)
print("success")
} catch {
print(error)
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ final class HomeViewController: BaseViewController<HomeReactor> {
cellIdentifier: HomeVideoCollectionViewCell.reuseIdentifier,
cellType: HomeVideoCollectionViewCell.self
)) { row, element, cell in
if let videoID = element.videoID,
if let videoID = element.playlistURL?.youtubeID,
element.videoThumbnail == nil {
reactor.action.onNext(.getVideoThumbnail(idx: row, id: videoID))
}
Expand All @@ -84,8 +84,10 @@ final class HomeViewController: BaseViewController<HomeReactor> {
.asDriver(onErrorJustReturn: "")
.drive(with: self) { owner, value in
let vc = KickRoomViewController(KickRoomReactor(value))

owner.navigationController?.pushViewController(vc, animated: false)

vc.modalPresentationStyle = .overFullScreen

owner.present(vc, animated: true)
}
.disposed(by: disposeBag)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,8 @@ final class KickRoomViewController: BaseViewController<KickRoomReactor> {
override func viewDidLoad() {
super.viewDidLoad()

navigationController?.interactivePopGestureRecognizer?.delegate = self
navigationController?.interactivePopGestureRecognizer?.isEnabled = true

setNotification()
}

override func viewDidAppear(_ animated: Bool) {

setPopView()
}

override func viewWillDisappear(_ animated: Bool) {
Expand Down Expand Up @@ -225,6 +219,12 @@ final class KickRoomViewController: BaseViewController<KickRoomReactor> {
)
}

private func setPopView() {
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(handlePanGesture(_:)))

view.addGestureRecognizer(panGesture)
}

private func presentChattingView() {
guard let roomID = reactor.currentState.roomInfo?.roomDetail.roomInfo.roomID else { return }

Expand Down Expand Up @@ -270,6 +270,22 @@ final class KickRoomViewController: BaseViewController<KickRoomReactor> {
}
}

@objc
private func handlePanGesture(_ gesture: UIPanGestureRecognizer) {
let translation = gesture.translation(in: view)

if translation.y > 0 {
if gesture.velocity(in: view).y > 1000 {
navigationController?.popViewController(animated: true)
self.dismiss(animated: true, completion: nil)
}
}

if gesture.state == .ended || gesture.state == .cancelled {
gesture.setTranslation(.zero, in: view)
}
}


// MARK: - configure UI

Expand Down Expand Up @@ -362,5 +378,3 @@ extension KickRoomViewController: YTPlayerViewDelegate {
timeTrackingTimer = nil
}
}

extension KickRoomViewController: UIGestureRecognizerDelegate {}
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ final class LoginViewController: BaseViewController<LoginReactor> {
}
private let idTextField = LightStrokeTextField().then {
$0.setPlacehodler("아이디")
$0.textfield.text = "[email protected]"
$0.textfield.text = SampleTest.id
}
private let pwTextField = LightStrokeTextField().then {
$0.setPlacehodler("비밀번호")
$0.setPWStyle()
$0.textfield.text = "!1234qwer"
$0.textfield.text = SampleTest.password
}
private let saveIDCheckBox = CheckBoxView("아이디 저장")
private let loginButton = RoundButton("로그인")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class MyRoomViewController: BaseViewController<MyRoomReactor> {
return UICollectionViewCell()
}

if let videoID = room.videoID,
if let videoID = room.playlistURL?.youtubeID,
room.videoThumbnail == nil {
self.reactor.action.onNext(.getVideoThumbnail(idx: indexPath, id: videoID))
}
Expand All @@ -48,7 +48,7 @@ final class MyRoomViewController: BaseViewController<MyRoomReactor> {
return UICollectionViewCell()
}

if let videoID = room.videoID,
if let videoID = room.playlistURL?.youtubeID,
room.videoThumbnail == nil {
self.reactor.action.onNext(.getVideoThumbnail(idx: indexPath, id: videoID))
}
Expand Down
8 changes: 0 additions & 8 deletions src/iOS/ManipulateDataModel/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>ManipulateDataModel.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>ManipulateDataModelClient.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
15 changes: 0 additions & 15 deletions src/iOS/ManipulateDataModel/Package.resolved

This file was deleted.

51 changes: 0 additions & 51 deletions src/iOS/ManipulateDataModel/Package.swift

This file was deleted.

This file was deleted.

Loading
Loading