1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
silica-viewer/SilicaViewer/InfoViewController.swift

24 lines
740 B
Swift
Raw Normal View History

import Foundation
import Cocoa
class InfoViewController: NSViewController {
var document: Document?
@IBOutlet weak var timeSpentLabel: NSTextField!
@IBOutlet weak var layerCountLabel: NSTextField!
override func viewWillAppear() {
super.viewDidAppear()
let formatter = DateComponentsFormatter()
formatter.allowedUnits = [.hour, .minute, .second]
formatter.unitsStyle = .full
let formattedString = formatter.string(from: TimeInterval(document!.info.trackedTime))!
timeSpentLabel.stringValue = "Time Spent: " + formattedString
layerCountLabel.stringValue = "Number of layers: " + String(document!.info.layers.count)
}
}