- I'm using
NSCache
to cache every loadingAVPlayerItem
, with key isaudioLink
- Using only one instance of
AVPlayer
to plays all audios in app, avoid create too many players it leading to crash - When playing an audio, just checking it whether in cache or not.
- If cache already had that audio the get corresponding
AVPlayerItem
and replace to the player. - If cache not contains that audio then create new
AVPlayerItem
, replace into the player and add it into cache
- If cache already had that audio the get corresponding
- Engine: Shared classes, enums, structures, or logic, business on backend, networks, parsers, helpers, caches, data store, etc...
- Manager: Contains Singleton class to handle Application product
- Authentication manager
- Push notifications manager
- REST manager files
- Constant:
- AppConstants file
- RESTConstants file
- Constants file
- ...
- Utility:
- AppUtils file
- RESTUtils file
- ...
- Config: Contains everything contribute for configuration app
- AppConfig file: Configure all setting in app: Feedback, geting started with third party libraries, configure server's hosts, configure logger, ...
- Extension: Extend class / struct / enum
- Service:
- ApiService: Call API
- SystemService: Handle system service (Push Notification, ...)
- Persistence: Store entities here
- Manager: Contains Singleton class to handle Application product
- ViewModule: Every module contains View, ViewModel & anything related to front end.
- Component: The views that they will be share between multiple screens. With each screen should be has a folder for itself
- View: Represent for the screens. With each screen should be has a folder for itself
- E.g. Feed:
FeedViewController.swift
fileFeedViewModel.swift
file
- E.g. Feed:
- Resource: Can be contains Images, Sounds, Layout config file, etc.
Assets.xcassets
Localizable.strings
- ...
- Storyboard: Put all storyboards at here. With each screen should be has a storyboard file for itself => Reduce conflicts when merge Pull Request