I have made a func in ViewController
, that can receive a string and change the title of a label, that is located on screen.
Here it is:
func setNewTitleForMainLabelOnScreen(text: String){
mainLabelOnScreen.cell?.title = text
}
What i want to do, is to call this function (viewController's method?) from another class.
Like that:
class MainLabelEditor{
func updateLabelOnScreen{
ViewController.setNewTitleForMainLabelOnScreen(text: "Hello")
}
}
Unfortunately, it doesn't work.
Here is what xcode says:
If I press return, it shows this:
The question is, how do i call setNewTitleForMainLabelOnScreen
from MainLabelEditor
?