-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathTableState.swift
More file actions
89 lines (82 loc) · 3.15 KB
/
Copy pathTableState.swift
File metadata and controls
89 lines (82 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// CustomState.swift
// StateView
//
// Created by Alberto Aznar de los Ríos on 24/05/2019.
// Copyright © 2019 Alberto Aznar de los Ríos. All rights reserved.
//
import UIKit
import EmptyStateKit
enum TableState: CustomState {
case noNotifications
case noBox
case noCart
case noFavorites
case noLocation
case noProfile
case noSearch
case noTags
case noInternet
case noIncome
case inviteFriend
var image: UIImage? {
switch self {
case .noNotifications: return UIImage(named: "Messages")
case .noBox: return UIImage(named: "Box")
case .noCart: return UIImage(named: "Cart")
case .noFavorites: return UIImage(named: "Favorites")
case .noLocation: return UIImage(named: "Location")
case .noProfile: return UIImage(named: "Profile")
case .noSearch: return UIImage(named: "Search")
case .noTags: return UIImage(named: "Tags")
case .noInternet: return UIImage(named: "Internet")
case .noIncome: return UIImage(named: "Income")
case .inviteFriend: return UIImage(named: "Invite")
}
}
var title: String? {
switch self {
case .noNotifications: return "No message notifications"
case .noBox: return "The box is empty"
case .noCart: return "The cart is empty"
case .noFavorites: return "No favorites"
case .noLocation: return "Where are you?"
case .noProfile: return "Not logged In"
case .noSearch: return "No results"
case .noTags: return "No collections"
case .noInternet: return "We’re Sorry"
case .noIncome: return "No income"
case .inviteFriend: return "Ask friend!"
}
}
var description: String? {
switch self {
case .noNotifications: return "Sorry, you don't have any message. Please come back later!"
case .noBox: return "You dont have any email!"
case .noCart: return "Please, select almost one item to purchase"
case .noFavorites: return "Select your favorite items first!"
case .noLocation: return "We can't find your location"
case .noProfile: return "Please register or log in first"
case .noSearch: return "Please try another search item"
case .noTags: return "Go to collect favorites products"
case .noInternet: return "Our staff is still working on the issue for better experience"
case .noIncome: return "You have no payment so contact your client"
case .inviteFriend: return "You could borrow money from your network"
}
}
var titleButton: String? {
switch self {
case .noNotifications: return "Search again?"
case .noBox: return "Search again?"
case .noCart: return "Go back"
case .noFavorites: return "Go back"
case .noLocation: return "Locate now!"
case .noProfile: return "Log in now!"
case .noSearch: return "Go back"
case .noTags: return "Go shopping"
case .noInternet: return "Try again?"
case .noIncome: return "Request payment"
case .inviteFriend: return "View contact"
}
}
}