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
sudo gem install cocoapods |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
var loginAlertController = UIAlertController(title: "로그인", message: nil, preferredStyle: UIAlertControllerStyle.Alert); | |
loginAlertController.addTextFieldWithConfigurationHandler({ (textField) -> Void in | |
textField.placeholder = "아이디"; | |
}) | |
loginAlertController.addTextFieldWithConfigurationHandler({ (textField) -> Void in | |
textField.placeholder = "비밀번호"; | |
textField.secureTextEntry = true; |
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
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
var loginAlertController = UIAlertController(title: "로그인", message: nil, preferredStyle: UIAlertControllerStyle.Alert); | |
loginAlertController.addTextFieldWithConfigurationHandler({ (textField) -> Void in | |
textField.placeholder = "아이디"; | |
}) | |
loginAlertController.addTextFieldWithConfigurationHandler({ (textField) -> Void in | |
textField.placeholder = "비밀번호"; | |
textField.secureTextEntry = true; |
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
func login(#username: String, password: String) { | |
println("로그인 시작: \(username)"); | |
var manager = AFHTTPRequestOperationManager(); | |
var params: [String: AnyObject] = ["id": username, "pass": password, "auto": false]; | |
manager.POST("https://www.ssodam.com/loginCheck", parameters: params, success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) -> Void in | |
println("response Object: \(responseObject)"); |
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
loginAlertController.addAction(UIAlertAction(title: "로그인", style: UIAlertActionStyle.Default, handler: { (alertAction) -> Void in | |
if let textFields = loginAlertController.textFields as? [UITextField] { | |
var username = textFields[0].text; | |
var password = textFields[1].text; | |
self.login(username: username, password: password); | |
} | |
})) |
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
func loginSuccess() { | |
var request = NSURLRequest(URL: NSURL(string: "https://www.ssodam.com")!) | |
webView.loadRequest(request) | |
} |
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
func login(#username: String, password: String) { | |
println("로그인 시작: \(username)"); | |
var manager = AFHTTPRequestOperationManager(); | |
var params: [String: AnyObject] = ["id": username, "pass": password, "auto": false]; | |
manager.POST("https://www.ssodam.com/loginCheck", parameters: params, success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) -> Void in | |
println("response Object: \(responseObject)"); |
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
@IBAction func logoutClicked(sender: UIBarButtonItem) { | |
webView.stringByEvaluatingJavaScriptFromString("location.href=\"/logout\""); | |
} |
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 urllib | |
fp = urllib.urlopen('https://www.acmicpc.net/ranklist') | |
source = fp.read() | |
fp.close() | |
print source |
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 urllib | |
from bs4 import BeautifulSoup | |
fp = urllib.urlopen('https://www.acmicpc.net/ranklist') | |
source = fp.read() | |
fp.close() | |
soup = BeautifulSoup(source) |
OlderNewer