Skip to content

Commit

Permalink
[Fix/#122] 데모앱 빌드를 위한 코드 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Nov 28, 2024
1 parent 5ef0fe9 commit f899a97
Show file tree
Hide file tree
Showing 15 changed files with 98 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,9 @@

import SwiftUI

import DSKit

public enum PointStatusEnum: String {
case unearned = "UNEARNED"
case earned = "EARNED"
case failure = "FAILURE"
case none = "NONE"

public var buttonColor: Color {
switch self {
case .unearned:
return DSKitAsset.bluePurpleButton.swiftUIColor
case .earned:
return DSKitAsset.bluePurpleOpacity22.swiftUIColor
case .failure:
return DSKitAsset.gray6.swiftUIColor
case .none:
return DSKitAsset.gray7.swiftUIColor
}
}

public var titleColor: Color {
switch self {
case .unearned:
return DSKitAsset.whiteBtn.swiftUIColor
case .earned:
return DSKitAsset.bluePurpleOpacity70.swiftUIColor
case .failure:
return DSKitAsset.gray2.swiftUIColor
case .none:
return DSKitAsset.gray3.swiftUIColor
}
}
case unearned = "UNEARNED"
case earned = "EARNED"
case failure = "FAILURE"
case none = "NONE"
}
14 changes: 7 additions & 7 deletions HMH_Tuist_iOS/Projects/Domain/Sources/UseCase/My/MyUseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ public protocol MyPageUseCaseType {
func revokeUser() -> AnyPublisher<Void, Never>
}

final class MyPageUseCase: MyPageUseCaseType {
final public class MyPageUseCase: MyPageUseCaseType {

private let userRepository: UserRepositoryType
private var cancelBag = CancelBag()

init(userRepository: UserRepositoryType) {
public init(userRepository: UserRepositoryType) {
self.userRepository = userRepository
}

var logoutFailed = PassthroughSubject<String, Never>()
var revokeUserFailed = PassthroughSubject<String, Never>()
public var logoutFailed = PassthroughSubject<String, Never>()
public var revokeUserFailed = PassthroughSubject<String, Never>()

func getUserData() -> AnyPublisher<User, UserError> {
public func getUserData() -> AnyPublisher<User, UserError> {
userRepository.getUserData()
.map { $0 }
.eraseToAnyPublisher()
}

func logout() -> AnyPublisher<Void, Never> {
public func logout() -> AnyPublisher<Void, Never> {
userRepository.logout()
.catch { [weak self] error in
self?.logoutFailed.send("로그아웃에 실패했습니다.")
Expand All @@ -46,7 +46,7 @@ final class MyPageUseCase: MyPageUseCaseType {
.eraseToAnyPublisher()
}

func revokeUser() -> AnyPublisher<Void, Never> {
public func revokeUser() -> AnyPublisher<Void, Never> {
userRepository.deleteAccount()
.catch { [weak self] error in
self?.revokeUserFailed.send("회원탈퇴에 실패했습니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ let project = Project.makeModule(
.domain,
.Modules.dsKit,
.HMHModules.deviceActivityMonitor,
.HMHModules.hmhDeviceActivityReport,
.HMHModules.shieldActionExtension,
.HMHModules.shieldConfigureExtension
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ let project = Project.makeModule(
name: "ChallengeFeature",
targets: [.staticFramework, .demo],
internalDependencies: [
.Features.BaseFeatureDependency
.Features.BaseFeatureDependency,
.HMHModules.hmhDeviceActivityReport
]
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// PointStatusAsset.swift
// ChallengeFeature
//
// Created by 류희재 on 11/28/24.
// Copyright © 2024 HMH-iOS. All rights reserved.
//

import SwiftUI
import DSKit
import Domain

extension PointStatusEnum {
public var buttonColor: Color {
switch self {
case .unearned:
return DSKitAsset.bluePurpleButton.swiftUIColor
case .earned:
return DSKitAsset.bluePurpleOpacity22.swiftUIColor
case .failure:
return DSKitAsset.gray6.swiftUIColor
case .none:
return DSKitAsset.gray7.swiftUIColor
}
}

public var titleColor: Color {
switch self {
case .unearned:
return DSKitAsset.whiteBtn.swiftUIColor
case .earned:
return DSKitAsset.bluePurpleOpacity70.swiftUIColor
case .failure:
return DSKitAsset.gray2.swiftUIColor
case .none:
return DSKitAsset.gray3.swiftUIColor
}
}
}
Original file line number Diff line number Diff line change
@@ -1,93 +1,9 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"filename" : "app_icon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// MyPageDemoApp.swift
// MyPageFeature
//
// Created by 류희재 on 11/28/24.
// Copyright © 2024 HMH-iOS. All rights reserved.
//

import SwiftUI

import Domain
import Data
import Networks
import MyPageFeature

@main
struct MyPageDemoApp: App {
var body: some Scene {
WindowGroup {
MyPageView(
viewModel: MyPageViewModel(
useCase: MyPageUseCase(
userRepository: UserRepository(
service: UserService()
)
)
)
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import DSKit
import Domain
import Foundation

class MyPageViewModel: ObservableObject {
public class MyPageViewModel: ObservableObject {

private var useCase: MyPageUseCaseType
private var cancelBag = CancelBag()

init(useCase: MyPageUseCaseType) {
public init(useCase: MyPageUseCaseType) {
self.useCase = useCase

bindState()
Expand Down Expand Up @@ -53,7 +53,7 @@ class MyPageViewModel: ObservableObject {
useCase.getUserData()
.catch { _ in Empty() }
.receive(on: RunLoop.main)
.assign(to: \.state.userData, on: self)
.assign(to: \.state.user, on: self)
.store(in: cancelBag)

case .logoutButtonDidTap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public struct MyPageView: View {
@State private var isPresented: Bool = false
@StateObject var viewModel: MyPageViewModel

public init(viewModel: MyPageViewModel) {
self._viewModel = StateObject(wrappedValue: viewModel)
}


public var body: some View {
VStack {
Spacer()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "회원가입 완료.svg",
"filename" : "회원가입 완료.svg",
"idiom" : "universal",
"scale" : "1x"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"images" : [
{
"filename" : "앱아이콘.png",
"filename" : "앱아이콘.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "앱아이콘 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "앱아이콘 2.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f899a97

Please sign in to comment.