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

[Fix] #58 ChartView category change is not working correctly #60

Merged
merged 17 commits into from
Dec 12, 2023

Conversation

ChoiysApple
Copy link
Owner

Describe

  • In Charts View, list content seems like not changing when category is changed but It's reloading
  • New list was appended to existing list but it should replace existing list
  • Because currentPage property is added by 1 whenever category changed, new list is considered as next list

Changes Made

Remove currentPage adding code from requestData(category: MovieListCategory)

    func requestData(category: MovieListCategory) {
        
        if currentCategory != category { currentPage = 1 }
        currentCategory = category
        fetchData(category: category)
        // current page += 1
    }

Issues Resolved

- yml file not edited yet
- lint error is not fixed yet
- disable line length rule
- disable force try rule, But this rule must be enabled when issue #43 completed
<!--- 
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
- Remake folders as Application, Presentation, Domain, Resources
- Extract use-case code from APIService.swift into MovieAPI.swift
- Rename Extension.swift to StyleExtensions.swift (Need to rework in future)
- Rename Constants.swift to Identifiers.swift (Need to remove after issue #42)
Because this app is not using any storyboard for UI, Main.storyboard can be deleted
- Delete Main.storyboard
- Add Root ViewController to window at SceneDelegate method
- Delete UISceneStoryboardFile property from info.plist
### Describe
Reorganize file structure using example of [Template iOS App using Clean
Architecture and
MVVM](https://github.com/kudoleh/iOS-Clean-Architecture-MVVM)

### Changes Made
1. Reorganize file structure
    - Remake folders as Application, Presentation, Domain, Resources
    - Extract use-case code from APIService.swift into MovieAPI.swift
- Rename Extension.swift to StyleExtensions.swift (Need to rework in
future)
- Rename Constants.swift to Identifiers.swift (Need to remove after
issue [#42](#42))

2. Remove Main.storyboard
    - Delete Main.storyboard
    - Add Root ViewController to window at SceneDelegate method
    - Delete UISceneStoryboardFile property from info.plist

### Issues Resolved
- #33 

### Additional context
`Constants.swift` renamed to `Identifiers.swift` but need to **remove**
after issue [#42](#42))

close #33
- Create protocol to Presentation > Common
…sing ReusableCell's reuseIdentifer property automatically
This file is created to manage cell identifiers
No need now
<!--- 
Pull Request title must contains Category, issue number, issue
description
(e.g. "[Feature] #123 Adding new Gestures")
-->

### Describe
`UITableView` `UICollectionView` reuse identifier refactoring

### Changes Made
- Delete `Identifiers.swift`
- Create `ReusableCell` Protocol and Extensions for `UITableView` and
`UICollectionView`
- Replace cell registration and reusing

### Issues Resolved
- #42 

### Additional context
About cells in `CreditViewController`
- UITableView is using 2 UITableViewCell: (default `UITableViewCell` and
`CreditTableViewDescriptionCell`)
- Needed to create `CreditTableViewCell` to replace default
`UITableView`
- `CreditTableViewDescriptionCell` is not registered or reused, so there
was some refactoring

### References
[iOS Cell Registration and Reusing with Swift Protocol Extensions and
Generics](https://medium.com/@gonzalezreal/ios-cell-registration-reusing-with-swift-protocol-extensions-and-generics-c5ac4fb5b75e)
[Nicer reuse identifiers with protocols in
Swift](https://medium.com/bleeding-edge/nicer-reuse-identifiers-with-protocols-in-swift-97d18de1b2df)
- Move view setting code from awakeFromNib() to custom initializer
- Create setData and setUpLayout method for better code quality
### Describe
`CreditTableViewCell` backgroundColor & textColor changing code is not
working

### Changes Made
- Move view setting code from awakeFromNib() to custom initializer
- Create setData and setUpLayout method for better code quality

### Screenshots
**AS-IS**
<img
src="https://github.com/ChoiysApple/Filmboard/assets/43776784/2d659b22-1876-4549-bf17-09691a9b84dd"
width="25%" alt="this was image">

**TO-BE**
<img
src="https://github.com/ChoiysApple/Filmboard/assets/43776784/120df159-c92e-4749-80e5-d81c21b9388d"
width="25%" alt="this was image">

### Issues Resolved
- #57
remove invalid adding currentPage
@ChoiysApple ChoiysApple self-assigned this Dec 12, 2023
@ChoiysApple ChoiysApple merged commit 5b7c4d1 into main Dec 12, 2023
1 check passed
@ChoiysApple
Copy link
Owner Author

Wrong merge target branch

  • Commits from this pr dropped and force pushed to main manually

@ChoiysApple ChoiysApple deleted the fix/#58-ChartCategoryNotChange branch December 12, 2023 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant