I am trying to pass down the activeConversation inside the initial view controller to another view controller. The way I am doing this is by setting an variable called currentConversation to the activeConversation. However whenever I try to access that attribute it returns nil.
Initial View Controller:
vc.displayType = self.passSelectedPhrase
vc.currentConversation = activeConversation
performSegue(withIdentifier: "showDetail", sender: selectedPhrase)
Messages View Controller (delegate):
var currentConversation : MSConversation!
func saySomething(value: String){
if ((currentConversation) != nil) {
currentConversation?.insertText("hello there", completionHandler: nil)
currentConversation?.insertText(value, completionHandler: nil)
}else{
print("No active conversation")
}
}
Returns "No active conversation"