Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. @IBOutlet weak var username: UITextField! <-Cannot assign value
  2. @IBOutlet weak var password: UITextField! <-Cannot assign value
  3.  
  4. let publicDatabase = CKContainer.default().publicCloudDatabase
  5.  
  6. override func viewDidLoad(){
  7. super.viewDidLoad()
  8. }
  9.  
  10. @IBAction func LoginTapped(sender: AnyObject){
  11.  
  12. var recordType = CKRecord(recordType: "Login")
  13.  
  14. recordType["username"] = username.text
  15. recordType["password"] = password.text
  16.  
  17. publicDatabase.save(recordType) {
  18. (record, error) in
  19.  
  20. if error == nil {
  21.  
  22. print("Created Successfully")
  23.  
  24. }
  25.  
  26. else {
  27.  
  28. print(error?.localizedDescription)
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement