im kind of new and have an idea but don't know how to create it

so i want this feature in my app where if user press Beta Access it will bring thrm to a viewcontroller saying you need to enter a user name and password. This username and password is stored in the app itself and there is only 1. If the username and password is correct , it will go to the another viewcontroller where features that havent been released yet are at. any tutorials out there or how can i do this?

Update.

Added this

if username.text == username && password.text == password {
          
            self.performSegue(withIdentifier: "logInPageToBetaAccessViewController", sender: self)
          
        } else {
            print("Access Denied")
            self.performSegue(withIdentifier: "logInPageToViewControllerWithoutBetaAccess", sender: self)
        }

and with

if username.text == username && password.text == password {

its throwing me this : Value of type 'String' has no member 'text'

I would change the name of the variable to something different then you won't get it confused with the text input. Your getting that error because your telling it to read the variable, not the text input.

Ive changed the variables for Username to : User and Password to : Pass


if user.text == Username && pass.text == Password {


then it comes up with an error leading to


if user.text == Username && pass.text == Password {

with it underlining u in user.text


this is the error "Value of type 'String' has no member 'text'"

I think youve got it mixed up. Is the input still called Username because if so it should be Username.text == user

okay i think i fixed that.. What about my questions with the segues?

Have you got your segues setup in the main.storyboard?

Tell me what im doing wrong with this code please!

if username.text == User && password.text == Pass

cas its coming up with


Use of unresolved identifier 'username'

Use of unresolved identifier 'User'

Use of unresolved identifier 'password'

Use of unresolved identifier 'Pass'

Can you post a screenshot?

https://imgur.com/a/5yEhS

There

this is the code you said to do

    let userCODE = "Beta"
    let passCODE = "pass"


    @IBOutlet weak var webView: WKWebView!

    @IBOutlet weak var Username: UITextField!

    @IBOutlet weak var Password: UITextField!

    @IBAction func Login(_ sender: UIButton) {
        if Username == username && Password == password {
      
            self.performSegue(withIdentifier: "logInPageToBetaAccessViewController", sender: self)
      
        } else {
            print("Access Denied")
            self.performSegue(withIdentifier: "logInPageToViewControllerWithoutBetaAccess", sender: self)
        }
    }

errors :

Use of unresolved identifier 'username'

Did you mean 'Username'?

Use of unresolved identifier 'password'

Did you mean 'Password'?

Did you mean 'passwd'? (Darwin.passwd)

Oh Ok, make sure that Username and Password start with a capital letter. Since youve changed the name of the variables they need to say;


If Username.text == userCODE

If Password.text == passCODE

Added this

@IBAction func Login(_ sender: UIButton) {
        if((Username.text?.contains("BetaAccess"))! && (Password.text?.contains("Password"))!)

Then if thats true ^^^ How do i make it segue to the locked area? Also when i run this and press login it gives me

Thread 1 : Signal SIGABRT

h ttps://stackoverflow.com/questions/25375409/how-to-switch-view-controllers-in-swift

Did that work? If not control-drag from the yellow dot above the view controller to the beta access page then if the login is successful write


self.performSegue(withIdentifier: "SegueName", sender: self)

im kind of new and have an idea but don't know how to create it
 
 
Q