Skip to content

canhth/ChannelView

Repository files navigation

A simple MindValley Channel app.

Technical notes

  • Following VIPER architechture.
  • Pull to refresh.
  • Images and Network caching.
  • UI improved, support iPad screens.
  • UnitTests.
  • Swiftlint for coding styles & clean code.
  • Support fastlane. Run fastlane scan in Xcode project directory.
  • Prepared to support multi environments (dev and prod).

What parts of the test did you find challenging and why?

  • Caching Image and JSON data. I tried to simply use URLCache for both Images and Datas but it's keeping on Memory only. so I decided to use a framework to reduce the workload.

What feature would you like to add in the future to improve the project?

  • Make Channel simpler by move Latest Episode to tableHeaderView and Categories to tableFooterView.
  • Apply SkeletonView for loading animation.
  • Intergrate CI/CD with this repo, to double check every commit/PR pass the test cases.
  • Make Test Coverage > 90% (Now is 75.5%)
  • Add UI tests.
  • Improve UI on Ipads.

Project structures

MindValley
├── Resources
├── Models
├── Modules
├── Core
│  └── Helper
|  └── Extensions
|  └── Networking
│  └── BaseVIPER
|     └── Presenter
|     └── Router
|     └── View

MindValleyTests

VIPER

VIPER is a very clean architecture. It isolates each module from others. So changing or fixing bugs are very easy as you only have to update a specific module. Also for having modular approach VIPER creates a very good environment for unit testing.

Other Key Advantages of VIPER Architecture:
  • Good for large teams.
  • Makes it scalable. Enable developers to simultaneously work on it as seamlessly as possible.
  • Makes it easy to add new features.
  • Makes it easy to write automated tests since your UI logic is separated from the business logic.
  • Makes it easier to track issues via crash reports due to the Single Responsibility Principle.
  • Makes the source code cleaner, more compact, and reusable.
  • Reduces the number of conflicts within the development team.
  • Applies SOLID principles.

VIPER Template

I created a VIPER Xcode template to make the work easier, reduce time for create new files and repeate the same code per module.

Installation Instruction

To create new module: Create new Group as your module name ---> Add new File --> Scroll down to select VIPER template --> type your module name.

BaseNetworking

A very lightweight URLSession wrapper to work with REST APIs. Easy to use and flexible with diffirent endpoints, methods.

networkClient.fetch(endPoint: ListUsersEndpoint.fetchListCategories(), type: [Cateogy].self) { (result) in
            switch result {
            case .success(let categories):
                print("Fetched list categories: \(categories)")
            case .failure(let error):
                print("Error: \(error)")
            }
        }

TestCases

Add test cases for each modules or base components to make sure we won't break it after changes. Can run fastlane scan

  • CategoriesTests.
  • ChannelsTests.
  • CollectionCellTests.
  • Load data from cache.
  • Support Mockable test or load data from local JSON.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published