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/ProcreateViewer/InfoViewController.swift

20 lines
577 B
Swift

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