pEpForiOS/UI/Folder/ViewModel/FolderCellViewModel.swift
author Dirk Zimmermann <dirk@pep-project.org>
Tue, 23 May 2017 11:32:32 +0200
changeset 2191 a01eb69e9664
parent 2045 01b83254d3de
child 2664 874827a49c0f
permissions -rw-r--r--
IOS-490 viewed folders marked as "interesting"
     1 //
     2 //  FolderViewModel.swift
     3 //  pEpForiOS
     4 //
     5 //  Created by Xavier Algarra on 20/02/17.
     6 //  Copyright © 2017 p≡p Security S.A. All rights reserved.
     7 //
     8 
     9 import Foundation
    10 import MessageModel
    11 
    12 public class FolderCellViewModel {
    13     public var icon: UIImage {
    14         return self.folder.folderType.getIconType()
    15     }
    16 
    17     public var title : String {
    18         return self.name
    19     }
    20 
    21     public var number: Int {
    22         return 0 //fake number
    23     }
    24 
    25     public var arrow: UIImage {
    26         return UIImage(named: "arrow_down_icon")!
    27     }
    28 
    29     var folder: Folder
    30     var level : Int
    31 
    32     public init(folder: Folder, level: Int) {
    33         self.folder = folder
    34         self.level = level
    35     }
    36 
    37     func getFolder() -> Folder {
    38         return folder
    39     }
    40 
    41     private var name:String {
    42         return self.folder.realName
    43     }
    44 
    45     var leftPadding: Int {
    46         return level
    47     }
    48 }