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
1 change: 1 addition & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
--exclude /Tuist

# rules
--disable trailingCommas
--enable blockComments
--enable markTypes
--enable noExplicitOwnership
Expand Down
4 changes: 0 additions & 4 deletions Projects/App/Sources/MockFetchChannelListUsecaseImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ final class MockChannelListFetcher {
"가나다라마바사아자차카타파하".randomElement()!
})

let randomBool = Bool.random()
let image: Image = randomBool ? .ratio16x9 : .ratio4x3
let fetchedImage = await image.fetch()

channels.append(ChannelEntity(id: UUID().uuidString, name: name))
}

Expand Down
2 changes: 1 addition & 1 deletion Projects/App/Sources/Splash/SplashGradientView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SplashGradientView: UIView {
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)],

[CGColor(red: 0 / 255, green: 0 / 255, blue: 0 / 255, alpha: 1),
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)],
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)]
]

override init(frame: CGRect) {
Expand Down
8 changes: 4 additions & 4 deletions Projects/Domains/BaseDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ let project = Project.module(
.interface(module: .domain(.BaseDomain)),
.implements(module: .domain(.BaseDomain), dependencies: [
.domain(target: .BaseDomain, type: .interface),
.module(target: .FastNetwork),
.module(target: .FastNetwork)
]),
.testing(module: .domain(.BaseDomain), dependencies: [
.domain(target: .BaseDomain, type: .interface),
.domain(target: .BaseDomain, type: .interface)
]),
.tests(module: .domain(.BaseDomain), dependencies: [
.domain(target: .BaseDomain),
.domain(target: .BaseDomain, type: .testing),
]),
.domain(target: .BaseDomain, type: .testing)
])
]
)
8 changes: 4 additions & 4 deletions Projects/Domains/BroadcastDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ let project = Project.module(
.interface(module: .domain(.BroadcastDomain)),
.implements(module: .domain(.BroadcastDomain), dependencies: [
.domain(target: .BroadcastDomain, type: .interface),
.domain(target: .BaseDomain),
.domain(target: .BaseDomain)
]),
.testing(module: .domain(.BroadcastDomain), dependencies: [
.domain(target: .BroadcastDomain, type: .interface),
.domain(target: .BroadcastDomain, type: .interface)
]),
.tests(module: .domain(.BroadcastDomain), dependencies: [
.domain(target: .BroadcastDomain),
.domain(target: .BroadcastDomain, type: .testing),
]),
.domain(target: .BroadcastDomain, type: .testing)
])
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extension BroadcastEndpoint: Endpoint {

public var header: [String: String]? {
[
"Content-Type": "application/json",
"Content-Type": "application/json"
]
}

Expand Down
6 changes: 3 additions & 3 deletions Projects/Domains/LiveStationDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ let project = Project.module(
.interface(module: .domain(.LiveStationDomain)),
.implements(module: .domain(.LiveStationDomain), dependencies: [
.domain(target: .LiveStationDomain, type: .interface),
.domain(target: .BaseDomain),
.domain(target: .BaseDomain)
]),
.testing(module: .domain(.LiveStationDomain), dependencies: [
.domain(target: .LiveStationDomain, type: .interface),
]),
.domain(target: .LiveStationDomain, type: .interface)
])
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension LiveStationEndpoint: Endpoint {
"x-ncp-apigw-timestamp": timestamp,
"x-ncp-iam-access-key": config(key: .accessKey),
"x-ncp-apigw-signature-v2": makeSignature(with: timestamp),
"x-ncp-region_code": "KR",
"x-ncp-region_code": "KR"
]
}

Expand Down Expand Up @@ -75,16 +75,16 @@ extension LiveStationEndpoint: Endpoint {
"cdnDomain": config(key: .cdnDomain),
"profileId": config(key: .profileID),
"cdnInstanceNo": config(key: .cdnInstanceNo),
"regionType": "KOREA",
"regionType": "KOREA"
],
"qualitySetId": 4430,
"useDvr": true,
"immediateOnAir": true,
"record": [
"type": "MANUAL_UPLOAD",
"type": "MANUAL_UPLOAD"
],
"drmEnabledYn": false,
"timemachineMin": 360,
"timemachineMin": 360
]
)

Expand Down
8 changes: 4 additions & 4 deletions Projects/Features/AuthFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ let project = Project.module(
.interface(module: .feature(.AuthFeature)),
.implements(module: .feature(.AuthFeature), dependencies: [
.feature(target: .AuthFeature, type: .interface),
.feature(target: .BaseFeature),
.feature(target: .BaseFeature)
]),
.tests(module: .feature(.AuthFeature), dependencies: [
.feature(target: .AuthFeature),
.feature(target: .AuthFeature)
]),
.demo(module: .feature(.AuthFeature), dependencies: [
.feature(target: .AuthFeature),
]),
.feature(target: .AuthFeature)
])
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SignUpGradientView: UIView {
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)],

[CGColor(red: 0 / 255, green: 0 / 255, blue: 0 / 255, alpha: 1),
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)],
CGColor(red: 31 / 255, green: 52 / 255, blue: 55 / 255, alpha: 1)]
]

override init(frame: CGRect) {
Expand Down
10 changes: 5 additions & 5 deletions Projects/Features/BaseFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ let project = Project.module(
.implements(module: .feature(.BaseFeature), dependencies: [
.feature(target: .BaseFeature, type: .interface),
.userInterface(target: .DesignSystem),
.module(target: .ThirdPartyLibModule),
.module(target: .ThirdPartyLibModule)
]),
.testing(module: .feature(.BaseFeature), dependencies: [
.feature(target: .BaseFeature, type: .interface),
.feature(target: .BaseFeature, type: .interface)
]),
.tests(module: .feature(.BaseFeature), dependencies: [
.feature(target: .BaseFeature),
.feature(target: .BaseFeature, type: .testing),
.feature(target: .BaseFeature, type: .testing)
]),
.demo(module: .feature(.BaseFeature), dependencies: [
.feature(target: .BaseFeature),
.feature(target: .BaseFeature, type: .testing),
]),
.feature(target: .BaseFeature, type: .testing)
])
]
)
10 changes: 5 additions & 5 deletions Projects/Features/LiveStreamFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ let project = Project.module(
name: ModulePaths.Feature.LiveStreamFeature.rawValue,
targets: [
.interface(module: .feature(.LiveStreamFeature), dependencies: [
.feature(target: .BaseFeature, type: .interface),
.feature(target: .BaseFeature, type: .interface)
]),
.implements(module: .feature(.LiveStreamFeature), dependencies: [
.feature(target: .LiveStreamFeature, type: .interface),
.feature(target: .BaseFeature),
.domain(target: .LiveStationDomain, type: .interface),
.domain(target: .BroadcastDomain, type: .interface),
.module(target: .ChatSoketModule),
.module(target: .ChatSoketModule)
]),
.tests(module: .feature(.LiveStreamFeature), dependencies: [
.feature(target: .LiveStreamFeature),
.feature(target: .LiveStreamFeature)
]),
.demo(module: .feature(.LiveStreamFeature), dependencies: [
.feature(target: .LiveStreamFeature),
.domain(target: .LiveStationDomain, type: .interface),
]),
.domain(target: .LiveStationDomain, type: .interface)
])
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ final class ChattingListView: BaseView {
recentChatButton.translatesAutoresizingMaskIntoConstraints = false
recentChatButtonShowConstraints = [
recentChatButton.centerXAnchor.constraint(equalTo: centerXAnchor),
recentChatButton.bottomAnchor.constraint(equalTo: chatInputField.topAnchor, constant: -8),
recentChatButton.bottomAnchor.constraint(equalTo: chatInputField.topAnchor, constant: -8)
]
recentChatButtonHideConstraints = [
recentChatButton.centerXAnchor.constraint(equalTo: centerXAnchor),
recentChatButton.bottomAnchor.constraint(equalTo: chatInputField.bottomAnchor, constant: 0),
recentChatButton.bottomAnchor.constraint(equalTo: chatInputField.bottomAnchor, constant: 0)
]
NSLayoutConstraint.activate(recentChatButtonHideConstraints)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public final class LiveStreamViewController: BaseViewController<LiveStreamViewMo

expandConstraints = [
playerView.topAnchor.constraint(equalTo: view.topAnchor),
playerView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
playerView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
]

unfoldedConstraint = infoView.topAnchor.constraint(equalTo: playerView.bottomAnchor)
Expand Down Expand Up @@ -209,6 +209,7 @@ public final class LiveStreamViewController: BaseViewController<LiveStreamViewMo
.store(in: &subscription)

output.showAlert
.receive(on: DispatchQueue.main)
.sink { [weak self] _ in
guard let self else { return }
showDissmissAlert()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final class LiveStreamViewModel: ViewModel {
let output = Output()

input.expandButtonDidTap
.compactMap { $0 }
.compactMap(\.self)
.sink {
let nextValue = !output.isExpanded.value
output.isExpanded.send(nextValue)
Expand All @@ -66,7 +66,7 @@ public final class LiveStreamViewModel: ViewModel {
.store(in: &subscription)

input.sliderValueDidChange
.compactMap { $0 }
.compactMap(\.self)
.map { Double($0) }
.sink {
input.autoDissmissDidRegister.send()
Expand All @@ -75,14 +75,14 @@ public final class LiveStreamViewModel: ViewModel {
.store(in: &subscription)

input.playerStateDidChange
.compactMap { $0 }
.compactMap(\.self)
.sink { flag in
output.isPlaying.send(flag)
}
.store(in: &subscription)

input.playerGestureDidTap
.compactMap { $0 }
.compactMap(\.self)
.sink { _ in
let nextValue1 = !output.isShowedPlayerControl.value
output.isShowedPlayerControl.send(nextValue1)
Expand All @@ -100,7 +100,7 @@ public final class LiveStreamViewModel: ViewModel {
.store(in: &subscription)

input.playButtonDidTap
.compactMap { $0 }
.compactMap(\.self)
.sink { _ in
input.autoDissmissDidRegister.send()
output.isPlaying.send(!output.isPlaying.value)
Expand Down
8 changes: 4 additions & 4 deletions Projects/Features/MainFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ let project = Project.module(
.feature(target: .BaseFeature),
.feature(target: .LiveStreamFeature, type: .interface),
.domain(target: .LiveStationDomain, type: .interface),
.domain(target: .BroadcastDomain, type: .interface),
.domain(target: .BroadcastDomain, type: .interface)
]),
.tests(module: .feature(.MainFeature), dependencies: [
.feature(target: .MainFeature),
.feature(target: .MainFeature)
]),
.demo(module: .feature(.MainFeature), dependencies: [
.feature(target: .MainFeature),
]),
.feature(target: .MainFeature)
])
]
)
10 changes: 5 additions & 5 deletions Projects/Modules/ChatSoketModule/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ let project = Project.module(
targets: [
.interface(module: .module(.ChatSoketModule)),
.implements(module: .module(.ChatSoketModule), dependencies: [
.module(target: .ChatSoketModule, type: .interface),
.module(target: .ChatSoketModule, type: .interface)
]),
.testing(module: .module(.ChatSoketModule), dependencies: [
.module(target: .ChatSoketModule, type: .interface),
.module(target: .ChatSoketModule, type: .interface)
]),
.tests(module: .module(.ChatSoketModule), dependencies: [
.module(target: .ChatSoketModule),
.module(target: .ChatSoketModule, type: .testing),
.module(target: .ChatSoketModule, type: .testing)
]),
.demo(module: .module(.ChatSoketModule), dependencies: [
.module(target: .ChatSoketModule),
.module(target: .ChatSoketModule, type: .testing),
]),
.module(target: .ChatSoketModule, type: .testing)
])
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class SoketTestViewController: UIViewController {
tableView.topAnchor.constraint(equalTo: button.bottomAnchor),
tableView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
tableView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])

button.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Expand Down
4 changes: 2 additions & 2 deletions Projects/Modules/ChatSoketModule/Sources/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public final class WebSocket: NSObject {
}

public func send(data: ChatMessage) {
guard let data = try? encoder.encode(data) else { return }
guard let encodedData = try? encoder.encode(data) else { return }

let taskMessage = URLSessionWebSocketTask.Message.data(data)
let taskMessage = URLSessionWebSocketTask.Message.data(encodedData)

webSocketTask?.send(taskMessage) { error in
guard error != nil else { return }
Expand Down
4 changes: 2 additions & 2 deletions Projects/Modules/EasyLayout/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let project = Project.module(
targets: [
.implements(module: .module(.EasyLayout)),
.demo(module: .module(.EasyLayout), dependencies: [
.module(target: .EasyLayout),
]),
.module(target: .EasyLayout)
])
]
)
10 changes: 5 additions & 5 deletions Projects/Modules/FastNetwork/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ let project = Project.module(
targets: [
.interface(module: .module(.FastNetwork)),
.implements(module: .module(.FastNetwork), dependencies: [
.module(target: .FastNetwork, type: .interface),
.module(target: .FastNetwork, type: .interface)
]),
.testing(module: .module(.FastNetwork), dependencies: [
.module(target: .FastNetwork, type: .interface),
.module(target: .FastNetwork, type: .interface)
]),
.tests(module: .module(.FastNetwork), dependencies: [
.module(target: .FastNetwork),
.module(target: .FastNetwork, type: .testing),
.module(target: .FastNetwork, type: .testing)
]),
.demo(module: .module(.FastNetwork), dependencies: [
.module(target: .FastNetwork),
.module(target: .FastNetwork, type: .testing),
]),
.module(target: .FastNetwork, type: .testing)
])
]
)
18 changes: 9 additions & 9 deletions Projects/Modules/FastNetwork/Sources/Error/HTTPError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import Foundation
public enum HTTPError: String, LocalizedError {
// MARK: 400..<500 , Client Error

case badRequest /// 400
case unauthorized /// 401
case paymentRequired /// 402
case forbidden /// 403
case notFound /// 404
case methodNotAllowed /// 405
case conflict /// 409
case badRequest // 400
case unauthorized // 401
case paymentRequired // 402
case forbidden // 403
case notFound // 404
case methodNotAllowed // 405
case conflict // 409

// MARK: 500..<600 Server Error

case internalServerError /// 500
case badGateway /// 502
case internalServerError // 500
case badGateway // 502

// MARK: Extra

Expand Down
Loading
Loading