-
Notifications
You must be signed in to change notification settings - Fork 0
/
Place.swift
52 lines (42 loc) · 1.18 KB
/
Place.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
51
52
//
// Place.swift
// Wanderlust
//
// Created by Mihikaa Goenka on 8/8/19.
// Copyright © 2019 Mihikaa Goenka. All rights reserved.
//
import Foundation
import UIKit
protocol Choice {
var filterImage: UIImage { get }
}
enum ChoiceType: Choice {
case hotel
case club
case restaurant
case site
var filterImage: UIImage { //return the enum title with first letter uppercased
return UIImage(named: String(describing: self))!
}
static func allValues() -> [ChoiceType] {
return [.hotel, .club, .restaurant, .site]
}
}
class Place{
var placeTitle: String
var placeLocation: String
var placeType: ChoiceType
var address: String
var placeDescription: String
var placeImage: UIImage!
var isFavorite: Bool
init(placeTitle: String, placeLocation: String, placeType: ChoiceType, placeDescription: String, placeImage: UIImage, address: String) {
self.placeTitle = placeTitle
self.placeType = placeType
self.placeLocation = placeLocation
self.placeDescription = placeDescription
self.placeImage = placeImage
self.isFavorite = false
self.address = address
}
}