Skip to content

Commit

Permalink
Merge pull request #143 from DeveloperAcademy-POSTECH/develop
Browse files Browse the repository at this point in the history
Update Version 1.3.3
  • Loading branch information
zaehorang authored Dec 18, 2024
2 parents 5a7e803 + d0854d7 commit 8c60a5b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions FiveGuyes/FiveGuyes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.FiveNorms.FiveNorms;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -834,7 +834,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.3.2;
MARKETING_VERSION = 1.3.3;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = com.FiveNorms.FiveNorms;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import SwiftUI
final class BookSettingInputModel {
var currentPage = BookSettingsPage.bookSearch.rawValue
var selectedBook: Book?
var startPage = ""
var targetEndPage = ""
var startPage = 1
var targetEndPage = 1
var startData: Date?
var endData: Date?
var nonReadingDays: [Date] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ struct BookPageSettingView: View {
@Environment(NavigationCoordinator.self) var navigationCoordinator: NavigationCoordinator
@Environment(BookSettingInputModel.self) var bookSettingInputModel: BookSettingInputModel

@State private var startPage: String = "1"
@State private var targetEndPage: String = ""
@State private var startPage = 1
@State private var targetEndPage = 0

@FocusState private var focusedField: FieldFocus?

Expand Down Expand Up @@ -94,11 +94,11 @@ struct BookPageSettingView: View {

// ν…μŠ€νŠΈ ν•„λ“œ 생성 λ©”μ„œλ“œ
private func pageNumberTextField(
page: Binding<String>,
page: Binding<Int>,
isFocused: FocusState<FieldFocus?>.Binding,
field: FieldFocus
) -> some View {
TextField("", text: page)
TextField("", value: page, format: .number)
.keyboardType(.numberPad)
.focused(isFocused, equals: field)
.fontStyle(.title2, weight: .semibold)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ struct BookSearchView: View {
guard let selectedBook = bookSearchViewModel.selectedBook else { return }

Task {
bookSettingInputModel.targetEndPage = await bookSearchViewModel.fetchBookTotalPages(isbn: selectedBook.isbn13)
let totalPages = await bookSearchViewModel.fetchBookTotalPages(isbn: selectedBook.isbn13)

bookSettingInputModel.targetEndPage = Int(totalPages) ?? 0

bookSettingInputModel.selectedBook = selectedBook
bookSettingInputModel.nextPage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ struct BookSettingsManagerView: View {
bookSettingInputModel.endData = nil
bookSettingInputModel.startData = nil
case .bookPageSetting:
bookSettingInputModel.startPage = ""
bookSettingInputModel.targetEndPage = ""
bookSettingInputModel.startPage = 1
bookSettingInputModel.targetEndPage = 1
case .bookSearch:
return
case .bookSettingDone:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct CompletionCalendarView: View {
}
}
.onAppear {
let (tartgetEndPage, startPage) = (Int(bookSettingInputModel.targetEndPage)!, Int(bookSettingInputModel.startPage)!)
let (tartgetEndPage, startPage) = (bookSettingInputModel.targetEndPage, bookSettingInputModel.startPage)

totalPages = tartgetEndPage - startPage + 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ struct FinishGoalView: View {
var body: some View {

if let book = bookSettingInputModel.selectedBook,
let startPage = Int(bookSettingInputModel.startPage),
let totalPages = Int(bookSettingInputModel.targetEndPage),
let startDate = bookSettingInputModel.startData,
let endDate = bookSettingInputModel.endData {

let startPage = bookSettingInputModel.startPage
let totalPages = bookSettingInputModel.targetEndPage

ZStack {
Color.Fills.lightGreen
.ignoresSafeArea()
Expand Down

0 comments on commit 8c60a5b

Please sign in to comment.