簡體   English   中英

Swift Xcode 在視圖控制器之間切換 - 在視圖控制器之間導航

[英]Swift Xcode Switching between View Controllers - Navigation between View Controllers

我在我的應用程序中使用 Firebase,每次用戶啟動應用程序時 - 我需要檢查此人是否已登錄。如果用戶已登錄 - 我需要打開主視圖 Controller,如果用戶未登錄'未登錄 - 我需要打開登錄視圖 Controller。 如何在我的移動應用程序中實現它?

You can go through the Firebase Documentation, and if you see carefully enough, there is a function to get the current user email ID and the custom ID allocated to the user by FireBase. 如果在您啟動應用程序時(在您的第一個屏幕中)這兩個參數為零,那么您可以執行Segue(xx,yy)。 否則你可以直接 go 到主屏幕。

您可以在您的應用程序中使用 Boolean 用戶默認值來跟蹤用戶之前是否已經登錄。 如果為真,那么您可以導航到主視圖 controller 否則導航到登錄視圖 controller。 您可以在此處此處找到有關用戶默認值的更多詳細信息

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM