Skip to content
Open
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
5 changes: 0 additions & 5 deletions B.READ/B.READ.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
Sources/Data/DTOs/Record/QuoteDTO.swift,
Sources/Data/DTOs/Record/RecordDTO.swift,
Sources/Data/DTOs/Record/SummaryDTO.swift,
Sources/Data/DTOs/Record/TagDTO.swift,
Sources/Data/DTOs/UserInfo/CategoryDTO.swift,
Sources/Data/DTOs/UserInfo/DailyStatusDTO.swift,
Sources/Data/DTOs/UserInfo/KeywordDTO.swift,
Expand Down Expand Up @@ -98,7 +97,6 @@
Sources/Data/DTOs/Record/QuoteDTO.swift,
Sources/Data/DTOs/Record/RecordDTO.swift,
Sources/Data/DTOs/Record/SummaryDTO.swift,
Sources/Data/DTOs/Record/TagDTO.swift,
Sources/Data/DTOs/UserInfo/CategoryDTO.swift,
Sources/Data/DTOs/UserInfo/DailyStatusDTO.swift,
Sources/Data/DTOs/UserInfo/KeywordDTO.swift,
Expand Down Expand Up @@ -152,7 +150,6 @@
Sources/Network/NetworkClient/NetworkClient.swift,
Sources/Network/NetworkClient/RequestConvertible.swift,
"Sources/Util/Extensions/Bundle+.swift",
"Sources/Util/Extensions/Date+.swift",
);
target = 16BE931F2DED713E006FFD00 /* ServiceTest */;
};
Expand All @@ -167,7 +164,6 @@
Sources/Data/DTOs/Record/QuoteDTO.swift,
Sources/Data/DTOs/Record/RecordDTO.swift,
Sources/Data/DTOs/Record/SummaryDTO.swift,
Sources/Data/DTOs/Record/TagDTO.swift,
Sources/Data/DTOs/UserInfo/CategoryDTO.swift,
Sources/Data/DTOs/UserInfo/DailyStatusDTO.swift,
Sources/Data/DTOs/UserInfo/KeywordDTO.swift,
Expand Down Expand Up @@ -221,7 +217,6 @@
Sources/Network/NetworkClient/NetworkClient.swift,
Sources/Network/NetworkClient/RequestConvertible.swift,
"Sources/Util/Extensions/Bundle+.swift",
"Sources/Util/Extensions/Date+.swift",
);
target = 16BE95272DED72FB006FFD00 /* UsecaseTest */;
};
Expand Down
10 changes: 10 additions & 0 deletions B.READ/B.READ/B.READ.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.BREAD</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scale" : "1x"
},
{
"filename" : "ExampleCover.png",
"filename" : "ExampleBookImage.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"images" : [
{
"filename" : "Bread3D1x.png",
"filename" : "ChatGPT Image 2025년 6월 7일 오후 02_20_53 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Bread3D2x.png",
"filename" : "ChatGPT Image 2025년 6월 7일 오후 02_20_53 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Bread3D3x.png",
"filename" : "ChatGPT Image 2025년 6월 7일 오후 02_20_53 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down

This file was deleted.

Binary file not shown.
12 changes: 6 additions & 6 deletions B.READ/B.READ/Sources/App/Coordinator/Coordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ final class Coordinator<T: Hashable, R: Identifiable>: ObservableObject {
// MARK: - Navigation Push/Pop
func push(_ path: T) {
guard paths.last != path else { return }
print("Before push:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("Before push: \(paths)")
paths.append(path)
print("After push:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("After push: \(paths)")
}

func pop() {
guard !paths.isEmpty else { return }
print("Before pop:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("Before pop: \(paths)")
paths.removeLast()
print("After pop:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("After pop: \(paths)")
}

func popToRoot() {
print("Before popToRoot:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("Before popToRoot: \(paths)")
paths.removeAll()
print("After popToRoot:\n\(paths.map { "\($0)\n" }.joined(separator: "\n"))\n")
print("After popToRoot: \(paths)")
}

func pop(to: T) {
Expand Down
57 changes: 15 additions & 42 deletions B.READ/B.READ/Sources/App/Coordinator/MainCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ enum MainRoute: Hashable {

// MARK: - Library
case libraryDetail(id: String)
case createSummary(record: RecordDetailVO, memos: [MemoVO], quotes: [QuoteVO])
case summaryDetail(id: String, record: RecordDetailVO, memos: [MemoVO], quotes: [QuoteVO])

// MARK: - Sentence
case sentenceInput(mode: SentenceInputMode)
case pageInput(record: RecordDetailVO, quote: QuoteVO)
case pageInput(mode: SentenceInputMode, sentence: String)

// MARK: - Memo
// case memo(id: String? = nil, record: Record, totalPage: Int)
// case memo(id: String? = nil, record: Record, totalPage: Int)
case memo(id: String? = nil, record: RecordDetailVO)

// MARK: - MyPage
Expand All @@ -35,8 +33,7 @@ enum MainRoute: Hashable {
enum SheetRoute: Identifiable {
case createRecord(
state: Binding<ReadingState>,
book: Book,
onComplete: (_ isEdit: Bool) -> Void
book: Book
)

case updateRecord(
Expand All @@ -53,20 +50,17 @@ enum SheetRoute: Identifiable {
extension Coordinator where R == SheetRoute {
@ViewBuilder
func buildView(for route: R) -> some View {
let factory = ViewModelFactory.shared

switch route {
case let .createRecord(state, book, onComplete):
case let .createRecord(state, book):
CreateRecordView(
state: state,
viewModel: factory.createNewRecord(book: book),
onComplete: onComplete
viewModel: NewRecordViewModel(book: book)
)

case let .updateRecord(state, record, onComplete):
CreateRecordView(
state: state,
viewModel: factory.createUpdateRecord(record: record),
viewModel: NewRecordViewModel(recordVO: record),
onComplete: onComplete
)
}
Expand All @@ -77,15 +71,13 @@ extension Coordinator where T == MainRoute {

@ViewBuilder
func buildView(for route: T) -> some View {
let factory = ViewModelFactory.shared

switch route {

// MARK: - Search Flow
case .barcode:
ScanView(viewModel: factory.createScan())
ScanView(viewModel: ScanViewModel())
case .searchBook(let isbn):
BookDetailView(viewModel: factory.createBook(isbn: isbn))
BookDetailView(viewModel: BookViewModel(isbn: isbn))
case .goToWebView(let url):
WebView(url: url)
.navigationBarBackButtonHidden()
Expand All @@ -102,37 +94,18 @@ extension Coordinator where T == MainRoute {

// MARK: - Library
case .libraryDetail(let id):
RecordDetailView(viewModel: factory.createRecordDetail(id: id))
case let .createSummary(record, memos, quotes):
AlanSummaryView(
viewModel: factory.createSummary(
record: record,
memos: memos,
quotes: quotes
)
)
case let .summaryDetail(id, record, memos, quotes):
AlanSummaryView(
viewModel: factory.createSummaryDetail(
id: id,
record: record,
memos: memos,
quotes: quotes
)
)
RecordDetailView(viewModel: .init(recordID: id))

// MARK: - Sentence
case .sentenceInput(let mode):
SentenceInputView(viewModel: factory.createSentenceInput(mode: mode))
case .pageInput(let record, let quote):
PageInputView(viewModel: factory.createPageInput(record: record, quote: quote))

SentenceInputView(mode: mode)

case .pageInput(let mode, let sentence):
PageInputView(mode: mode, sentence: sentence)

// MARK: - Memo
case .memo(let id, let record):
MemoView(
viewModel: factory.createMemo(id: id, record: record),
totalPage: record.totalPage
)
MemoView(viewModel: MemoViewModel(id: id, record: record), totalPage: record.totalPage)

// MARK: - MyPage Flow
case .insertNickname:
Expand Down
20 changes: 2 additions & 18 deletions B.READ/B.READ/Sources/App/DIContainer/DIContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,27 @@ extension DIContainer {
let recordRepository = RecordRepositoryImpl(modelContainer: storage.modelContainer)
let memoRepository = MemoRepositoryImpl(modelContainer: storage.modelContainer)
let quoteRepository = QuoteRepositoryImpl(modelContainer: storage.modelContainer)
let summaryRepository = SummaryRepositoryImpl(modelContainer: storage.modelContainer)

// MARK: - UseCase 생성 및 등록
// Profile UseCase
self.shared.register(
ProfileUseCaseImpl(userInfoRepository: userInfoRepository),
for: ProfileUseCase.self
)

// Library UseCase
self.shared.register(
LibraryUseCaseImpl(
userInfoRepository: userInfoRepository,
bookRepository: bookRepository,
recordRepository: recordRepository,
quoteRepository: quoteRepository,
bookService: AladinService()
),
for: LibraryUseCase.self
)

// Memo UseCase
self.shared.register(
MemoUseCaseImpl(
userInfoRepository: userInfoRepository,
bookRepository: bookRepository,
memoRepository: memoRepository,
aiService: AlanService()
Expand All @@ -84,23 +80,11 @@ extension DIContainer {
// Quote UseCase
self.shared.register(
QuoteUseCaseImpl(
userInfoRepository: userInfoRepository,
quoteRepository: quoteRepository,
bookRepository: bookRepository),
for: QuoteUseCase.self
)

// Summary UseCase
self.shared.register(
SummaryUseCaseImpl(
userInfoRepository: userInfoRepository,
summaryRepository: summaryRepository,
bookRepository: bookRepository,
recordRepository: recordRepository,
aiService: AlanService()
),
for: SummaryUseCase.self
)
// TODO: - Note UseCase

// Search UseCase
self.shared.register(
Expand Down
58 changes: 0 additions & 58 deletions B.READ/B.READ/Sources/App/DIContainer/ViewModelFactory.swift

This file was deleted.

3 changes: 1 addition & 2 deletions B.READ/B.READ/Sources/App/RootViewSwitcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ struct RootViewSwitcher: View {
Group {
switch rootScene {
case .launch:
LaunchScreen()
Color.white.ignoresSafeArea()
.task {
await DIContainer.config()
// TODO: - [더미]초기값 적용이라 마지막에 제거하기
// await DummyService.shared.setDummy()
try? await Task.sleep(for: .seconds(2))
await MainActor.run { self.isReady = true }
}
case .onboarding:
Expand Down
Loading