This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var smtpSession = MCOSMTPSession() | |
| smtpSession.hostname = "HOSTNAME" | |
| smtpSession.username = "USERNAME" | |
| smtpSession.password = "PASSWORD" | |
| smtpSession.port = PORT | |
| smtpSession.authType = MCOAuthType.SASLPlain | |
| smtpSession.connectionType = MCOConnectionType.TLS | |
| smtpSession.connectionLogger = {(connectionID, type, data) in | |
| if data != nil { | |
| if let string = NSString(data: data, encoding: NSUTF8StringEncoding){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let session = NSURLSession.sharedSession() | |
| let url = NSURL(string: "http://someurl.com") | |
| let request = NSMutableURLRequest(URL: url!) | |
| request.HTTPMethod = "GET" | |
| let task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -> Void in | |
| if (data != nil) { | |
| let res = response as! NSHTTPURLResponse!; | |
| if 200..<300 ~= res.statusCode { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController, UIWebViewDelegate { | |
| var webView: UIWebView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "type": "UserCollection", | |
| "properties": { | |
| "socialAccount": { | |
| "name": "socialAccount", | |
| "type": "string", | |
| "typeLabel": "string", | |
| "required": false, | |
| "id": "socialAccount", | |
| "order": 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let token = prefs.valueForKey("SESSIONID") as? String | |
| let session = NSURLSession.sharedSession() | |
| let url = NSURL(string: "http://xxxxxxxxxx.com:2403/users/me") | |
| let request = NSMutableURLRequest(URL: url!) | |
| request.HTTPMethod = "GET" | |
| request.setValue( "Bearer \(token!)", forHTTPHeaderField: "Authorization") | |
| let task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -> Void in | |
| if (data != nil) { | |
| let res = response as! NSHTTPURLResponse!; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let prefs:NSUserDefaults = NSUserDefaults.standardUserDefaults() | |
| import UIKit | |
| import Alamofire | |
| class LoginViewController: UIViewController,UITextFieldDelegate { | |
| @IBOutlet var txtUsername : UITextField! | |
| @IBOutlet var txtPassword : UITextField! | |
NewerOlder