This project is solely a demonstration of a multiplatform iOS
/macOS
application built with SwiftUI
and TCA
. Both apps are distinct, but they do share a majority of their code-base. Using TCA
to hyper-modularize this project has allowed the two targets to share the most feasible amount of depenedencies, which has been a huge advantage.
- BibleClient
- BibleClient/Client.swift
- BibleClient/Live.swift
- BibleClient/Test.swift
- BibleCore/
- BibleCore/Book.swift
- BibleCore/Chapter.swift
- BibleCore/Genre.swift
- BibleCore/Translation.swift
- BibleCore/Verse.swift
- DirectoryCore/
- DirectoryCore/MenuDirectory
- DirectoryCore/MenuDirectory/MenuDirectory.swift
- DirectoryCore/MenuDirectory/MenuDirectoryView.swift
- DirectoryCore/MenuDirectory/Section/
- DirectoryCore/MenuDirectory/Section/Section.swift
- DirectoryCore/MenuDirectory/Section/SectionView.swift
- DirectoryCore/ToolbarDirectory/ToolDirectory.swift
- DirectoryCore/ToolbarDirectory/ToolDirectoryView.swift
- ReaderCore/DesktopReader/DesktopReader.swift
- ReaderCore/DesktopReader/DesktopReaderView.swift
- ReaderCore/Page/Page.swift
- ReaderCore/Page/PageView.swift
- ReaderCore/Reader.swift
Exhaustive testing with TCA
// BibleCore/Tests/ReaderCoreTests/ReaderTests.swift#testNextChapter:82-84
await store.send(.menuDirectory(.book(id: Book.genesis.id, action: .select(.genesis, .mock, .mock, nil)))) {
$0.isDirectoryOpen = false
}
Optional SwiftUI.View#tag
// BibleCore/Source/DirectoryCore/ToolbarDirectory/ToolbarDirectoy.swift:23
// viewStore.$book: Optional<Book>
Picker(selection: viewStore.$book) {
ForEach(books) { book in
Text(book.name)
// This is beyond the silliest part of SwiftUI.
// BindingState<Optional<Book>> requires tag to SwiftUI.View#tag to be Optional<Book>
// otherwise, Optional<Book> equate to Book will always fail.
.tag(Book?.some(book))
}
}
...