-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEnvironment.swift
50 lines (35 loc) · 955 Bytes
/
Environment.swift
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
///
/// Environment.swift
///
import UIKit
// MARK: - Environment Type
enum EnvironmentType: String {
case bee, bird, frog
static var all = [bee, bird, frog]
var key: KeyType {
switch self {
case .bee:
return .honeycomb
case .bird:
return .flower
case .frog:
return .lilypad
}
}
var animalImages: [UIImage] {
return [1,2,3,4].map { UIImage(named: "\(rawValue)\($0)")! }
}
func backgroundColor(for weather: WeatherType) -> UIColor {
return Palette.backgroundColor(for: self, weather: weather)
}
}
// MARK: - Key Type
enum KeyType {
case honeycomb, lilypad, flower
var size: CGSize { return CGSize(width: 100, height: 100) }
}
// MARK: - Weather Type
enum WeatherType: String {
case cloudy, dark, sunny
var size: CGSize { return CGSize(width: 100, height: 100 ) }
}