大佬教程收集整理的这篇文章主要介绍了ios – 无法将值类型’TableViewController.Type’转换为预期的参数类型’UIViewController’,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我收到错误的行:
func logInViewController(logInController: PFLogInViewController,didLogInUser user: PFUser) { self.dismissviewControllerAnimated(true,completion: nil) self.presentViewController(TimelineTableViewController,animated: true,completion: nil) }
这是整个代码:
// Created by Ojas Sethi on 12/10/15. // Copyright © 2015 jell Apps. All rights reserved. // import UIKit import Parse import ParseUI class LoginSignupViewController: UIViewController,PFLogInViewControllerDelegate,PFSignUpViewControllerDelegate { var logInViewController: PFLogInViewController = PFLogInViewController() var signUpViewController: PFSignUpViewController = PFSignUpViewController() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) if (PFUser.currentUser() == nil){ self.logInViewController.fields = PFLogInFields.usernameAndpassword self.logInViewController.fields = PFLogInFields.LogInButton self.logInViewController.fields = PFLogInFields.SignUpButton self.logInViewController.fields = PFLogInFields.passwordForgotten self.logInViewController.fields = PFLogInFields.DismissButton /*| PFLogInFields.LogInButton | PFLogInFields.SignUpButton | PFLogInFields.passwordForgotten | PFLogInFields.DismissButton*/ let @L_696_8@In@L_696_8@title = UILabel() @L_696_8@In@L_696_8@title.text = "Ziffer" @L_696_8@In@L_696_8@title.font = UIFont.systemFontOfSize(25) self.logInViewController.logInView?.@L_696_8@ = @L_696_8@In@L_696_8@title self.logInViewController.delegate = self let signUp@L_696_8@title = UILabel() signUp@L_696_8@title.text = "Ziffer" @L_696_8@In@L_696_8@title.font = UIFont.systemFontOfSize(25) self.signUpViewController.signUpView?.@L_696_8@ = signUp@L_696_8@title self.signUpViewController.delegate = self self.logInViewController.signUpController = self.signUpViewController } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func logInViewController(logInController: PFLogInViewController,shouldBeginLogInWithUsername username: String,password: String) -> Bool { if (!username.isEmpty || !password.isEmpty){ return true }else{ return false } } func logInViewController(logInController: PFLogInViewController,didLogInUser user: PFUser) { self.dismissviewControllerAnimated(true,completion: nil) self.presentViewController(TimelineTableViewController,completion: nil) } func logInViewController(logInController: PFLogInViewController,didFailToLogInWithError error: NSError?) { print("Failed to login") } func signUpViewController(signUpController: PFSignUpViewController,didSignUpUser user: PFUser) { self.dismissviewControllerAnimated(true,completion: nil) self.presentViewController(logInViewController,completion: nil) SignUpsuccessfulAlert() } func signUpViewController(signUpController: PFSignUpViewController,didFailToSignUpWithError error: NSError?) { print("Failed to signup...") SignUpfalieDalert() } func signUpViewControllerDidCancelSignUp(signUpController: PFSignUpViewController) { print("User dismissed sign up.") } func SignUpsuccessfulAlert(){ var alertController : UIAlertController alertController = UIAlertController(title: "Sign Up successful",message: "Yay! Sign up was successful! Now you can start using Ziffer!",preferredStyle: .Alert) let doneAction = UIAlertAction(title: "Ok",style: .Default,handler: nil) alertController.addAction(doneAction) self.presentViewController(alertController,completion: nil) } func SignUpfalieDalert(){ var signUpalertFail : UIAlertController signUpalertFail = UIAlertController(title: "Failed",message: "Sorry! Sign up faield. check the connections and try again later",preferredStyle: .Alert) let okAction = UIAlertAction(title: "Ok",handler: nil) signUpalertFail.addAction(okAction) self.presentViewController(signUpalertFail,completion: nil) } }
以上是大佬教程为你收集整理的ios – 无法将值类型’TableViewController.Type’转换为预期的参数类型’UIViewController’全部内容,希望文章能够帮你解决ios – 无法将值类型’TableViewController.Type’转换为预期的参数类型’UIViewController’所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。