I have a storyviewcontroller which has objects on its view. I need to change the text on the UILabel(In the storyviewcontroller) and the load the view on an array. I have connected the IBOutlet to the label in the storyviewcontroller.
class StoryViewController: UIViewController {
@IBOutlet weak var textLabel: UILabel!
@IBOutlet weak var inspiredButton: UIButton!
I have created an object of the storyviewcontroller class and am able to access its variables. However, after creating the object of the storyviewcontroller, the IBOutlet is nil. Because of this, I get an exception saying found nil while unwrapping
let story:StoryViewController = StoryViewController()
story.textLabel.text = sampleText()
Can you please help me with this! Here is a link to the whole project https://github.com/abhishekagarwal2301/DTC Thanks