Guest User

Untitled

a guest
Jan 9th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4.  
  5. @IBOutlet weak var button: UIButton!
  6. @IBOutlet weak var label: UILabel!
  7.  
  8. override func viewDidLoad() {
  9. super.viewDidLoad()
  10.  
  11. button.addTarget(self,action:#selector(self.clickRequest(sender:)), for: UIControlEvents.touchUpInside )
  12. }
  13.  
  14. override func didReceiveMemoryWarning() {
  15. super.didReceiveMemoryWarning()
  16. // Dispose of any resources that can be recreated.
  17. }
  18.  
  19. @objc func clickRequest (sender: UIButton) {
  20.  
  21. }
  22.  
  23. }
  24.  
  25. import Foundation
  26. import SwiftHTTP
  27.  
  28. class HTTPService {
  29.  
  30.  
  31.  
  32. }
  33.  
  34. HTTP.GET("https://www.host.com/example",requestSerializer: JSONParameterSerializer()) {
  35. response in
  36. if let err = response.error {
  37. print(err.localizedDescription)
  38. return
  39. }
  40.  
  41.  
  42. } catch let err as NSError {
  43. print(err)
  44. }
  45. }
Add Comment
Please, Sign In to add comment