diff --git a/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate b/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate index 4f11c97..7ff97e2 100644 Binary files a/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate and b/OTRS-Watch.xcodeproj/project.xcworkspace/xcuserdata/linnemann.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OTRS-Watch/Extension/ViewControllerExtension.swift b/OTRS-Watch/Extension/ViewControllerExtension.swift index 0e5a37a..2f7be06 100644 --- a/OTRS-Watch/Extension/ViewControllerExtension.swift +++ b/OTRS-Watch/Extension/ViewControllerExtension.swift @@ -70,6 +70,8 @@ extension ViewController: NSTableViewDataSource, NSTableViewDelegate { self.txtTicketCreated.stringValue = ticket.created.toString() self.txtTicketCreatedBy.stringValue = ticket.customerUserID self.txtTicketPriority.stringValue = ticket.priority + } else { + self.cleanField() } } } diff --git a/OTRS-Watch/ViewController.swift b/OTRS-Watch/ViewController.swift index 3f377ca..6bda580 100644 --- a/OTRS-Watch/ViewController.swift +++ b/OTRS-Watch/ViewController.swift @@ -29,11 +29,13 @@ class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() + // Do any additional setup after loading the view. + ticketTableView.delegate = self ticketTableView.dataSource = self - - // Do any additional setup after loading the view. + + self.cleanField() if UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER) != nil { txtUsername.stringValue = UserDefaults.standard.string(forKey: Constants.USER_SETTINGS.CREDENTIALS.USER)! @@ -66,6 +68,16 @@ class ViewController: NSViewController { } } + func cleanField() { + self.txtTicketQue.stringValue = "" + self.txtTicketNumber.stringValue = "" + self.txtTicketOwner.stringValue = "" + self.txtTicketTitle.stringValue = "" + self.txtTicketCreated.stringValue = "" + self.txtTicketCreatedBy.stringValue = "" + self.txtTicketPriority.stringValue = "" + } + // MARK: Actions