Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

[refactor] Fix force decoding API response, Separate API response model and Model for View #43

Open
ChoiysApple opened this issue Oct 6, 2023 · 0 comments
Assignees
Labels
♻️ Refactor Refactoring required

Comments

@ChoiysApple
Copy link
Owner

ChoiysApple commented Oct 6, 2023

1. Force decoding

Need to fix forced unwrapping when decoding API response:

// func requestData(contentId: Int)
let response = try! JSONDecoder().decode(MovieDetail.self, from: data)

There's too many try! code in project. Need to fix

2. Model seperation

This project is now using API response model for view.
Need to use different model for view and separate dependency between View <-> API

@ChoiysApple ChoiysApple added the ♻️ Refactor Refactoring required label Oct 6, 2023
@ChoiysApple ChoiysApple changed the title [refactor] [refactor] Fix force decoding API response Oct 6, 2023
@ChoiysApple ChoiysApple changed the title [refactor] Fix force decoding API response [refactor] Fix force decoding API response, Separate API response model and Model for View Oct 6, 2023
@ChoiysApple ChoiysApple reopened this Oct 9, 2023
ChoiysApple added a commit that referenced this issue Nov 21, 2023
- disable line length rule
- disable force try rule, But this rule must be enabled when issue #43 completed
ChoiysApple added a commit that referenced this issue Nov 21, 2023
<!--- 
Pull Request title must contains Category, issue number, issue
description
(e.g. "[Feature] #123 Adding new Gestures")
-->

### Describe
- Added [SwiftLint](https://github.com/realm/SwiftLint) for better code
style

### Changes Made
- Add [SwiftLint](https://github.com/realm/SwiftLint) to pod
- disable some rules & exclude Pod from lint script 
- Fix Errors & warnings that SwiftLint makes

### Issues Resolved
- #51 

### Additional context
`force_try` rule is now disabled. Need to be enabled again after fixing
issue #43
@ChoiysApple ChoiysApple self-assigned this Nov 23, 2023
@ChoiysApple ChoiysApple added this to the 0.1.1 milestone Nov 23, 2023
@ChoiysApple ChoiysApple removed this from the 0.1.1 milestone Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
♻️ Refactor Refactoring required
Projects
No open projects
Development

No branches or pull requests

1 participant