2014-11-11 6 views
0

저는 IOS 세계에 처음 왔습니다. 로그인 할 때만 표시되는 새보기로 전환 할 때보기를 변경하는 데 문제가 있습니다. loginfuction 내부에서 사용하고 있습니다.탐색 ios 8 신속한?

@IBAction func loginVerification(sender: UIButton!) { 
     //Check with the cloud 
     //temporary faking credentials 

     var user = "n" 
     var pass = "n" 

     if usernameLogin.text == user && 
      passwordLogin.text == pass 
     { 
      println("Correct credentials") 
      let homeviewcontroller = HomeViewController() 

      self.presentViewController(homeviewcontroller, animated: true, completion: nil) 


     } 
     else 
     { 
      println("Wrong credentials!!") 
     } 
} 

위의 기능은 자격 증명을 확인하는 로그인 버튼을 누르면 트리거됩니다. 위의 행을 사용하면보기가 검은 색이됩니다. 어떻게 작동 시키는가에 대한 제안? 뷰 간의 탐색에 따라 수행 할 수있는 자습서가 있습니까? 제발 열심히하지 마세요 :)

미리 감사드립니다!

+0

당신은 UINavigationController에 대해 들어 본 적이 : –

답변

0

안녕하세요, 저는 Apple 자습서를 사용해 보겠습니다. 그들은 꽤 잘 작성되었으며 코드 샘플을 가지고 있습니다. 여기 제가 학습 할 때 사용했던 것이 있습니다 : https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html. 이것은 특히 스토리 보드 및 뒤범벅을 사용하여 탐색하는 방법입니다. 페이지 왼쪽을 보면 시작할 때 도움이 될 수있는 다른 자습서 링크가 표시됩니다.

let controller: homeviewcontroller = self.storyboard?.instantiateViewControllerWithIdentifier("homeviewcontroller") as! homeviewcontroller 
      self.presentViewController(controller, animated: true, completion: nil) 

     @IBAction func loginVerification(sender: UIButton!) { 
     //Check with the cloud 
     //temporary faking credentials 

     var user = "n" 
     var pass = "n" 

     if usernameLogin.text == user && 
      passwordLogin.text == pass 
     { 
      println("Correct credentials") 

let controller: homeviewcontroller = self.storyboard?.instantiateViewControllerWithIdentifier("homeviewcontroller") as! homeviewcontroller 
      self.presentViewController(controller, animated: true, completion: nil) 
     } 
     else 
     { 
      println("Wrong credentials!!") 
     } 
} 
+0

고마워요! –

0

다음 코드를 시도? [http://raywenderlich.com] (http://raywenderlich.com)에서 많은 훌륭한 자습서를 찾아보십시오.