ios - 如何使用 Swift 将注册页面添加到我的 Parse 应用程序中?

标签 ios swift parse-platform

有人知道如何让用户在 Swift Xcode 6.4 中使用 parse 进行注册吗? 我已经搜索了所有内容,但找不到一个有效的。

我尝试了这段代码,但没有成功。

它说:

Use of unresolved identifier PFUser

import UIKit

class SignupViewController: UIViewController {

@IBOutlet var usernameTextField: UITextField!
@IBOutlet var passwordTextField: UITextField!
@IBOutlet var emailTextField: UITextField!
@IBOutlet var messageLabel: UILabel!

@IBAction func loginVerifyButton(sender: AnyObject) {
    var usrEntered = usernameTextField.text
    var pwdEntered = passwordTextField.text
    var emlEntered = emailTextField.text
    if usrEntered != "" && pwdEntered != "" && emlEntered != "" {
        // If not empty then yay, do something
    } else {
        WrongInfo()
    }
}
func userSignUp() {
    var user = PFUser()
    user.username = usrEntered
    user.password = pwdEntered
    user.email = emlEntered
}



override func viewDidLoad() {
    super.viewDidLoad()

    // Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}


/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
}
*/

func WrongInfo(){
    var WrongInfo:UIAlertView = UIAlertView(title: "ALL FEILDS REQUIRED", message: "Please use all feilds!", delegate: self, cancelButtonTitle: "ok")
}
}

最佳答案

您需要在 Appdelegate.swift 文件中导入 Parse !如果仍然遇到相同的错误,请在注册 View Controller 中导入 Parse

关于ios - 如何使用 Swift 将注册页面添加到我的 Parse 应用程序中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32144488/

相关文章:

swift - 如何使用 Swift 在 mapkit 上更改未选择的注释图钉图像

swift - 快速从音频文件中删除音频 channel

ios - 渐变不覆盖 iphone plus 设备上的图像 ios swift 3

ios - UIKit Dynamics 通过碰撞更改 View 框架

ios - Objective-C和外部整数方法

ios - WKWebView 委托(delegate)问题(使用 Swift 的 Xcode 7.3)

android - 使用 Parse.Com 创建 SDK/API

ios - 如何在子类中设置只读属性?

javascript - 根据指针字段值过滤解析查询

ios - NSLocalizedString 返回我给它的第一个参数?