12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- //
- // EmptyVC.swift
- // PDF Reader Pro Edition
- //
- // Created by Niehaoyu on 2024/9/13.
- //
- import Cocoa
- import KMComponentLibrary
- class EmptyVC: NSViewController {
-
- @IBOutlet weak var emptyView: ComponentEmpty!
-
- @IBOutlet weak var showTitleBtn: NSButton!
- @IBOutlet weak var showSubTitleBtn: NSButton!
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do view setup here.
-
- self.reloadData()
- }
-
- func reloadData() {
- var title: String = ""
- if self.showTitleBtn.state == .on {
- title = "Title-Title"
- }
-
- var subtitle: String = ""
- if self.showSubTitleBtn.state == .on {
- subtitle = "subTitle-subTitle"
- }
-
-
- let emptyProperty = ComponentEmptyProperty(image: ComponentLibrary.shared.image(forResource: "test"), text: title, subText: subtitle)
- emptyView.properties = emptyProperty
-
-
- }
-
- @IBAction func clickAction(_ sender: Any) {
- self.reloadData()
- }
- }
|