Conversation
|
|
||
| // MARK: - JSON Data Loading | ||
| func loadBooks() { | ||
| dataService.loadBooks { [weak self] result in |
Comment on lines
+331
to
+333
| chapterStackView.addArrangedSubview(chapterLabel) | ||
| chapterStackView.subviews.forEach{ $0.removeFromSuperview() } | ||
| chapterStackView.addArrangedSubview(chapterLabel) |
ybin4548
reviewed
Jan 30, 2026
Comment on lines
+231
to
+233
| seriesButtonStackView.snp.makeConstraints { | ||
| $0.leading.greaterThanOrEqualToSuperview().inset(20) | ||
| $0.trailing.lessThanOrEqualToSuperview().inset(20) |
yy-ss99
reviewed
Jan 30, 2026
Comment on lines
+22
to
+26
| do { // (2번 안전장치) 파일 읽고 JSON 파싱 | ||
| let data = try Data(contentsOf: URL(fileURLWithPath: path)) // 파일 내용을 메모리로 읽어옴 | ||
| let bookResponse = try JSONDecoder().decode(BookResponse.self, from: data) // JSON을 Swift구조체(bookResponse)로 변환 | ||
| let books = bookResponse.data.map { $0.attributes } // bookResponse.data는 배열이고 우리가 쓰고싶은건 attributes임 | ||
| completion(.success(books)) // 성공 |
Collaborator
There was a problem hiding this comment.
제시된 코드 그대로 사용해서 구체적으로는 어떤 방식으로 진행되는지 몰랐는데 주희님 주석 덕분에 알고갑니다!
Updated README to reflect project details and MVVM architecture.
Removed section about Service (DataService.swift) from README.
Added additional explanations and code snippets for ViewController and data flow in README.
devBambu
reviewed
Feb 2, 2026
Comment on lines
+42
to
+46
| // 현재 보여줄 책 데이터 반환 | ||
| var currentBook: Book? { | ||
| guard books.indices.contains(index) else { return nil } // index가 books 안에 진짜 존재할 때만 실행 | ||
| return books[index] | ||
| } |
Collaborator
There was a problem hiding this comment.
연산 프로퍼티로 currentBook을 정의해서 사용할 수도 있군요.. 저는 이 부분 고민하다가 아키텍처 구조 자체를 바꿔버렸었는데 이런 방법이 있었네요!! 참고하고 갑니다😂
| let formatter = DateFormatter() | ||
| formatter.dateFormat = "yyyy-MM-dd" | ||
| if let date = formatter.date(from: dateString) { // 문자열을 date형식으로 변환 | ||
| formatter.dateStyle = .long // 출력용 날짜 스타일 |
Collaborator
There was a problem hiding this comment.
.long 스타일을 사용하면 '2 Februrary 2026' 형태로 출력되는 것 같습니다!
문제에서는 'Februrary 2, 2026' 형태로 출력하라고 요구하고 있어서 형식만 수정해주시면 좋을 것 같아요!
Removed unnecessary information about UIKit import and updated View section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
일단 굴러가기는 하게 작성한 코드입니다..
리뷰 남겨주시면 정말정말 감사하겠습니다..😊