I'm trying to access the QgsLayerTreeView class through the QgisInterface class in the python plugin I have created. Ultimately I want to be able to return the selected node (group or layer) from the QgsLayerTree.
The issue I'm running into is I don't know how to call it. Most information suggests to use iface as a way to access the interface but it's not recognised when called from the plugin (works fine from the python console in QGIS).
Is there any other way to create an instance of the QgisInterface class? Or is there a way I can import the iface class to work in my plugin?