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.
8 changes: 8 additions & 0 deletions UIAnimation.xcodeproj/project.pbxproj
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
0C5C9D97229C762900729968 /* ViewControllerBronze.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C5C9D96229C762900729968 /* ViewControllerBronze.swift */; };
0C9E14FB229ECD640000F613 /* ViewControllerOuro.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C9E14FA229ECD640000F613 /* ViewControllerOuro.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 +17,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0C5C9D96229C762900729968 /* ViewControllerBronze.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerBronze.swift; sourceTree = "<group>"; };
0C9E14FA229ECD640000F613 /* ViewControllerOuro.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewControllerOuro.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,7 +60,9 @@
children = (
778CE9D1229BF77300F5483E /* AppDelegate.swift */,
778CE9D3229BF77300F5483E /* ViewController.swift */,
0C5C9D96229C762900729968 /* ViewControllerBronze.swift */,
778CE9D5229BF77300F5483E /* Main.storyboard */,
0C9E14FA229ECD640000F613 /* ViewControllerOuro.swift */,
778CE9D8229BF77600F5483E /* Assets.xcassets */,
778CE9DA229BF77600F5483E /* LaunchScreen.storyboard */,
778CE9DD229BF77600F5483E /* Info.plist */,
Expand Down Expand Up @@ -136,7 +142,9 @@
buildActionMask = 2147483647;
files = (
778CE9D4229BF77300F5483E /* ViewController.swift in Sources */,
0C5C9D97229C762900729968 /* ViewControllerBronze.swift in Sources */,
778CE9D2229BF77300F5483E /* AppDelegate.swift in Sources */,
0C9E14FB229ECD640000F613 /* ViewControllerOuro.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Empty file.
Empty file.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "UIAnimation/ViewControllerOuro.swift"
timestampString = "580839637.8429019"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "28"
endingLineNumber = "28"
landmarkName = "ViewControllerOuro"
landmarkType = "3">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
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.
75 changes: 67 additions & 8 deletions UIAnimation/Base.lproj/Main.storyboard
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,44 @@
<!--Bronze-->
<scene sceneID="lHF-dN-ARc">
<objects>
<viewController id="LaB-eW-x7h" sceneMemberID="viewController">
<viewController id="LaB-eW-x7h" customClass="ViewControllerBronze" customModule="UIAnimation" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8N2-mN-kSu">
<rect key="frame" x="0.0" y="0.0" width="414" height="813"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="tQG-yy-tqQ">
<rect key="frame" x="20" y="44" width="374" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Day"/>
<segment title="Night"/>
</segments>
<connections>
<action selector="indexChanged:" destination="LaB-eW-x7h" eventType="valueChanged" id="RiK-4x-HAj"/>
</connections>
</segmentedControl>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="world1" translatesAutoresizingMaskIntoConstraints="NO" id="R0q-yZ-rMF">
<rect key="frame" x="0.0" y="199" width="414" height="414"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="rocket" translatesAutoresizingMaskIntoConstraints="NO" id="MW5-s2-kLZ">
<rect key="frame" x="159" y="342" width="96" height="128"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.28341594338417053" green="0.3596842885017395" blue="0.43530809879302979" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<viewLayoutGuide key="safeArea" id="2nI-w7-VyP"/>
</view>
<tabBarItem key="tabBarItem" title="Bronze" image="icon4" id="VvG-JI-ieX"/>
<connections>
<outlet property="rocket" destination="MW5-s2-kLZ" id="g2i-AV-8VM"/>
<outlet property="segmentedControl" destination="tQG-yy-tqQ" id="6FC-fp-PeC"/>
<outlet property="world" destination="R0q-yZ-rMF" id="1Hv-K9-ncc"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="6ga-1z-lVg" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1372" y="1280"/>
<point key="canvasLocation" x="-1372.4637681159422" y="1279.6875"/>
</scene>
<!--Prata-->
<scene sceneID="bJA-Hh-BCp">
Expand All @@ -45,23 +71,52 @@
<!--Ouro-->
<scene sceneID="VPQ-z8-7lg">
<objects>
<viewController id="Ctb-Ec-WkQ" sceneMemberID="viewController">
<viewController id="Ctb-Ec-WkQ" customClass="ViewControllerOuro" customModule="UIAnimation" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="7op-CT-CGV">
<rect key="frame" x="0.0" y="0.0" width="414" height="813"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6h2-L5-kc6">
<rect key="frame" x="20" y="44" width="374" height="374"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ulo-et-SwR">
<rect key="frame" x="0.0" y="0.0" width="374" height="374"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="openCard:" destination="Ctb-Ec-WkQ" eventType="touchUpInside" id="1Gx-3U-dBb"/>
<action selector="openCard:" destination="xhi-1t-K0p" eventType="touchUpInside" id="KWT-Am-6qk"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="ESSE É UM CARD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ftX-BN-Uk8">
<rect key="frame" x="119" y="177" width="136" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.89610737562179565" green="0.62269532680511475" blue="0.2744118869304657" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</view>
</subviews>
<color key="backgroundColor" red="0.28341594338417053" green="0.3596842885017395" blue="0.43530809879302979" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<viewLayoutGuide key="safeArea" id="jHD-q1-V5e"/>
</view>
<tabBarItem key="tabBarItem" title="Ouro" image="icon2" id="eHD-EZ-fOp"/>
<connections>
<outlet property="card" destination="6h2-L5-kc6" id="PxV-SR-93W"/>
<outlet property="titulo" destination="ftX-BN-Uk8" id="NaA-9s-0qr"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iSG-TD-Ch4" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="xhi-1t-K0p" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="413" y="1280"/>
<point key="canvasLocation" x="411.59420289855075" y="1279.6875"/>
</scene>
<!--Base-->
<scene sceneID="F1L-Fx-mba">
<objects>
<viewController id="ann-cb-b2r" sceneMemberID="viewController">
<viewController id="ann-cb-b2r" customClass="ViewController" customModule="UIAnimation" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="JqL-BI-YnF">
<rect key="frame" x="0.0" y="0.0" width="414" height="813"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -79,6 +134,10 @@
<viewLayoutGuide key="safeArea" id="QYu-IY-owY"/>
</view>
<tabBarItem key="tabBarItem" title="Base" image="icon1" selectedImage="icon1" id="lap-bA-RHR"/>
<connections>
<outlet property="rocket" destination="C1x-nH-jru" id="809-b7-VSP"/>
<outlet property="world" destination="rez-lf-ilS" id="yMP-U7-NSF"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="MIb-nC-bBM" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
Expand All @@ -93,7 +152,7 @@
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" red="0.1764705882352941" green="0.24705882352941178" blue="0.31372549019607843" alpha="0.0" colorSpace="calibratedRGB"/>
<color key="tintColor" red="0.94117647059999998" green="0.94117647059999998" blue="0.94117647059999998" alpha="1" colorSpace="calibratedRGB"/>
<color key="barTintColor" red="0.17254901960784313" green="0.24313725490196078" blue="0.31372549019607843" alpha="1" colorSpace="calibratedRGB"/>
<color key="barTintColor" red="0.17254901960784313" green="0.24313725490196078" blue="0.31372549019607843" alpha="0.5" colorSpace="custom" customColorSpace="calibratedRGB"/>
<color key="selectedImageTintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="image" keyPath="shadowImage"/>
Expand Down
Empty file modified UIAnimation/Info.plist
100644 → 100755
Empty file.
71 changes: 58 additions & 13 deletions UIAnimation/ViewController.swift
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,20 +1,65 @@
//
// ViewController.swift
// UIAnimation_base
//
// Created by Pedro Cacique on 27/05/19.
// Copyright © 2019 Pedro Cacique. All rights reserved.
//
// Animação

import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {
class ViewController: UIViewController
{
// linkando o foguete e o mundo
@IBOutlet weak var rocket: UIImageView!
@IBOutlet weak var world: UIImageView!

override func viewDidLoad()
{
print("viewDidLoad")
super.viewDidLoad()
}


override func viewDidAppear(_ animated: Bool)
{
print("viewDidAppear")
UIView.animate(withDuration: 3.0, delay: 0, options: [.curveEaseInOut], animations:
{
self.rocket.center.y = self.view.frame.height - self.world.frame.height/2

self.rocket.transform = self.rocket.transform.rotated(by: .pi/2)
// self.rocket.transform = self.rocket.transform.scaledBy(x: 2, y: 2)
}, completion: // ação executada após o término da animação
{
finished in
// self.rocket.image = UIImage(named: "rocket2.png")
self.outraAnimacao()
})
}

func outraAnimacao()
{
UIView.animate(withDuration: 3.0, animations:
{
self.rocket.center.x = self.view.frame.width + self.rocket.frame.width/2
})
}


override func viewWillAppear(_ animated: Bool)
{
print("viewWillAppear")
// chamada para arrumar o conteúdo antes de aparecer na tela
// .frame = tamanho

// largura do planeta = largura da view
self.world.frame.size.width = self.view.frame.width

// posiciona o planeta na parte de baixo
self.world.center.y = self.view.frame.height

// altura do foguete = 15% da altura da view
self.rocket.frame.size.height = self.view.frame.height * 0.15

// centralizar no eixo x
self.rocket.center.x = self.view.center.x

// posiciona o foguete na parte de cima da view
self.rocket.center.y = self.rocket.frame.height/2
}


}

Loading