12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- import UIKit
- class NCCapabilitiesViewController: UIViewController {
- @IBOutlet weak var textView: UITextView!
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- self.title = NSLocalizedString("_capabilities_", comment: "")
-
- let closeButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_done_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(close))
- self.navigationItem.leftBarButtonItem = closeButton
-
- guard let account = NCManageDatabase.sharedInstance.getAccountActive() else { return }
-
- if let jsonText = NCManageDatabase.sharedInstance.getCapabilities(account: account.account) {
- textView.text = jsonText
- } else {
- NCContentPresenter.shared.messageNotification("_error_", description: "_no_capabilities_found_", delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.info, errorCode: Int(k_CCErrorInternalError), forced: true)
-
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
- self.dismiss(animated: true, completion: nil)
- }
- }
- }
-
- @objc func close() {
-
- self.dismiss(animated: true, completion: nil)
- }
- }
|