Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
16 changes: 14 additions & 2 deletions UIAnimation.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
1EF3C977229C59ED005A5B40 /* BronzeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EF3C976229C59ED005A5B40 /* BronzeViewController.swift */; };
1EF3C979229C7663005A5B40 /* SilverViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EF3C978229C7663005A5B40 /* SilverViewController.swift */; };
1EF3C97B229C7FD4005A5B40 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EF3C97A229C7FD4005A5B40 /* LoginViewController.swift */; };
778CE9D2229BF77300F5483E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 778CE9D1229BF77300F5483E /* AppDelegate.swift */; };
778CE9D4229BF77300F5483E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 778CE9D3229BF77300F5483E /* ViewController.swift */; };
778CE9D7229BF77300F5483E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 778CE9D5229BF77300F5483E /* Main.storyboard */; };
Expand All @@ -15,6 +18,9 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
1EF3C976229C59ED005A5B40 /* BronzeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BronzeViewController.swift; sourceTree = "<group>"; };
1EF3C978229C7663005A5B40 /* SilverViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SilverViewController.swift; sourceTree = "<group>"; };
1EF3C97A229C7FD4005A5B40 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
778CE9CE229BF77300F5483E /* UIAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; };
778CE9D1229BF77300F5483E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
778CE9D3229BF77300F5483E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -56,6 +62,9 @@
children = (
778CE9D1229BF77300F5483E /* AppDelegate.swift */,
778CE9D3229BF77300F5483E /* ViewController.swift */,
1EF3C976229C59ED005A5B40 /* BronzeViewController.swift */,
1EF3C978229C7663005A5B40 /* SilverViewController.swift */,
1EF3C97A229C7FD4005A5B40 /* LoginViewController.swift */,
778CE9D5229BF77300F5483E /* Main.storyboard */,
778CE9D8229BF77600F5483E /* Assets.xcassets */,
778CE9DA229BF77600F5483E /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -135,7 +144,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1EF3C977229C59ED005A5B40 /* BronzeViewController.swift in Sources */,
1EF3C979229C7663005A5B40 /* SilverViewController.swift in Sources */,
778CE9D4229BF77300F5483E /* ViewController.swift in Sources */,
1EF3C97B229C7FD4005A5B40 /* LoginViewController.swift in Sources */,
778CE9D2229BF77300F5483E /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -283,7 +295,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = PV6ZXMXKDK;
DEVELOPMENT_TEAM = X54K5PJVGU;
INFOPLIST_FILE = "$(SRCROOT)/UIAnimation/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -301,7 +313,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = PV6ZXMXKDK;
DEVELOPMENT_TEAM = X54K5PJVGU;
INFOPLIST_FILE = "$(SRCROOT)/UIAnimation/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Empty file.
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>UIAnimation.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Empty file.
Empty file modified UIAnimation/AppDelegate.swift
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/AppIcon.appiconset/icon-iPad20.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/AppIcon.appiconset/icon-iPad29.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/AppIcon.appiconset/icon-iPad40.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/AppIcon.appiconset/icon-iPad76.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/icon1.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/icon1.imageset/icon1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon1.imageset/icon1@2x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon1.imageset/icon1@3x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon2.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/icon2.imageset/icon2@1x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon2.imageset/icon2@2x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon2.imageset/icon2@3x.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon3.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/icon3.imageset/icon3.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified UIAnimation/Assets.xcassets/icon3.imageset/icon3@2x.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/icon3.imageset/icon3@3x.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/icon4.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/icon4.imageset/icon4@1x.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/icon4.imageset/icon4@2x.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/icon4.imageset/icon4@3x.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/rocket.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/rocket.imageset/rocket.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/rocket2.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/rocket2.imageset/rocket2.png
100644 → 100755
Empty file modified UIAnimation/Assets.xcassets/world1.imageset/Contents.json
100644 → 100755
Empty file.
Empty file modified UIAnimation/Assets.xcassets/world1.imageset/world1.png
100644 → 100755
Empty file modified UIAnimation/Base.lproj/LaunchScreen.storyboard
100644 → 100755
Empty file.
170 changes: 161 additions & 9 deletions UIAnimation/Base.lproj/Main.storyboard
100644 → 100755

