Skip to content

fanta1ty/weather_forecast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

weather_forecast

iOS PROJECT GUIDE

1. PROBLEM SOLVED

  • ✓ The application is a simple iOS application which is written by Swift.
  • ✓ The application is able to retrieve the weather information from OpenWeatherMaps API.
  • ✓ The application is able to allow user to input the searching term.
  • ✓ The application is able to proceed searching with a condition of the search term length must be from 3 characters or above.
  • ✓ The application is able to render the searched results as a list of weather item.
  • ✓ The application is able to support caching mechanism so as to prevent the app from generating a bunch of API requests.
  • ✓ The application is able to manage caching mechanism & lifecycle.
  • ✓ The application is able to handle failures.
  • ✓ The application is able to support the disability to scale large text for who can't see the text clearly.
  • ✓ The application is able to support the disability to read out the text using VoiceOver controls.

2. PROJECT ARCHITECTURE

  1. Organization:

    • ** App**: Contains all the code relate to UI/UX and logic from UI/UX
      • Modules
      • Extension
      • DI
      • Others
      • Helper
    • ** Core**:
      • Usecase set
      • API set
      • DataStore set
      • Redux: State, Action, Reducer
      • Models: all the model for nesting app data
      • Other utilities
  2. Protocol oriented programming:

  3. Redux (ReSwift) for 1 direction data flow and app data store:

  4. UseCases:

    • All the logic executions will be defined into usecase.
    • Application will use usecase to process the logic such as: API call, do the local caching, process the image, photos....
    • Every UseCase normally contain 2 functions: start() and cancel()
    • Every UseCase normally handle all the logic execution behind the scene of application.
    • Initialize a UseCase should specify params: API provider, AppStateStore, DataStore and some parameter for input.
    • After a UseCase finish the logic, new action will be send to Reducer(Redux) and change some state from AppStateStore then App UI can receive the change and do the UI update.
    • Example: in the project normally we has has a module User so we will create a groups of UseCase relate to User module such as: LoginUseCase, RegisterUseCase, GerPorfileUseCase, UpdateProfileUseCase, CacheProfileDataUseCase, UploadProfileImageUseCase ...
  5. RxSwift and RxCocoa for UI processing and data binding:

    • RxSwift will use in the App State, all app state should be wrapped by Variable or BehaviorSubject.
    • https://www.raywenderlich.com/138547/getting-started-with-rxswift-and-rxcocoa
    • RxSwift and RxCocoa will be the main coding style
    • From logic and UI binding RxSwift combine with MVVM pattern will be the best choice
    • Data change from AppState will be handled from ViewModel, ViewModel will emit change to UI via RxSwift and RxCocoa
    • Only use RxSwift and RxCocoa from the App UI, Redux and PromiseKit will be replace from the App Core.

3. 3RD PARTY LIBRARY

  1. ReSwift
  2. RxSwift
  3. PromiseKit
  4. RxCocoa
  5. Alamofire
  6. SnapKit
  7. Swinject
  8. IQKeyboardManager
  9. TSwiftHelper
  10. SVProgressHUD
  11. SwiftLocation

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published