Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
KangTaeHoon committed Oct 27, 2024
2 parents 32ca182 + 3739097 commit ce36c31
Show file tree
Hide file tree
Showing 35 changed files with 406 additions and 181 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Select Xcode 15.4
run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
- name: Select Xcode 16.0
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer

- name: Compute package dependency cache key
id: compute_package_hash
Expand Down Expand Up @@ -85,8 +85,8 @@ jobs:
- name: List Xcode installations
run: sudo ls -1 /Applications | grep "Xcode"

- name: Select Xcode 15.4
run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
- name: Select Xcode 16.0
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer

- name: Show swift version
run: swift --version
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "realm/realm-swift" == 10.50.1
github "realm/realm-swift" == 20.0.0
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "realm/realm-swift" "v10.50.1"
github "realm/realm-swift" "v20.0.0"
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "769b88d83a42ca8d5572b020c96f47e3690b3796",
"version" : "4.4.3"
"revision" : "fe4c6fe3a0aa66cdeb51d549623c82ca9704b9a5",
"version" : "4.5.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let package = Package(
.package(url: "https://github.com/devxoul/Then", from: "3.0.0"),
.package(url: "https://github.com/SnapKit/SnapKit.git", from: "5.7.1"),
.package(url: "https://github.com/ashleymills/Reachability.swift", from: "5.2.1"),
.package(url: "https://github.com/airbnb/lottie-ios.git", from: "4.4.3"),
.package(url: "https://github.com/airbnb/lottie-ios.git", from: "4.5.0"),
.package(url: "https://github.com/uber/needle.git", from: "0.24.0"),
.package(url: "https://github.com/uias/Tabman.git", from: "3.2.0"),
.package(url: "https://github.com/RxSwiftCommunity/RxDataSources.git", from: "5.0.2"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public let env = ProjectEnvironment(
deploymentTargets: .iOS("15.0"),
destinations: [.iPhone],
baseSetting: SettingsDictionary()
.marketingVersion("3.0.2")
.marketingVersion("3.1.0")
.currentProjectVersion("0")
.debugInformationFormat(DebugInformationFormat.dwarfWithDsym)
.otherLinkerFlags(["-ObjC"])
Expand Down
5 changes: 4 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import Foundation
import ProjectDescription
import ProjectDescriptionHelpers

let alternativeAppIconNames: [String] = ["HalloweenAppIcon", " XmasAppIcon"]

let settinges: Settings =
.settings(
base: env.baseSetting,
base: env.baseSetting
.merging(["ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES": .array(alternativeAppIconNames)]),
configurations: [
.debug(name: .debug),
.debug(name: .qa),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "HalloweenAppIcon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "XmasAppIcon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Projects/App/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>naversearchapp</string>
<string>naversearchthirdlogin</string>
<string>naversearchapp</string>
<string>naversearchthirdlogin</string>
<string>youtube</string>
<string>youtubemusic</string>
</array>
Expand All @@ -74,8 +74,8 @@
<string>$(BASE_DEV_URL)</string>
<key>BASE_PROD_URL</key>
<string>$(BASE_PROD_URL)</string>
<key>CDN_DOMAIN_URL</key>
<string>$(CDN_DOMAIN_URL)</string>
<key>CDN_DOMAIN_URL</key>
<string>$(CDN_DOMAIN_URL)</string>
<key>GOOGLE_CLIENT_ID</key>
<string>$(GOOGLE_CLIENT_ID)</string>
<key>GOOGLE_URL_SCHEME</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ public struct AppCheckEntity: Equatable {
title: String,
description: String,
version: String,
specialLogo: Bool
isSpecialLogo: Bool
) {
self.flag = flag
self.title = title
self.description = description
self.version = version
self.specialLogo = specialLogo
self.isSpecialLogo = isSpecialLogo
}

public let flag: AppCheckFlagType
public let title, description, version: String
public let specialLogo: Bool
public let isSpecialLogo: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public extension FetchAppCheckResponseDTO {
title: title ?? "",
description: description ?? "",
version: version ?? "",
specialLogo: specialLogo ?? false
isSpecialLogo: specialLogo ?? false
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ final class MyPlaylistDetailReactor: Reactor {
case editButtonDidTap
case privateButtonDidTap
case completionButtonDidTap
case didLongPressedPlaylist(IndexPath)
case restore
case itemDidMoved(Int, Int)
case forceSave
Expand All @@ -25,6 +26,7 @@ final class MyPlaylistDetailReactor: Reactor {
case changeImageData(PlaylistImageKind)
case shareButtonDidTap
case moreButtonDidTap
case didTapSwippedRemoveButton(IndexPath)
}

enum Mutation {
Expand Down Expand Up @@ -120,6 +122,9 @@ final class MyPlaylistDetailReactor: Reactor {
case .editButtonDidTap:
return beginEditing()

case let .didLongPressedPlaylist(indexPath):
return didLongPressedPlaylist(indexPath: indexPath)

case .privateButtonDidTap:
return updatePrivate()

Expand Down Expand Up @@ -147,14 +152,20 @@ final class MyPlaylistDetailReactor: Reactor {
return deselectAll()

case .removeSongs:
return removeSongs()
return removeSongs(
targets: currentState.playlistModels.filter { $0.isSelected }
)

case let .changeImageData(imageData):
return updateImageData(imageData: imageData)
case .shareButtonDidTap:
return updateShareLink()
case .moreButtonDidTap:
return updateShowEditSheet(flag: !self.currentState.showEditSheet)

case let .didTapSwippedRemoveButton(index):
let target = currentState.playlistModels[index.row]
return removeSongs(targets: [target])
}
}

Expand Down Expand Up @@ -244,6 +255,14 @@ private extension MyPlaylistDetailReactor {
])
}

func didLongPressedPlaylist(indexPath: IndexPath) -> Observable<Mutation> {
guard !currentState.isEditing else { return .empty() }
return .concat(
updateItemSelected(indexPath.row),
beginEditing()
)
}

func endEditingWithSave() -> Observable<Mutation> {
let state = currentState
let currentPlaylists = state.playlistModels
Expand Down Expand Up @@ -450,12 +469,9 @@ private extension MyPlaylistDetailReactor {
])
}

func removeSongs() -> Observable<Mutation> {
let state = currentState
let playlists = state.playlistModels

let remainSongs = playlists.filter { !$0.isSelected }
let removeSongs = playlists.filter { $0.isSelected }.map { $0.id }
func removeSongs(targets: [PlaylistItemModel]) -> Observable<Mutation> {
let remainSongs = currentState.playlistModels.filter { !targets.contains($0) }
let removeSongs = targets.map { $0.id }
var prevHeader = currentState.header
prevHeader.updateSongCount(remainSongs.count)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ final class MyPlaylistDetailViewController: BaseReactorViewController<MyPlaylist
$0.tableHeaderView = headerView
$0.separatorStyle = .none
$0.contentInset = .init(top: .zero, left: .zero, bottom: 60.0, right: .zero)
$0.allowsSelectionDuringEditing = true
}

private lazy var completionButton: RectangleButton = RectangleButton().then {
Expand Down Expand Up @@ -159,14 +160,11 @@ final class MyPlaylistDetailViewController: BaseReactorViewController<MyPlaylist
}
}

override func configureUI() {
super.configureUI()
}

override func bind(reactor: MyPlaylistDetailReactor) {
super.bind(reactor: reactor)
tableView.rx.setDelegate(self)
.disposed(by: disposeBag)
tableView.dragDelegate = self
}

override func bindAction(reactor: MyPlaylistDetailReactor) {
Expand Down Expand Up @@ -256,13 +254,17 @@ final class MyPlaylistDetailViewController: BaseReactorViewController<MyPlaylist

tableView.rx.itemSelected
.bind(with: self) { owner, indexPath in
if owner.reactor?.currentState.isEditing == true {
owner.tableView.deselectRow(at: IndexPath(row: indexPath.row, section: 0), animated: false)
owner.reactor?.action.onNext(.itemDidTap(indexPath.row))
} else {
guard let model = owner.dataSource.itemIdentifier(for: indexPath) else { return }

guard let model = owner.dataSource.itemIdentifier(for: indexPath) else { return }

PlayState.shared.append(item: .init(id: model.id, title: model.title, artist: model.artist))
let playlistIDs = PlayState.shared.currentPlaylist
.map(\.id)
owner.songDetailPresenter.present(ids: playlistIDs, selectedID: model.id)
PlayState.shared.append(item: .init(id: model.id, title: model.title, artist: model.artist))
let playlistIDs = PlayState.shared.currentPlaylist
.map(\.id)
owner.songDetailPresenter.present(ids: playlistIDs, selectedID: model.id)
}
}
.disposed(by: disposeBag)
}
Expand Down Expand Up @@ -493,7 +495,7 @@ extension MyPlaylistDetailViewController {
}

/// 테이블 뷰 델리게이트
extension MyPlaylistDetailViewController: UITableViewDelegate {
extension MyPlaylistDetailViewController: UITableViewDelegate, UITableViewDragDelegate {
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGFloat(60.0)
}
Expand Down Expand Up @@ -533,6 +535,33 @@ extension MyPlaylistDetailViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool {
return false // 편집모드 시 셀의 들여쓰기를 없애려면 false를 리턴합니다.
}

public func tableView(
_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath
) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .destructive, title: "삭제") { [weak self] _, _, _ in
guard let self else { return }
self.reactor?.action.onNext(.didTapSwippedRemoveButton(indexPath))
}

deleteAction.backgroundColor = DesignSystemAsset.PrimaryColorV2.increase.color

let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
configuration.performsFirstActionWithFullSwipe = false

return configuration
}

public func tableView(
_ tableView: UITableView,
itemsForBeginning session: any UIDragSession,
at indexPath: IndexPath
) -> [UIDragItem] {
let dragItem = UIDragItem(itemProvider: NSItemProvider())
reactor?.action.onNext(.didLongPressedPlaylist(indexPath))
return [dragItem]
}
}

/// 전체재생 , 랜덤 재생 델리게이트
Expand Down Expand Up @@ -585,11 +614,6 @@ extension MyPlaylistDetailViewController: PlaylistTableViewCellDelegate {
playPlatform: model.title.isContainShortsTagTitle ? .youtube : .automatic
).play()
}

func superButtonTapped(index: Int) {
tableView.deselectRow(at: IndexPath(row: index, section: 0), animated: false)
reactor?.action.onNext(.itemDidTap(index))
}
}

/// swipe pop 델리게이트 , 편집모드 시 막기
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension PlaylistViewController: SongCartViewDelegate {
}
}

extension PlaylistViewController: UITableViewDelegate {
extension PlaylistViewController: UITableViewDelegate, UITableViewDragDelegate {
public func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -> UITableViewCell
.EditingStyle {
return .none // 편집모드 시 왼쪽 버튼을 숨기려면 .none을 리턴합니다.
Expand Down Expand Up @@ -109,6 +109,23 @@ extension PlaylistViewController: UITableViewDelegate {
return true // 모든 Cell 을 이동 가능하게 설정합니다.
}

public func tableView(
_ tableView: UITableView,
trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath
) -> UISwipeActionsConfiguration? {
let deleteAction = UIContextualAction(style: .destructive, title: "삭제") { [weak self] _, _, _ in
guard let self else { return }
self.didTapSwippedRemoveSongSubject.onNext(indexPath.row)
}

deleteAction.backgroundColor = DesignSystemAsset.PrimaryColorV2.increase.color

let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
configuration.performsFirstActionWithFullSwipe = false

return configuration
}

public func tableView(
_ tableView: UITableView,
targetIndexPathForMoveFromRowAt sourceIndexPath: IndexPath,
Expand All @@ -120,6 +137,16 @@ extension PlaylistViewController: UITableViewDelegate {
}
return proposedDestinationIndexPath
}

public func tableView(
_ tableView: UITableView,
itemsForBeginning session: any UIDragSession,
at indexPath: IndexPath
) -> [UIDragItem] {
let dragItem = UIDragItem(itemProvider: NSItemProvider())
didLongPressedSongSubject.onNext(indexPath.row)
return [dragItem]
}
}

extension PlaylistViewController: PlaylistTableViewCellDelegate {
Expand All @@ -132,8 +159,4 @@ extension PlaylistViewController: PlaylistTableViewCellDelegate {
playPlatform: model.title.isContainShortsTagTitle ? .youtube : .automatic
).play()
}

func superButtonTapped(index: Int) {
tappedCellIndex.onNext(index)
}
}
Loading

0 comments on commit ce36c31

Please sign in to comment.