Created
May 22, 2017 08:44
-
-
Save TechMaster/ebcbdc03b99b5bd107ef0b09f96f4ef5 to your computer and use it in GitHub Desktop.
Animation.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| self.addBar() | |
| } | |
| func addBar() { | |
| let bar = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) | |
| bar.backgroundColor = UIColor.red | |
| self.view.addSubview(bar) | |
| UIView.animate(withDuration: 10, animations: { | |
| bar.transform = CGAffineTransform(scaleX: 5.0, y: 1.0) | |
| }) { (complete) in | |
| UIView.animate(withDuration: 10, animations: { | |
| bar.transform = CGAffineTransform(scaleX: 1.0, y: 1.0) | |
| }, completion: { (complete) in | |
| }) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment