SHARE
TWEET

Untitled

a guest May 21st, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   override func viewDidLoad() {
  2.         super.viewDidLoad()
  3.         view.backgroundColor = .white
  4.         let button = UIButton(type: .system)
  5.         button.setTitle("Button", for: .normal)
  6.        
  7.         button.addTarget(self,
  8.                          action: #selector(didAuthorize),
  9.                          for: .touchUpInside)
  10.         button.centerYAnchor.constraint(equalTo: view.centerYAnchor)
  11.         NSLayoutConstraint.activate([
  12.             button.centerXAnchor.constraint(equalTo: view.centerXAnchor),
  13.             button.centerYAnchor.constraint(equalTo: view.centerYAnchor)
  14.             ])
  15.  
  16.     }
  17.    
  18.     @objc
  19.     private func didAuthorize() {
  20.         socialService.authorize {
  21.             self.socialService.getFriends { response in
  22.                 //P
  23.                 switch response {
  24.                 case let .success(friends):
  25.                     print(friends)
  26.                 case let .failure(error):
  27.                     print(error)
  28.                 }
  29.             }
  30.             print($0)
  31.         }
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top