Large diffs are not rendered by default.

98 changes: 98 additions & 0 deletions UIAnimation/BronzeViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
//
// BronzeViewController.swift
// UIAnimation
//
// Created by Paula Leite on 27/05/19.
// Copyright © 2019 Pedro Cacique. All rights reserved.
//

import UIKit

class BronzeViewController: UIViewController {


@IBOutlet weak var rocketBronze: UIImageView!
@IBOutlet weak var worldBronze: UIImageView!

let backgroudColors: [UIColor] = [#colorLiteral(red: 0.2631746531, green: 0.3594709039, blue: 0.4427573681, alpha: 1), #colorLiteral(red: 0.187418063, green: 0.2592587816, blue: 0.319437258, alpha: 1)]

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
}

// Depois que aparecer
override func viewDidAppear(_ animated: Bool) {

UIView.animate(withDuration: 5.0, delay: 0, options: [.curveEaseOut], animations: {

// Alteracoes das coisas setadas anteriormente
self.rocketBronze.image = UIImage(named: "rocket.png")
self.rocketBronze.center.y = -self.rocketBronze.frame.height
self.rocketBronze.layer.zPosition = 100

})

let myPath = UIBezierPath()
//myPath.move(to: CGPoint(x: rocketBronze.center.y + rocketBronze.frame.height/2, y: rocketBronze.center.x))
myPath.move(to: CGPoint(x: self.view.center.x, y: worldBronze.center.y))
myPath.addLine(to: CGPoint(x: rocketBronze.center.x, y: worldBronze.center.y - rocketBronze.frame.height/2 - 900))

let myShapeLayer = CAShapeLayer()
myShapeLayer.strokeColor = #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
myShapeLayer.lineWidth = 2
myShapeLayer.path = myPath.cgPath
myShapeLayer.strokeStart = 0.8

let myEndAnimation = CABasicAnimation(keyPath: "strokeEnd")
myEndAnimation.fromValue = 0.2
myEndAnimation.toValue = 1.0

let myStartAnimation = CABasicAnimation(keyPath: "strokeStart")
myStartAnimation.fromValue = 0.0
myStartAnimation.toValue = 0.8

let animationGroup = CAAnimationGroup()
animationGroup.animations = [myStartAnimation, myEndAnimation]
animationGroup.duration = 3.5

myShapeLayer.add(animationGroup, forKey: "drawLine")
self.view.layer.addSublayer(myShapeLayer)

}

// Antes de aparecer
override func viewWillAppear(_ animated: Bool) {

// bounds - conteudo dentro do frame
// frame - escala e posicionamento
// center - movimentacao na tela

self.rocketBronze.center.x = self.view.center.x
self.rocketBronze.frame.size.height = self.view.frame.size.height * 0.3

self.worldBronze.frame.size.width = self.view.frame.size.width
self.worldBronze.center.x = self.view.center.x
self.worldBronze.center.y = self.view.frame.height



}


@IBAction func segmentedColor(_ sender: UISegmentedControl) {
self.view.backgroundColor = backgroudColors[sender.selectedSegmentIndex]
}

/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/

}
Empty file modified UIAnimation/Info.plist
100644 → 100755
Empty file.
33 changes: 33 additions & 0 deletions UIAnimation/LoginViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// LoginViewController.swift
// UIAnimation
//
// Created by Paula Leite on 27/05/19.
// Copyright © 2019 Pedro Cacique. All rights reserved.
//

import UIKit

class LoginViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
}

@IBAction func backButtonClicked(_ sender: Any) {
dismiss(animated: true, completion: nil)
}

