0

I am trying to call a function in the 'attendees' viewController from the viewContoller named 'swipePage':

Attendees:

func showMatchedScreen(){
    matchedView.isHidden = false
}

swipePage:

attendees().showMatchedScreen()

However I keep getting the following error on the line above:

fatal error: unexpectedly found nil while unwrapping an Optional value

Does anyone know why this is happening?

Fogmeister
  • 76,236
  • 42
  • 207
  • 306
MattBlack
  • 3,616
  • 7
  • 32
  • 58
  • 2
    Hint: Delegate pattern/Notifications/creating an instance of VC/viewDidLoad,ViewWillAppear – NSNoob Jan 04 '17 at 10:37
  • 1
    The instance created with `attendees()` is not the instance in the storyboard. You need an IBOutlet or protocol / delegate or callback closure. – vadian Jan 04 '17 at 10:38

0 Answers0