Reputation: 228
index.swift
func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
print("Receive")
let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
let goController = mainStoryboard.instantiateViewController(withIdentifier: "call") as! call
self.present(goController, animated: true)
}
If I'm in index.swift
and I receive session, print Receive
for me and go to call.swift
.
But if after load index.swift
I go to page.swift
, if receive session, print Receive
but don't go to call.swift
and stay on page.swift
.
I want if I'm anywhere after present
, go to call.swift
Upvotes: 0
Views: 2956
Reputation: 1179
Open your first Storyboard and create a Storyboard Reference
Enter the name of your second Storyboard in the "Storyboard" property and the Reference ID of the destination ViewController in the "Reference ID" property of your newly crated reference. (Reference ID is equivalent to Storyboard ID of the destination ViewController)
Create a segue from your source ViewController to the newly created Storyboard Reference. Make sure the segue has an Identifier.
In your code perform the segue like this
.
func didReceiveNewSession(_ session: QBRTCSession, userInfo: [String : String]? = nil) {
print("Receive")
self.performSegue(withIdentifier: "mySegue", sender: self)
}
Credits to https://stackoverflow.com/a/33753164/7990095
Upvotes: 2