-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftUI로 리팩토링 해보기 #19
Conversation
…p into refactor/swiftUI_View
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서부터 봐주시면 됩니다 ! 5692da2
고생하셨습니다. |
@@ -8,11 +8,79 @@ | |||
import SwiftUI | |||
|
|||
struct ExerciseList: View { | |||
@StateObject var viewModel: ExerciseViewModel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기서 stateobject를 쓰신 이유가 있을까요?
@ stateobject, @ observedObject, @ state @ bind의 차이점이 뭘까요?
final class MockViewModel: ExerciseViewModel { | ||
init() { | ||
super.init( | ||
useCase: Training( | ||
repository: TrainingRepository( | ||
trainingDataSource: TrainingDataSource()) | ||
) | ||
) | ||
|
||
self.program = [ | ||
TrainingLevel( | ||
id: UUID().uuidString, | ||
name: "Starter", | ||
description: "여긴 해당 설명이 들어갑니다.", | ||
routine: [ | ||
DailyRoutine(day: "Day 01", routine: [3,2,1,1]), | ||
DailyRoutine(day: "Day 01", routine: [3,2,1,1]), | ||
DailyRoutine(day: "Day 01", routine: [3,2,1,1]), | ||
DailyRoutine(day: "Day 01", routine: [3,2,1,1]), | ||
DailyRoutine(day: "Day 01", routine: [3,2,1,1]) | ||
] | ||
), | ||
TrainingLevel( | ||
id: UUID().uuidString, | ||
name: "Starter", | ||
description: "여긴 해당 설명이 들어갑니다.", | ||
routine: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mock이 view에 있는게 좋을까요? viewModel에 있는게 좋을까요?
Quality Gate passedIssues Measures |
MainView를 ExerciseList로 리팩토링해서 호출까지 했습니다 ~!