AmivApplicationModel.swift 1.04 KB
Newer Older
domenicw's avatar
domenicw committed
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
//
//  AmivApplicationModel.swift
//  Amiv
//
//  Created by Domenic Wüthrich on 18.09.18.
//  Copyright © 2018 Amiv an der ETH. All rights reserved.
//

import Foundation
import UIKit

public struct AmivApplicationModel {
    
    public let app: AmivApplication
    
    public let title: String
    
    public let image: UIImage?
    
    // MARK: - Initializers
    
    public init(app: AmivApplication, title: String, image: UIImage?) {
        self.app = app
        self.title = title
        self.image = image
    }
    
}

extension AmivApplicationModel {
    
    public static func createModels() -> [AmivApplicationModel] {
        let models: [AmivApplicationModel] = [.createCheckinModel(), .createBarcodeModel()]
        return models
    }
    
    public static func createCheckinModel() -> AmivApplicationModel {
        return self.init(app: .checkin, title: "Checkin", image: nil)
    }
    
    public static func createBarcodeModel() -> AmivApplicationModel {
        return self.init(app: .barcode, title: "Barcode", image: nil)
    }

}