diff --git a/Shopify/View/HomeScreens/HomeViewController.swift b/Shopify/View/HomeScreens/HomeViewController.swift index 67f2a42..a485b2d 100644 --- a/Shopify/View/HomeScreens/HomeViewController.swift +++ b/Shopify/View/HomeScreens/HomeViewController.swift @@ -45,6 +45,38 @@ class HomeViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + if adsList.count == 0 + { + adsCollection.isHidden = true + let imgError = UIImageView(frame: CGRect(x: 100, y: 300, width: self.view.frame.width - 200 , height: 150)) + imgError.image = UIImage(systemName: "icloud.slash") + imgError.tintColor = .darkGray + self.view.addSubview(imgError) + + let lblMsg = UILabel(frame: CGRect(x: Int(imgError.frame.minX), y: Int(imgError.frame.maxY) + 15, width: Int(imgError.frame.width) + 50, height: 30)) + lblMsg.text = "There is no Data to Display" + // lblMsg = .darkGray + // lblMsg.textAlignment = .center + self.view.addSubview(lblMsg) + + } + if brandArray.count == 0 + { + brandCollection.isHidden = true + let imgError = UIImageView(frame: CGRect(x: 100, y: 300, width: self.view.frame.width - 200 , height: 150)) + imgError.image = UIImage(systemName: "icloud.slash") + imgError.tintColor = .darkGray + self.view.addSubview(imgError) + + let lblMsg = UILabel(frame: CGRect(x: Int(imgError.frame.minX), y: Int(imgError.frame.maxY) + 15, width: Int(imgError.frame.width) + 50, height: 30)) + lblMsg.text = "There is no Data to Display" + // lblMsg = .darkGray + // lblMsg.textAlignment = .center + self.view.addSubview(lblMsg) + + } + + brandCollection.refreshControl = refreshControl refreshControl.addTarget(self, action: #selector(refreshData), for: .valueChanged) diff --git a/Shopify/View/OrderScreens/WishViewController.swift b/Shopify/View/OrderScreens/WishViewController.swift index 56545fe..827eb6a 100644 --- a/Shopify/View/OrderScreens/WishViewController.swift +++ b/Shopify/View/OrderScreens/WishViewController.swift @@ -44,6 +44,8 @@ class WishViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + + wishTV.refreshControl = refreshControl refreshControl.addTarget(self, action: #selector(refreshData), for: .valueChanged) dataVM = CoreDataViewModel() @@ -98,6 +100,21 @@ class WishViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { wishTV.reloadData() reachability = Reachability.forInternetConnection() + if wishListCoreDate?.count == 0 + { + wishTV.isHidden = true + let imgError = UIImageView(frame: CGRect(x: 100, y: 300, width: self.view.frame.width - 200 , height: 150)) + imgError.image = UIImage(systemName: "icloud.slash") + imgError.tintColor = .darkGray + self.view.addSubview(imgError) + + let lblMsg = UILabel(frame: CGRect(x: Int(imgError.frame.minX), y: Int(imgError.frame.maxY) + 15, width: Int(imgError.frame.width) + 50, height: 30)) + lblMsg.text = "There is no Data to Display" + // lblMsg = .darkGray + // lblMsg.textAlignment = .center + self.view.addSubview(lblMsg) + + } if ((reachability!.isReachable()) ) { flag = true @@ -120,6 +137,7 @@ class WishViewController: UIViewController { snackbar.show() } } + } @IBAction func backAction(_ sender: Any) { diff --git a/Shopify/View/Stories/Base.lproj/Main.storyboard b/Shopify/View/Stories/Base.lproj/Main.storyboard index 80cfc6b..c2267a1 100644 --- a/Shopify/View/Stories/Base.lproj/Main.storyboard +++ b/Shopify/View/Stories/Base.lproj/Main.storyboard @@ -3,6 +3,7 @@ + @@ -45,7 +46,8 @@ - + + @@ -76,4 +78,9 @@ + + + + + diff --git a/Shopify/View/Stories/HomeStoryboard.storyboard b/Shopify/View/Stories/HomeStoryboard.storyboard index e532918..329493f 100644 --- a/Shopify/View/Stories/HomeStoryboard.storyboard +++ b/Shopify/View/Stories/HomeStoryboard.storyboard @@ -579,6 +579,11 @@ + + + + + diff --git a/Shopify/View/Stories/ProfileStoryboard.storyboard b/Shopify/View/Stories/ProfileStoryboard.storyboard index 11f78a8..122d107 100644 --- a/Shopify/View/Stories/ProfileStoryboard.storyboard +++ b/Shopify/View/Stories/ProfileStoryboard.storyboard @@ -78,7 +78,7 @@ - +