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/ViewController.swift

30 lines
1.1 KiB
Swift
Raw Normal View History

2020-03-10 14:23:54 -04:00
import Foundation
import Cocoa
class ViewController: NSViewController {
@IBOutlet weak var imageView: NSImageView!
2020-03-11 22:15:05 -04:00
2020-03-10 14:23:54 -04:00
override func viewWillAppear() {
let document = self.view.window?.windowController?.document as? Document
2021-09-30 07:55:58 -04:00
DispatchQueue.main.async {
let image = document?.makeComposite()
//DispatchQueue.main.sync {
self.imageView.image = image
//}
}
}
override func prepare(for segue: NSStoryboardSegue, sender: Any?) {
if(segue.identifier == "showInfo") {
// TODO: there HAS to be a better way to pass the Document class along...
(segue.destinationController as! InfoViewController).document = self.view.window?.windowController?.document as? Document
2021-05-09 21:44:04 -04:00
} else if(segue.identifier == "showTimelapse") {
((segue.destinationController as! NSWindowController).contentViewController as! TimelapseViewController).document = self.view.window?.windowController?.document as? Document
}
2020-03-10 14:23:54 -04:00
}
}