Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Shopify/View/HomeScreens/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
18 changes: 18 additions & 0 deletions Shopify/View/OrderScreens/WishViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -120,6 +137,7 @@ class WishViewController: UIViewController {
snackbar.show()
}
}

}

@IBAction func backAction(_ sender: Any) {
Expand Down
9 changes: 8 additions & 1 deletion Shopify/View/Stories/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -45,7 +46,8 @@
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="H1G-jl-pe3">
<rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" name="secondColor"/>
<color key="tintColor" name="secondColor"/>
</tabBar>
<connections>
<segue destination="Hht-BY-Vp9" kind="relationship" relationship="viewControllers" id="0wJ-Wl-zyd"/>
Expand Down Expand Up @@ -76,4 +78,9 @@
<point key="canvasLocation" x="19" y="5"/>
</scene>
</scenes>
<resources>
<namedColor name="secondColor">
<color red="0.62000000476837158" green="0.70200002193450928" blue="0.76099997758865356" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
5 changes: 5 additions & 0 deletions Shopify/View/Stories/HomeStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,11 @@
<point key="canvasLocation" x="84.732824427480907" y="4.2253521126760569"/>
</scene>
</scenes>
<designables>
<designable name="kqh-Vo-tcl">
<size key="intrinsicContentSize" width="120" height="20"/>
</designable>
</designables>
<resources>
<image name="Home" width="29" height="33"/>
<image name="Search" width="20" height="20"/>
Expand Down
5 changes: 1 addition & 4 deletions Shopify/View/Stories/ProfileStoryboard.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</tableView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="PEV-W6-Yli">
<rect key="frame" x="16" y="302.5" width="288" height="143.5"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<color key="backgroundColor" name="thirdColor"/>
<color key="sectionIndexBackgroundColor" name="thirdColor"/>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumFontSize="16" preferredMaxLayoutWidth="128" translatesAutoresizingMaskIntoConstraints="NO" id="lIs-Wr-hRm">
Expand Down Expand Up @@ -1011,9 +1011,6 @@ Mahmoud Refaat</string>
<systemColor name="secondaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="tertiaryLabelColor">
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.29803921568627451" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
Expand Down