KMWatermarkAdjectiveBaseView.swift 963 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // KMWatermarkAdjectiveBaseView.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2022/12/17.
  6. //
  7. import Cocoa
  8. typealias KMWatermarkAdjectiveBaseViewItemClick = (Int, Any) ->()
  9. class KMWatermarkAdjectiveBaseView: NSView, NibLoadable {
  10. var itemClick: KMWatermarkAdjectiveBaseViewItemClick!
  11. var model: KMWatermarkModel!
  12. static var nibName: String? {
  13. return "KMWatermarkAdjectivePropertyBaseController"
  14. }
  15. static func createFromNib(in bundle: Bundle = Bundle.main) -> Self? {
  16. guard let nibName = nibName else { return nil }
  17. var topLevelArray: NSArray? = nil
  18. bundle.loadNibNamed(NSNib.Name(nibName), owner: nil, topLevelObjects: &topLevelArray)
  19. guard let results = topLevelArray else { return nil }
  20. let views = Array<Any>(results).filter { $0 is Self }
  21. return views.last as? Self
  22. }
  23. func setModel(model: KMWatermarkModel) {
  24. self.model = model
  25. }
  26. }