/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/

}
94 changes: 94 additions & 0 deletions UIAnimation/SilverViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//
// SilverViewController.swift
// UIAnimation
//
// Created by Paula Leite on 27/05/19.
// Copyright © 2019 Pedro Cacique. All rights reserved.
//

import UIKit

class SilverViewController: UIViewController {


@IBOutlet weak var name: UILabel!
@IBOutlet weak var username: UITextField!
@IBOutlet weak var password: UITextField!
@IBOutlet weak var button: UIButton!
@IBOutlet weak var rocket: UIImageView!
@IBOutlet weak var world: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
}

override func viewDidAppear(_ animated: Bool) {



UIView.animate(withDuration: 0.5) {
self.name.center.x += self.view.bounds.width
self.username.center.x += self.view.bounds.width
self.password.center.x += self.view.bounds.width
}


}

// Antes de aparecer
override func viewWillAppear(_ animated: Bool) {

// bounds - conteudo dentro do frame
// frame - escala e posicionamento
// center - movimentacao na tela

self.rocket.center.x = self.view.center.x
self.rocket.frame.size.height = self.view.frame.size.height * 0.3

self.world.frame.size.width = self.view.frame.size.width
self.world.center.x = self.view.center.x
self.world.center.y = self.view.frame.height

name.center.x -= view.bounds.width
username.center.x -= view.bounds.width
password.center.x -= view.bounds.width

}

@IBAction func login() {
UIView.animate(withDuration: 4.0, delay: 0, options: [.curveEaseOut], animations: {

// Alteracoes das coisas setadas anteriormente
self.rocket.image = UIImage(named: "rocket.png")
self.rocket.center.y = -self.rocket.frame.height

}, completion: { finished in
self.performSegue(withIdentifier: "loginText", sender: self)
})

UIView.animate(withDuration: 0.5) {
self.name.center.x += self.view.bounds.width
self.username.center.x += self.view.bounds.width
self.password.center.x += self.view.bounds.width
self.button.center.x += self.view.bounds.width
}

}





/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/

}
55 changes: 54 additions & 1 deletion UIAnimation/ViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,64 @@

import UIKit

class ViewController: UIViewController {
class ViewController:

UIViewController {

@IBOutlet weak var world: UIImageView!

@IBOutlet weak var rocket: UIImageView!

override func viewDidLoad() {
super.viewDidLoad()



}

// Depois que aparecer
override func viewDidAppear(_ animated: Bool) {

// let circlePath = UIBezierPath(arcCenter: self.world.center, radius: self.world.frame.width, startAngle: 0, endAngle: .pi*2, clockwise: false)
//
// let animation = CAKeyframeAnimation(keyPath: #keyPath(CALayer.position))
//
// animation.duration = 5
// animation.repeatCount = MAXFLOAT
// animation.path = circlePath.cgPath
//
// self.rocket.layer.add(animation, forKey: nil)

// options: .repeat, .autoreverse
// options: .curveEasyIn, .curveEaseOut, .curveEaseInOut

UIView.animate(withDuration: 5.0, delay: 0, options: [.curveEaseOut], animations: {

// Alteracoes das coisas setadas anteriormente
self.rocket.center.y = self.world.center.y - self.world.frame.size.height/2
// self.rocket.transform = self.rocket.transform.rotated(by: CGFloat(Double.pi))

}, completion: { finished in
self.rocket.image = UIImage(named: "rocket2.png")
})
}

// Antes de aparecer
override func viewWillAppear(_ animated: Bool) {

// bounds - conteudo dentro do frame
// frame - escala e posicionamento
// center - movimentacao na tela

self.rocket.center.x = self.view.center.x
self.rocket.frame.size.height = self.view.frame.size.height * 0.3

self.world.frame.size.width = self.view.frame.size.width
self.world.center.x = self.view.center.x
self.world.center.y = self.view.frame.height



}


Expand Down