Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. @IBAction func changeBackgroundColorOnTap(_ sender: Any) {
  2.  
  3. var aquaColor = blueView.backgroundColor
  4.  
  5. if isBlue == true {
  6.  
  7. blueView.backgroundColor = greenView.backgroundColor
  8.  
  9. } else {
  10.  
  11. blueView.backgroundColor = UIColor(red: 0/255.0, green: 128/255.0, blue: 255/255.0, alpha: 1)
  12.  
  13. }
  14. isBlue = !isBlue
  15. }
  16.  
  17. @IBAction func didBeginPanGesture(_ sender: UIPanGestureRecognizer) {
  18.  
  19. let point = sender.location(in: view)
  20.  
  21. greenView.center = CGPoint(x: point.x, y: point.y)
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement