Xcode 8 - Swift 3 OS X- Refresh custom View Controller
<p>I am creating an application in Xcode 8 and Swift 3 for use at my place of employment. I am going to give you a brief understanding of what I am doing, and what I am attempting to do. So in my program I load data about the computer, including MAC address and IP Address, which I have working flawlessly. My issue is when I try to refresh the data, it either crashes or does not reload anything.</p>

<p>Now I have read the documentation that specifically says "Do not call viewDidLoad()" but I am not sure how else to reload the data. I have been working on this one little feature for a while, but unfortunately I am still coming up blank and cannot find much more information.</p>

<p>Basically I pull the information and then write them to labels which present the data to the technician. I have attempted to use the refresh function under the view controller, as well as the reload under the first response to no avail. Does anyone have any ideas that I can attempt to reload the data on button click?</p>

<p><strong>Edit 2</strong>:</p>

<pre><code>import Cocoa
import Foundation
import NetFS

class ViewController: NSViewController {
    // Hostname outlet
    @IBOutlet weak var populateHostname: NSTextField!
    // IP Address 1 outlet
    @IBOutlet weak var populateIPAddr: NSTextField!
    @IBOutlet weak var IPAdap1: NSTextField!
    // IP Address 2 outlet
    @IBOutlet weak var populateIPAddr2: NSTextField!
    @IBOutlet weak var IPAdap2: NSTextField!
    // MAC Adress 1 outlet
    @IBOutlet weak var populateMACAddress: NSTextField!
    @IBOutlet weak var MACAdap1: NSTextField!
    // MAC Address 2 outlet
    @IBOutlet weak var populateMACAddress2: NSTextField!
    @IBOutlet weak var MACAdap2: NSTextField!
    // OS Version outlet
    @IBOutlet weak var osVersion: NSTextField!
    // Buttons
    @IBOutlet weak var editLoginConfigButton: NSButton!
    @IBAction func refresh(_ sender: AnyObject) {
        //ViewController.setNeedsDisplay
        reloadData()
    }
    @IBAction func EditLoginConfig(_ sender: AnyObject) {
        *Omitted from code - for stackoverflow*
    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        loadData()
    }
    func reloadData() {
        //get adapters - includes IP, Adapter Name, and MAC Address
        let myInterfaces = getInterfaces()
        //ip address
        if (myInterfaces.count != 0) {
            populateIPAddr.stringValue = myInterfaces[0].addr
            IPAdap1.stringValue = myInterfaces[0].name
            if (myInterfaces.count != 1) {
                if (myInterfaces[0].addr != myInterfaces[1].addr) {
                    populateIPAddr2.stringValue = myInterfaces[1].addr
                    IPAdap2.stringValue = myInterfaces[1].name
                }
            } else {
                populateIPAddr2.stringValue = ""
                IPAdap2.stringValue = ""
            }
        }

        //mac address
        if (myInterfaces.count != 0) {
            populateMACAddress.stringValue = myInterfaces[0].mac
            MACAdap1.stringValue = myInterfaces[0].name
            if (myInterfaces.count != 1) {
                if (myInterfaces[0].mac != myInterfaces[1].mac) {
                    populateMACAddress2.stringValue = myInterfaces[1].mac
                    MACAdap2.stringValue = myInterfaces[1].name
                }
            } else {
                populateMACAddress2.stringValue = ""
                MACAdap2.stringValue = ""
            }
        }

    }
    func loadData() {
        //hostname
        let currentHost = Host.current().localizedName ?? ""
        populateHostname.stringValue = currentHost

        //get adapters - includes IP, Adapter Name, and MAC Address
        let myInterfaces = getInterfaces()
        //ip address
        if (myInterfaces.count != 0) {
            populateIPAddr.stringValue = myInterfaces[0].addr
            IPAdap1.stringValue = myInterfaces[0].name
            if (myInterfaces.count != 1) {
                if (myInterfaces[0].addr != myInterfaces[1].addr) {
                    populateIPAddr2.stringValue = myInterfaces[1].addr
                    IPAdap2.stringValue = myInterfaces[1].name
                }
            } else {
                populateIPAddr2.stringValue = ""
                IPAdap2.stringValue = ""
            }
        }

        //mac address
        if (myInterfaces.count != 0) {
            populateMACAddress.stringValue = myInterfaces[0].mac
            MACAdap1.stringValue = myInterfaces[0].name
            if (myInterfaces.count != 1) {
                if (myInterfaces[0].mac != myInterfaces[1].mac) {
                    populateMACAddress2.stringValue = myInterfaces[1].mac
                    MACAdap2.stringValue = myInterfaces[1].name
                }
            } else {
                populateMACAddress2.stringValue = ""
                MACAdap2.stringValue = ""
            }
        }

        //OS X Version
        let osVers = ProcessInfo.processInfo.operatingSystemVersion
        let osMajorVers = String(osVers.majorVersion)
        let osMinorVers = String(osVers.minorVersion)
        let osPatchVers = String(osVers.patchVersion)
        osVersion.stringValue = (osMajorVers + "." + osMinorVers + "." + osPatchVers)

        // Edit Users Login Config enabled/disabled
        if (NSUserName() == "Administrator" || NSUserName() == "administrator") {
            // disable button
            editLoginConfigButton.isEnabled = false
        }

    }

    override var representedObject: AnyObject? {
        didSet {
        // Update the view, if already loaded.

        }
    }



}
</code></pre>

<p>So as I said before (I believe), using it like this does not break the thread, but it also does not refresh the data. Any idea where it is failing?</p>