Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import UIKit
  2.  
  3.  
  4. class ViewController: UIViewController {
  5.  
  6. var isBlue = true
  7.  
  8. @IBOutlet var blueView: UIView!
  9. @IBOutlet var GreenView: UIView!
  10.  
  11.  
  12. override func viewDidLoad() {
  13. super.viewDidLoad()
  14. // Do any additional setup after loading the view.
  15. }
  16.  
  17. @IBAction func changeBackgroud(_ sender: Any) {
  18. //let aquaColor = blueView.backgroudColor
  19. if isBlue == true {
  20. blueView.backgroundColor = GreenView.backgroundColor
  21. }
  22. else { blueView.backgroundColor = UIColor(displayP3Red: 0/255, green: 128/255.0, blue: 255/255.0, alpha: 1)
  23.  
  24. }
  25. isBlue = !isBlue
  26. }
  27.  
  28. @IBAction func didBeginPanGesture(_ sender: UIPanGestureRecognizer) {
  29. let poin = sender.location(in: view)
  30. GreenView.center = CGPoint(x: poin.x,y: poin.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement