How to set default login details [closed]












-9















Suppose I have login details Username: Kanu password 123456 and I want that nobody will able to log in without these login details means all other xyz login details will show alert "enter correct login details"



I Need To save it locally..There is no use of server










share|improve this question















closed as unclear what you're asking by Gereon, Moritz, gnat, Cristik, mpromonet Nov 13 '18 at 22:40


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

    – rptwsthi
    Nov 13 '18 at 12:04











  • Hey..I've just updated my post..I hope now I'm clear

    – kanu
    Nov 13 '18 at 12:07











  • Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

    – rptwsthi
    Nov 13 '18 at 12:10











  • Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

    – kanu
    Nov 13 '18 at 12:13











  • As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

    – Aakash
    Nov 13 '18 at 12:13


















-9















Suppose I have login details Username: Kanu password 123456 and I want that nobody will able to log in without these login details means all other xyz login details will show alert "enter correct login details"



I Need To save it locally..There is no use of server










share|improve this question















closed as unclear what you're asking by Gereon, Moritz, gnat, Cristik, mpromonet Nov 13 '18 at 22:40


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

    – rptwsthi
    Nov 13 '18 at 12:04











  • Hey..I've just updated my post..I hope now I'm clear

    – kanu
    Nov 13 '18 at 12:07











  • Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

    – rptwsthi
    Nov 13 '18 at 12:10











  • Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

    – kanu
    Nov 13 '18 at 12:13











  • As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

    – Aakash
    Nov 13 '18 at 12:13
















-9












-9








-9








Suppose I have login details Username: Kanu password 123456 and I want that nobody will able to log in without these login details means all other xyz login details will show alert "enter correct login details"



I Need To save it locally..There is no use of server










share|improve this question
















Suppose I have login details Username: Kanu password 123456 and I want that nobody will able to log in without these login details means all other xyz login details will show alert "enter correct login details"



I Need To save it locally..There is no use of server







ios swift






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 12:40







kanu

















asked Nov 13 '18 at 12:01









kanukanu

34




34




closed as unclear what you're asking by Gereon, Moritz, gnat, Cristik, mpromonet Nov 13 '18 at 22:40


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Gereon, Moritz, gnat, Cristik, mpromonet Nov 13 '18 at 22:40


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

    – rptwsthi
    Nov 13 '18 at 12:04











  • Hey..I've just updated my post..I hope now I'm clear

    – kanu
    Nov 13 '18 at 12:07











  • Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

    – rptwsthi
    Nov 13 '18 at 12:10











  • Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

    – kanu
    Nov 13 '18 at 12:13











  • As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

    – Aakash
    Nov 13 '18 at 12:13





















  • Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

    – rptwsthi
    Nov 13 '18 at 12:04











  • Hey..I've just updated my post..I hope now I'm clear

    – kanu
    Nov 13 '18 at 12:07











  • Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

    – rptwsthi
    Nov 13 '18 at 12:10











  • Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

    – kanu
    Nov 13 '18 at 12:13











  • As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

    – Aakash
    Nov 13 '18 at 12:13



















Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

– rptwsthi
Nov 13 '18 at 12:04





Kanu, your question is confusing. If you want to set login on server then those credential will be store when user register. And if you just want to set a pass-code locally then you will have to ask user to set pass-code and confirm on first launch. Please clarify more so I can make an specific answer.

– rptwsthi
Nov 13 '18 at 12:04













Hey..I've just updated my post..I hope now I'm clear

– kanu
Nov 13 '18 at 12:07





Hey..I've just updated my post..I hope now I'm clear

– kanu
Nov 13 '18 at 12:07













Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

– rptwsthi
Nov 13 '18 at 12:10





Still you have not provided the details that I need to understand your problem. Please elaborate what you actually want to achieve. What are you developing and how authentication is going to help. As I already said, if it's application which involves server you need to communicate with server using web-services and apply a complete procedure, else have user set credential on first launch ans store those on user default.

– rptwsthi
Nov 13 '18 at 12:10













Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

– kanu
Nov 13 '18 at 12:13





Ok..I'll try to save my login details in user default...I have to save it locally..there is need of server n all

– kanu
Nov 13 '18 at 12:13













As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

– Aakash
Nov 13 '18 at 12:13







As far as I am getting you want your app to have static login username and password as of now and want the users to proceed only if they have enter that static login details. If I am correct then you can directly test the user input and proceed if valid details are entered.

– Aakash
Nov 13 '18 at 12:13














1 Answer
1






active

oldest

votes


















1














If your required credentials are static, you can simply check for them in code:



func canLogin() -> Bool { 
return userNameTF.text == "Kanu" && passwordTF.text == "123456"
}


Then, you could do:



func login() {
guard canLogin() else {
let alert = UIAlertController(title: "Wrong credentials", message: "The login credentials you have provided are incorrect.", preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Okay", style: .default))
self.present(alert, animated: true, completion: nil)
return
}
// begin login process here
}


If a user entered a username other than Kanu or a password that is not 123456, they will be shown an alert saying that their login credentials are incorrect.






share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    If your required credentials are static, you can simply check for them in code:



    func canLogin() -> Bool { 
    return userNameTF.text == "Kanu" && passwordTF.text == "123456"
    }


    Then, you could do:



    func login() {
    guard canLogin() else {
    let alert = UIAlertController(title: "Wrong credentials", message: "The login credentials you have provided are incorrect.", preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Okay", style: .default))
    self.present(alert, animated: true, completion: nil)
    return
    }
    // begin login process here
    }


    If a user entered a username other than Kanu or a password that is not 123456, they will be shown an alert saying that their login credentials are incorrect.






    share|improve this answer




























      1














      If your required credentials are static, you can simply check for them in code:



      func canLogin() -> Bool { 
      return userNameTF.text == "Kanu" && passwordTF.text == "123456"
      }


      Then, you could do:



      func login() {
      guard canLogin() else {
      let alert = UIAlertController(title: "Wrong credentials", message: "The login credentials you have provided are incorrect.", preferredStyle: .alert)
      alert.addAction(UIAlertAction(title: "Okay", style: .default))
      self.present(alert, animated: true, completion: nil)
      return
      }
      // begin login process here
      }


      If a user entered a username other than Kanu or a password that is not 123456, they will be shown an alert saying that their login credentials are incorrect.






      share|improve this answer


























        1












        1








        1







        If your required credentials are static, you can simply check for them in code:



        func canLogin() -> Bool { 
        return userNameTF.text == "Kanu" && passwordTF.text == "123456"
        }


        Then, you could do:



        func login() {
        guard canLogin() else {
        let alert = UIAlertController(title: "Wrong credentials", message: "The login credentials you have provided are incorrect.", preferredStyle: .alert)
        alert.addAction(UIAlertAction(title: "Okay", style: .default))
        self.present(alert, animated: true, completion: nil)
        return
        }
        // begin login process here
        }


        If a user entered a username other than Kanu or a password that is not 123456, they will be shown an alert saying that their login credentials are incorrect.






        share|improve this answer













        If your required credentials are static, you can simply check for them in code:



        func canLogin() -> Bool { 
        return userNameTF.text == "Kanu" && passwordTF.text == "123456"
        }


        Then, you could do:



        func login() {
        guard canLogin() else {
        let alert = UIAlertController(title: "Wrong credentials", message: "The login credentials you have provided are incorrect.", preferredStyle: .alert)
        alert.addAction(UIAlertAction(title: "Okay", style: .default))
        self.present(alert, animated: true, completion: nil)
        return
        }
        // begin login process here
        }


        If a user entered a username other than Kanu or a password that is not 123456, they will be shown an alert saying that their login credentials are incorrect.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 13 '18 at 12:19









        LinusGeffarthLinusGeffarth

        8,631145298




        8,631145298















            Popular posts from this blog

            The Sandy Post

            Danny Elfman

            Pages that link to "Head v. Amoskeag Manufacturing Co."