Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var xmppStream: XMPPStream?
- @IBAction func login () {
- setField(username, forKey: kXMPP.myJID)
- setField(password, forKey: kXMPP.myPassword)
- if let status = xmppStream!.authenticateWithPassword(password.text){
- print("authentication successful")
- } else{
- print("authentication failed")
- }
- do
- {
- //since you may call this more than once; re-name xstream
- //to something else such as, for example, status
- _ = try xmppStream!.authenticateWithPassword(password.text)
- print("authentication successful")
- }
- catch let error as NSError
- {
- print(error)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement