1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // NCEmpty.swift
- // Nextcloud
- //
- // Created by Marino Faggiana on 19/10/2020.
- // Copyright © 2020 Marino Faggiana. All rights reserved.
- //
- import Foundation
- class NCEmpty: NSObject {
-
- var emptyView: NCEmptyView?
-
- init(collectioView: UICollectionView, image: UIImage, title: String, description: String) {
- super.init()
- if let emptyView = UINib(nibName: "NCEmptyView", bundle: nil).instantiate(withOwner: self, options: nil).first as? NCEmptyView {
- self.emptyView = emptyView
-
- emptyView.emptyImage.image = image
- emptyView.emptyTtle.text = title
- emptyView.emptyDescription.text = description
-
- collectioView.addSubview(emptyView)
-
- emptyView.leftAnchor.constraint(equalTo: collectioView.leftAnchor).isActive = true
- emptyView.rightAnchor.constraint(equalTo: collectioView.rightAnchor).isActive = true
- emptyView.topAnchor.constraint(equalTo: collectioView.topAnchor).isActive = true
- emptyView.bottomAnchor.constraint(equalTo: collectioView.bottomAnchor).isActive = true
- }
- }
- }
- class NCEmptyView: UIView {
-
- @IBOutlet weak var emptyImage: UIImageView!
- @IBOutlet weak var emptyTtle: UILabel!
- @IBOutlet weak var emptyDescription: UILabel!
- }
|