SHARE
TWEET

Untitled

a guest Oct 19th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4.    
  5.     var isBlue = true
  6.     @IBOutlet weak var greenView: UIView!
  7.     @IBOutlet weak var blueView: UIView!
  8.    
  9.    
  10.     override func viewDidLoad() {
  11.         super.viewDidLoad()
  12. }
  13.    
  14.     @IBAction func changeBackgroundColorOnTapped(_ sender: Any) {
  15.  // var aquaColor = blueView.backgroundColor
  16.        
  17.         if isBlue == true {
  18.         blueView.backgroundColor = greenView.backgroundColor
  19.         } else {
  20.         blueView.backgroundColor = UIColor(red: 0/255.0, green: 128/255.0, blue: 255/255.0, alpha: 1)}
  21.         isBlue = !isBlue
  22. }
  23.    
  24.     @IBAction func panGest(_ sender: UIGestureRecognizer) {
  25.         let point = sender.location(in: view)
  26.         greenView.center = CGPoint(x: point.x, y: point.y)
  27. }
  28.  
  29. }
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