Browse between screens - Swift IOS

607 views ios

I have a question in navigation between screen in ios because I am new in this part, in android there is the "intent" that makes it easy to navigate between but in which function should I use to navigate between the screens programmatically, example I have the seguiten if:

class ViewController: UIViewController, WKNavigationDelegate{

@IBOutlet weak var webView: WKWebView!
var reachability:Reachability?
override func viewDidLoad() {
    webView.navigationDelegate = self

    self.reachability = Reachability.init()

    if ((self.reachability!.connection) != .none)
        let url = URL(string: "")
        let request = URLRequest(url: url!)
        print ("Conectado")

    } else {


And the following screens: imagem

I need it when it returns "else" the application goes to the offline screen, In android I use the "intent" but and in IOS?

answered question

1 Answer


You can try , give offline VC an identifier in IB and load it like this

let offline = storyBoard?.instantiateViewController(withIdentifier: "offline") as! OfflineVC

posted this

Have an answer?


Please login first before posting an answer.