Skip to content

Instantly share code, notes, and snippets.

@iPHYZLL
Created February 4, 2021 10:11
Show Gist options
  • Save iPHYZLL/7db43e743815394e4553b4a271f8cdaa to your computer and use it in GitHub Desktop.
Save iPHYZLL/7db43e743815394e4553b4a271f8cdaa to your computer and use it in GitHub Desktop.
Namespace Example
import UIKit
enum Constant {
/// Namespace for Alpha related constants
enum Alpha {
static let quarter: CGFloat = 0.25
static let half: CGFloat = 0.5
static let threeQuarter: CGFloat = 0.75
static let none: CGFloat = 1.0
}
/// Namespace for Corner related constants such as Radius, Width and more.
enum Corner {
/// Children of Corner Namespace for retrieving Radius related constants.
enum Radius {
static let `default`: CGFloat = 8
static let none: CGFloat = 0
}
}
/// Namespace for Text related constants
enum Text {
static let name = "Name"
static let birthday = "Birthday"
/// Namespace for retrieving title type texts
enum Title {
static let employees = "Employees"
static let analytics = "Analytics"
static let addEmployee = "Add Employee"
static let averageAge = "Average age"
static let medianAge = "Median age"
static let highestSalary = "Highest salary"
static let lowestSalary = "Lowest salary"
static let averageSalary = "Average salary"
static let workersGenderRatio = "Employees by Gender"
static let details = "Details"
static let searchResults = "Search Results"
static let removeEmployee = "Remove Employee"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment