forked from asuc-octo/berkeley-mobile-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResource.swift
More file actions
36 lines (28 loc) · 858 Bytes
/
Resource.swift
File metadata and controls
36 lines (28 loc) · 858 Bytes
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
import UIKit
import Foundation
/**
* **Resource** describes one thing (usually a building) available to students.
*/
protocol Resource: class, TypeString, Favorable
{
// MARK: Class
static func displayName(pluralized: Bool) -> String
static var dataSource: ResourceDataSource.Type? { get }
static var detailProvider: ResourceDetailProvider.Type? { get }
// MARK: Instance
var name: String { get }
var imageURL: URL? { get }
var image: UIImage? {get set}
/// Whether this `Resource` is currently open.
var isOpen: Bool { get }
/// String description in the form "Type: name", for debugging purposes.
var description: String { get }
}
// MARK: - Default Implementations
extension Resource
{
var description: String
{
return "\(type(of: self)): \(self.name)"
}
}