pEpForiOS/UI/EmailDisplay/MessageSubjectCell.swift
author Dirk Zimmermann <dirk@pep-project.org>
Tue, 24 Jan 2017 10:47:08 +0100
changeset 1507 7270fb02923c
parent 1472 0c0cd852f3f3
child 1927 80bb88fbb017
permissions -rw-r--r--
IOS-417 consolidating creation of swipe actions
yves@1362
     1
//
yves@1362
     2
//  MessageSubjectCell.swift
yves@1362
     3
//
yves@1362
     4
//  Created by Yves Landert on 21.12.16.
yves@1362
     5
//  Copyright © 2016 appculture AG. All rights reserved.
yves@1362
     6
//
yves@1362
     7
yves@1362
     8
import UIKit
yves@1362
     9
import MessageModel
yves@1362
    10
yves@1362
    11
open class MessageSubjectCell: MessageCell {
yves@1362
    12
    
yves@1363
    13
    let dateFormatter = UIHelper.dateFormatterEmailDetails()
yves@1363
    14
    
yves@1362
    15
    public override func updateCell(_ model: ComposeFieldModel, _ message: Message) {
yves@1362
    16
        fieldModel = model
yves@1363
    17
        titleLabel?.text = message.shortMessage
yves@1362
    18
        
dirk@1472
    19
        if let originationDate = message.received {
dirk@1472
    20
            UIHelper.putString(dateFormatter.string(from: originationDate as Date), toLabel: valueLabel)
yves@1363
    21
        } else {
yves@1363
    22
            UIHelper.putString(nil, toLabel: valueLabel)
yves@1363
    23
        }
yves@1362
    24
    }
yves@1362
    25
}