Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class ViewController: UIViewController {
- var isBlue = true
- @IBOutlet var blueView: UIView!
- @IBOutlet var GreenView: UIView!
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- @IBAction func changeBackgroud(_ sender: Any) {
- //let aquaColor = blueView.backgroudColor
- if isBlue == true {
- blueView.backgroundColor = GreenView.backgroundColor
- }
- else { blueView.backgroundColor = UIColor(displayP3Red: 0/255, green: 128/255.0, blue: 255/255.0, alpha: 1)
- }
- isBlue = !isBlue
- }
- @IBAction func didBeginPanGesture(_ sender: UIPanGestureRecognizer) {
- let poin = sender.location(in: view)
- GreenView.center = CGPoint(x: poin.x,y: poin.y)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement