Skip to content

Commit

Permalink
🎨 :: 코드 Formatting 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Nov 25, 2024
1 parent 39eb6e0 commit 0e90c4d
Show file tree
Hide file tree
Showing 24 changed files with 39 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ open class BaseRemoteDataSource<API: WMAPI>: @unchecked Sendable {
])
self.refreshProvider = MoyaProvider(plugins: [JwtPlugin(keychain: keychain)])
#endif

}

public func request(_ api: API) -> Single<Response> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

/*
/**
isSelected가 mutable이나 sendable하지 못함.
*/
public struct SongEntity: Hashable, @unchecked Sendable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SongsDomainInterface

// concurrency를 위한 Model의 Mutable 제거 필요
/// concurrency를 위한 Model의 Mutable 제거 필요
public struct FavoriteSongEntity: Equatable, @unchecked Sendable {
public init(songID: String, title: String, artist: String, like: Int) {
self.songID = songID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import SignInFeatureInterface
import UIKit
import Utility

public final class ArtistDetailViewController: UIViewController, ViewControllerFromStoryBoard, @preconcurrency ContainerViewType {
public final class ArtistDetailViewController: UIViewController, ViewControllerFromStoryBoard,
@preconcurrency ContainerViewType {
@IBOutlet weak var gradationView: UIView!
@IBOutlet weak var backButton: UIButton!
@IBOutlet weak var subscriptionButton: UIButton!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
import UIKit
import Utility

// 강제 mutable 타입 해결해야함... @preconcurrency
/// 강제 mutable 타입 해결해야함... @preconcurrency
public protocol EditSheetViewType: AnyObject {
var editSheetView: EditSheetView! { get set }
var bottomSheetView: BottomSheetView! { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
import UIKit
import Utility

// concurrency를 위해 mutable 상태 리팩토링 필요
/// concurrency를 위해 mutable 상태 리팩토링 필요
public protocol PlaylistEditSheetViewType: AnyObject {
var playlisteditSheetView: PlaylistEditSheetView! { get set }
var bottomSheetView: BottomSheetView! { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
import UIKit
import Utility

// SongCartViewType 어떻게든 해결해야함..
/// SongCartViewType 어떻게든 해결해야함..
public protocol SongCartViewType: AnyObject {
var songCartView: SongCartView! { get set }
var bottomSheetView: BottomSheetView! { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import UIKit
import Utility

open class BaseStoryboardReactorViewController<R: Reactor>: UIViewController,
@preconcurrency StoryboardView,
ViewControllerFromStoryBoard {
@preconcurrency StoryboardView,
ViewControllerFromStoryBoard {
public var disposeBag = DisposeBag()

override open func viewDidLoad() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import Then
import UIKit
import Utility

public final class ChartContentViewController: BaseViewController, ViewControllerFromStoryBoard, @preconcurrency SongCartViewType {
public final class ChartContentViewController: BaseViewController, ViewControllerFromStoryBoard,
@preconcurrency SongCartViewType {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var activityIncidator: NVActivityIndicatorView!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ extension HomeViewController: RecommendPlayListViewDelegate {

public extension HomeViewController {
nonisolated func equalHandleTapped() {
Task { @MainActor in
Task { @MainActor in
let viewControllersCount: Int = self.navigationController?.viewControllers.count ?? 0
if viewControllersCount > 1 {
self.navigationController?.popToRootViewController(animated: true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import SongsDomainInterface
import UIKit
import Utility

public class NewSongsContentViewController: UIViewController, ViewControllerFromStoryBoard, @preconcurrency SongCartViewType {
public class NewSongsContentViewController: UIViewController, ViewControllerFromStoryBoard,
@preconcurrency SongCartViewType {
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var activityIncidator: NVActivityIndicatorView!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import UIKit
import Utility

public final class MainTabBarViewController: BaseViewController,
ViewControllerFromStoryBoard,
@preconcurrency ContainerViewType {
ViewControllerFromStoryBoard,
@preconcurrency ContainerViewType {
@IBOutlet public weak var contentView: UIView!

private var previousIndex: Int?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ final class SettingReactor: Reactor {
)
}

let updatepushNotificationAuthorizationStatusMutation = PreferenceManager.shared.$pushNotificationAuthorizationStatus
let updatepushNotificationAuthorizationStatusMutation = PreferenceManager.shared
.$pushNotificationAuthorizationStatus
.skip(1)
.distinctUntilChanged()
.map { $0 ?? false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public final class OpenSourceLicenseViewModel: Sendable {
public struct Input: Sendable {
let viewDidLoad: PublishSubject<Void> = PublishSubject()
}

public struct Output: Sendable {
let dataSource: BehaviorRelay<[OpenSourceLicense]> = BehaviorRelay(value: [])
}
Expand Down Expand Up @@ -144,7 +145,7 @@ public final class OpenSourceLicenseViewModel: Sendable {

async let apacheLicenseContent = loadTextFileFromBundle(fileName: "ApacheLicense")
async let mitLicenseContent = loadTextFileFromBundle(fileName: "MITLicense")

let (
apacheLicense,
mitLicense
Expand All @@ -162,7 +163,7 @@ public final class OpenSourceLicenseViewModel: Sendable {
link: ""
)
)

dataSource.append(apacheLicense)
dataSource.append(mitLicense)
self.output.dataSource.accept(dataSource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ private extension SettingItemTableViewCell {
func configureSubTitle(type: SettingItemType) {
switch type {
case let .navigate(category):
let pushNotificationAuthorizationStatus = PreferenceManager.shared.pushNotificationAuthorizationStatus ?? false
let pushNotificationAuthorizationStatus = PreferenceManager.shared
.pushNotificationAuthorizationStatus ?? false
let playType = PreferenceManager.shared.songPlayPlatformType ?? .youtube
switch category {
case .appPush:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import UIKit
import Utility

final class MyPlaylistDetailViewController: BaseReactorViewController<MyPlaylistDetailReactor>,
@preconcurrency PlaylistEditSheetViewType,
@preconcurrency SongCartViewType {
@preconcurrency PlaylistEditSheetViewType,
@preconcurrency SongCartViewType {
private enum Limit {
static let imageSizeLimitPerMB: Double = 10.0
}
Expand Down Expand Up @@ -699,7 +699,7 @@ extension MyPlaylistDetailViewController: PlaylistEditSheetDelegate {
}

extension MyPlaylistDetailViewController: RequestPermissionable {
nonisolated public func showPhotoLibrary() {
public nonisolated func showPhotoLibrary() {
Task { @MainActor in
var configuration = PHPickerConfiguration()
configuration.filter = .any(of: [.images])
Expand Down Expand Up @@ -737,13 +737,13 @@ extension MyPlaylistDetailViewController: PHPickerViewControllerDelegate {
} else {
guard let image = image as? UIImage,
let resizeImage = image.customizeForPlaylistCover(
targetSize: CGSize(width: 500, height: 500)
targetSize: CGSize(width: 500, height: 500)
),
var imageData = resizeImage.jpegData(compressionQuality: 1.0)
else { return } // 80% 압축

let sizeMB: Double = Double(imageData.count).megabytes

if sizeMB > Limit.imageSizeLimitPerMB {
imageData = image.jpegData(compressionQuality: 0.8) ?? imageData
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit
import Utility

final class PlaylistDetailContainerViewController: BaseReactorViewController<PlaylistDetailContainerReactor>,
@preconcurrency ContainerViewType {
@preconcurrency ContainerViewType {
var contentView: UIView! = UIView().then {
$0.backgroundColor = DesignSystemAsset.BlueGrayColor.gray100.color
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit
import Utility

final class UnknownPlaylistDetailViewController: BaseReactorViewController<UnknownPlaylistDetailReactor>,
@preconcurrency SongCartViewType {
@preconcurrency SongCartViewType {
var songCartView: SongCartView!

var bottomSheetView: BottomSheetView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit
import Utility

final class WakmusicPlaylistDetailViewController: BaseReactorViewController<WakmusicPlaylistDetailReactor>,
@preconcurrency SongCartViewType {
@preconcurrency SongCartViewType {
var songCartView: SongCartView!

var bottomSheetView: BottomSheetView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import Tabman
import UIKit
import Utility

public final class AfterSearchViewController: TabmanViewController, ViewControllerFromStoryBoard, @preconcurrency StoryboardView {
public final class AfterSearchViewController: TabmanViewController, ViewControllerFromStoryBoard,
@preconcurrency StoryboardView {
@IBOutlet weak var tabBarView: UIView!
@IBOutlet weak var fakeView: UIView!
@IBOutlet weak var indicator: NVActivityIndicatorView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import Then
import UIKit
import Utility

final class SongSearchResultViewController: BaseReactorViewController<SongSearchResultReactor>, @preconcurrency SongCartViewType {
final class SongSearchResultViewController: BaseReactorViewController<SongSearchResultReactor>,
@preconcurrency SongCartViewType {
var songCartView: SongCartView!

var bottomSheetView: BottomSheetView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension UITapGestureRecognizer {

public nonisolated func request(_ demand: Subscribers.Demand) {}

nonisolated public func cancel() {
public nonisolated func cancel() {
if Thread.isMainThread {
MainActor.assumeIsolated {
subscriber = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class PreferenceManager: @unchecked Sendable {
public var songPlayPlatformType: YoutubePlayType?
}

// BehaviorSubject가 Sendable을 채택하지 않아 @unchecked
/// BehaviorSubject가 Sendable을 채택하지 않아 @unchecked
@propertyWrapper
public final class UserDefaultWrapper<T: Codable & Sendable>: @unchecked Sendable {
private let lock = NSLock()
Expand Down
2 changes: 1 addition & 1 deletion Projects/Modules/Utility/Sources/Realm/RealmManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RealmSwift
- 재생목록 저장을 위한 엔티티 (리팩토링 버전)
- 기존 PlayedList는 레거시로 판정하여 migration 과정에서 데이터 모두 제거
*/
// Realm이 Sendable을 채택하지 않아서 @unchecked 표시
/// Realm이 Sendable을 채택하지 않아서 @unchecked 표시
public class RealmManager: NSObject, @unchecked Sendable {
public static let shared = RealmManager()
private let realm: Realm
Expand Down

0 comments on commit 0e90c4d

Please sign in to comment.