mikelily

Untitled

Jul 11th, 2019
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.88 KB | None | 0 0
  1. // 1) MenuDelegate.swift    
  2.   //Old
  3.   func toCatalogPage(Catalog: Catalog)
  4.   //New
  5.   func toCatalogPage(ProductType: ProductType)
  6. // 2) MenuViewController.swift
  7.   //Old
  8.   func toCatalogPage(Catalog: Catalog){
  9.           CatalogMenuViewController?.parentCatalog = Catalog
  10.           // ...
  11.   }
  12.   //New
  13.   func toCatalogPage(ProductType: ProductType){
  14.           CatalogMenuViewController?.parentProductType = ProductType
  15.           // ...
  16.   }
  17. // 3) LeftMenuViewController.swift
  18.   func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
  19.     //...
  20.    
  21.     //Old
  22.     MenuDelegate?.toCatalogPage(Catalog: catalogs[indexPath.row])
  23.     //New
  24.     MenuDelegate?.toCatalogPage(ProductType: ProductTypes[indexPath.row])
  25.    
  26.     //...
  27.   }
  28. // 4) CatalogMenuViewController.swift
  29.     //Old
  30.     var parentCatalog: Catalog = Catalog()
  31.     //New
  32.     var parentProductType: ProductType = ProductType()
Advertisement
Add Comment
Please, Sign In to add comment