1. Home
  2. Docs
  3. UberEats Clone – Documentation
  4. Navigating the Code
  5. Main Screens

Main Screens

For each screen of an iOS app, there’s a corresponding view controller. Since our UberEats clone is much more complex than a simple app, there are multiple view controllers being presented at the same time, but all of them live within the same host view controller.

The Host View Controller – MultiVendorHostViewController.swift

This is the main host view controller of the app. It subclasses our ATCHostViewController, and manages things such as:

  • Creating and handling the cart button on top right (badgeButton & cartManager)
  • It configures the main navigation
    let config = ATCHostConfiguration(menuConfiguration: menuConfiguration,
                                      style: .sideBar,
                                      topNavigationRightViews: [
                                         badgeButton,
                                         self.mapButton()],
                                      titleView: nil,
                                      topNavigationLeftImage: self.uiEcommerceConfig.navigationMenuImage,
                                      topNavigationTintColor: nil,
                                      statusBarStyle: self.uiEcommerceConfig.statusBarStyle,
                                      uiConfig: uiConfig,
                                      pushNotificationsEnabled: false,
                                      locationUpdatesEnabled: false)
  • It creates all the menu items and their corresponding view controllers, including the admin dashboard (if the user is an admin) and the logout button.
  • It also creates and handles the taps on the map button on top right (mapButton)

Main View Controllers

For each screen, there’s a main view controller that does the heavy lifting for displaying all the UI elements properly to the user. Here’s the list:

  • Home Screen – MultiVendorHomeViewController.swift, which has important child view controllers (sub-screens):
    • VendorListCollectionViewController – the lists of restaurants on the home page

    • The stories tray at the top – created in storiesViewController method
    • The categories tray at the top – created in fullWidthVendorCategoriesVC method
  • Categories Screen: ATCGenericCollectionViewController
  • Shopping Cart: ATCShoppingCartViewController
  • Orders Screen: ATCOrderViewController
  • Profile Screen: MultiVendorProfileViewController
  • Map Screen: ATCMapViewController
  • Food Menu per Vendor: VendorProductsListViewController
  • Single Product Screen: ProductDetailsViewController
  • Search Screen: ATCGenericSearchViewController<Product>
  • Reservations Screen: ReservationViewController
  • Admin Dashboard: ATCAdminOrdersViewController
  • Wishlist Screen: MultiVendorWishlistViewController
  • Settings Screen: MultiVendorProfileSettingsViewController
  • Account Details: ATCAccountDetailsViewController
  • Add Review: ATCAddReviewViewController

All of these view controllers follow our adapter pattern on the generic view controller, with their own data sources, coming from the data source provider. Since everything was detailed in the previous core components section, understanding each view controller should be straightforward, given the high modularity in small components & methods that are named self-explanatorily.