├── README.md ├── BahamaAirLoginScreen ├── Images.xcassets │ ├── banner.imageset │ │ ├── banner@2x.png │ │ ├── banner@3x.png │ │ └── Contents.json │ ├── balloon.imageset │ │ ├── balloon@2x.png │ │ ├── balloon@3x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon-Spotlight-40@2x.png │ │ ├── Icon-Spotlight-40@3x.png │ │ └── Contents.json │ ├── bg-sunny.imageset │ │ ├── bg-sunny@2x.png │ │ ├── bg-sunny@3x.png │ │ └── Contents.json │ ├── bg-sunny-cloud-1.imageset │ │ ├── bg-sunny-cloud-1@2x.png │ │ ├── bg-sunny-cloud-1@3x.png │ │ └── Contents.json │ ├── bg-sunny-cloud-2.imageset │ │ ├── bg-sunny-cloud-2@2x.png │ │ ├── bg-sunny-cloud-2@3x.png │ │ └── Contents.json │ ├── bg-sunny-cloud-3.imageset │ │ ├── bg-sunny-cloud-3@2x.png │ │ ├── bg-sunny-cloud-3@3x.png │ │ └── Contents.json │ └── bg-sunny-cloud-4.imageset │ │ ├── bg-sunny-cloud-4@2x.png │ │ ├── bg-sunny-cloud-4@3x.png │ │ └── Contents.json ├── Info.plist ├── AppDelegate.swift ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard └── ViewController.swift ├── BahamaAirLoginScreen.xcodeproj ├── xcuserdata │ ├── marin.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ └── BahamaAirLoginScreen.xcscheme │ └── xlx.xcuserdatad │ │ └── xcschemes │ │ ├── xcschememanagement.plist │ │ └── BahamaAirLoginScreen.xcscheme ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcuserdata │ │ ├── xlx.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ └── marin.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcshareddata │ │ └── BahamaAirLoginScreen.xccheckout └── project.pbxproj └── License.txt /README.md: -------------------------------------------------------------------------------- 1 | # iOS_Animation_Test4 2 | - This are Source Code of a iOS-Animations Tutorials. 3 | - The address of Tutorials:[http://www.jianshu.com/p/232a1b6f1101]. 4 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/banner.imageset/banner@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/banner.imageset/banner@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/banner.imageset/banner@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/banner.imageset/banner@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/balloon.imageset/balloon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/balloon.imageset/balloon@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/balloon.imageset/balloon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/balloon.imageset/balloon@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/xcuserdata/marin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny.imageset/bg-sunny@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny.imageset/bg-sunny@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny.imageset/bg-sunny@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny.imageset/bg-sunny@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-1.imageset/bg-sunny-cloud-1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-1.imageset/bg-sunny-cloud-1@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-1.imageset/bg-sunny-cloud-1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-1.imageset/bg-sunny-cloud-1@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-2.imageset/bg-sunny-cloud-2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-2.imageset/bg-sunny-cloud-2@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-2.imageset/bg-sunny-cloud-2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-2.imageset/bg-sunny-cloud-2@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-3.imageset/bg-sunny-cloud-3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-3.imageset/bg-sunny-cloud-3@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-3.imageset/bg-sunny-cloud-3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-3.imageset/bg-sunny-cloud-3@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-4.imageset/bg-sunny-cloud-4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-4.imageset/bg-sunny-cloud-4@2x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-4.imageset/bg-sunny-cloud-4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-4.imageset/bg-sunny-cloud-4@3x.png -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/project.xcworkspace/xcuserdata/xlx.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen.xcodeproj/project.xcworkspace/xcuserdata/xlx.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/project.xcworkspace/xcuserdata/marin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superxlx/iOS_Animation_Test4/HEAD/BahamaAirLoginScreen.xcodeproj/project.xcworkspace/xcuserdata/marin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/balloon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "balloon@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "balloon@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/banner.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "banner@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "banner@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bg-sunny@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "bg-sunny@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bg-sunny-cloud-1@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "bg-sunny-cloud-1@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bg-sunny-cloud-2@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "bg-sunny-cloud-2@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bg-sunny-cloud-3@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "bg-sunny-cloud-3@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/bg-sunny-cloud-4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bg-sunny-cloud-4@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x", 15 | "filename" : "bg-sunny-cloud-4@3x.png" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/xcuserdata/xlx.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BahamaAirLoginScreen.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9C4319621A0C32D80085829B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/xcuserdata/marin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BahamaAirLoginScreen.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9C4319621A0C32D80085829B 16 | 17 | primary 18 | 19 | 20 | 9C4319771A0C32D90085829B 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Spotlight-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Spotlight-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.razeware.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Razeware LLC 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | import UIKit 24 | 25 | @UIApplicationMain 26 | class AppDelegate: UIResponder, UIApplicationDelegate { 27 | 28 | var window: UIWindow? 29 | 30 | 31 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 32 | // Override point for customization after application launch. 33 | return true 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/project.xcworkspace/xcshareddata/BahamaAirLoginScreen.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 8CF6332E-ACBF-4EE6-BB59-9D919D87437A 9 | IDESourceControlProjectName 10 | BahamaAirLoginScreen 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | D7A50C65861DD45AAB6470339DF3B16433699460 14 | https://bitbucket.org/rw-iAT/chapter-02-getting-started.git 15 | 16 | IDESourceControlProjectPath 17 | BahamaAirLoginScreen.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | D7A50C65861DD45AAB6470339DF3B16433699460 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://bitbucket.org/rw-iAT/chapter-02-getting-started.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | D7A50C65861DD45AAB6470339DF3B16433699460 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | D7A50C65861DD45AAB6470339DF3B16433699460 36 | IDESourceControlWCCName 37 | Chapter%2002 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | THIS LICENSE AGREEMENT, is between you (the “Licensee”), and Razeware LLC (http://www.raywenderlich.com) (the “Licensor”). By purchasing, downloading, or using any art licensed by Razeware LLC, you agree to the following: 2 | 3 | 4 | Ownership of Work 5 | 6 | Licensor owns all proprietary rights in and to all copyrightable works, generally described as game art, all of which are displayed and viewable at http://www.gameartguppy.com (the “Work”), and has the exclusive right to license others to produce, copy, make, or sell the Work. 7 | 8 | 9 | Grant of License 10 | 11 | Licensee is granted a non-exclusive, non-transferrable license to use the Work, royalty free, for personal and commercial projects, including games and apps created for the computer, web, or smartphone/tablet. Licensee may modify Work. 12 | 13 | 14 | License Prohibitions 15 | 16 | Licensee may not: 17 | a) Resell game art, or resell modified game art. 18 | b) Use game art in a template of any nature for distribution or sale to third parties. 19 | c) Place licensed art on any website in a complete or archived downloadable format. 20 | 21 | Assignment 22 | 23 | Licensee may not convey, sublicense, assign, transfer, pledge, hypothecate, encumber or otherwise dispose of this Agreement without the prior written consent of the Licensor. 24 | 25 | 26 | Indemnification 27 | 28 | Licensee shall fully indemnify, defend, and hold harmless Licensor from and against any and all claims, losses, damages, expenses, and liability. 29 | 30 | 31 | Acknowledgement 32 | 33 | YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT AND UNDERSTAND IT PRIOR TO AGREEING TO IT. YOU AGREE TO BE BOUND BY THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU FURTHER AGREE THAT IT IS THE COMPLETE AND EXCLUSIVE STATEMENT OF THE AGREEMENT BETWEEN YOU AND RAZEWARE LLC, WHICH SUPERSEDES ANY PROPOSAL OR PRIOR AGREEMENT, ORAL OR WRITTEN, AND ANY OTHER COMMUNICATION BETWEEN YOU AND RAZEWARE LLC RELATING TO THE SUBJECT OF THIS AGREEMENT. -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/xcuserdata/xlx.xcuserdatad/xcschemes/BahamaAirLoginScreen.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/xcuserdata/marin.xcuserdatad/xcschemes/BahamaAirLoginScreen.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9C4319691A0C32D80085829B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C4319681A0C32D80085829B /* AppDelegate.swift */; }; 11 | 9C43196B1A0C32D80085829B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C43196A1A0C32D80085829B /* ViewController.swift */; }; 12 | 9C43196E1A0C32D90085829B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9C43196C1A0C32D90085829B /* Main.storyboard */; }; 13 | 9C4319701A0C32D90085829B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9C43196F1A0C32D90085829B /* Images.xcassets */; }; 14 | 9C4319731A0C32D90085829B /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9C4319711A0C32D90085829B /* LaunchScreen.xib */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 9C4319631A0C32D80085829B /* BahamaAirLoginScreen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BahamaAirLoginScreen.app; sourceTree = BUILT_PRODUCTS_DIR; }; 19 | 9C4319671A0C32D80085829B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 20 | 9C4319681A0C32D80085829B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 9C43196A1A0C32D80085829B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 9C43196D1A0C32D90085829B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 9C43196F1A0C32D90085829B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 24 | 9C4319721A0C32D90085829B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | 9C4319601A0C32D80085829B /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 9C43195A1A0C32D80085829B = { 39 | isa = PBXGroup; 40 | children = ( 41 | 9C4319651A0C32D80085829B /* BahamaAirLoginScreen */, 42 | 9C4319641A0C32D80085829B /* Products */, 43 | ); 44 | sourceTree = ""; 45 | }; 46 | 9C4319641A0C32D80085829B /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 9C4319631A0C32D80085829B /* BahamaAirLoginScreen.app */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 9C4319651A0C32D80085829B /* BahamaAirLoginScreen */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 9C4319681A0C32D80085829B /* AppDelegate.swift */, 58 | 9C43196A1A0C32D80085829B /* ViewController.swift */, 59 | 9C43196C1A0C32D90085829B /* Main.storyboard */, 60 | 9C43196F1A0C32D90085829B /* Images.xcassets */, 61 | 9C4319711A0C32D90085829B /* LaunchScreen.xib */, 62 | 9C4319661A0C32D80085829B /* Supporting Files */, 63 | ); 64 | path = BahamaAirLoginScreen; 65 | sourceTree = ""; 66 | }; 67 | 9C4319661A0C32D80085829B /* Supporting Files */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 9C4319671A0C32D80085829B /* Info.plist */, 71 | ); 72 | name = "Supporting Files"; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | 9C4319621A0C32D80085829B /* BahamaAirLoginScreen */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = 9C4319821A0C32D90085829B /* Build configuration list for PBXNativeTarget "BahamaAirLoginScreen" */; 81 | buildPhases = ( 82 | 9C43195F1A0C32D80085829B /* Sources */, 83 | 9C4319601A0C32D80085829B /* Frameworks */, 84 | 9C4319611A0C32D80085829B /* Resources */, 85 | ); 86 | buildRules = ( 87 | ); 88 | dependencies = ( 89 | ); 90 | name = BahamaAirLoginScreen; 91 | productName = BahamaAirLoginScreen; 92 | productReference = 9C4319631A0C32D80085829B /* BahamaAirLoginScreen.app */; 93 | productType = "com.apple.product-type.application"; 94 | }; 95 | /* End PBXNativeTarget section */ 96 | 97 | /* Begin PBXProject section */ 98 | 9C43195B1A0C32D80085829B /* Project object */ = { 99 | isa = PBXProject; 100 | attributes = { 101 | LastUpgradeCheck = 0610; 102 | ORGANIZATIONNAME = "Razeware LLC"; 103 | TargetAttributes = { 104 | 9C4319621A0C32D80085829B = { 105 | CreatedOnToolsVersion = 6.1; 106 | }; 107 | }; 108 | }; 109 | buildConfigurationList = 9C43195E1A0C32D80085829B /* Build configuration list for PBXProject "BahamaAirLoginScreen" */; 110 | compatibilityVersion = "Xcode 3.2"; 111 | developmentRegion = English; 112 | hasScannedForEncodings = 0; 113 | knownRegions = ( 114 | en, 115 | Base, 116 | ); 117 | mainGroup = 9C43195A1A0C32D80085829B; 118 | productRefGroup = 9C4319641A0C32D80085829B /* Products */; 119 | projectDirPath = ""; 120 | projectRoot = ""; 121 | targets = ( 122 | 9C4319621A0C32D80085829B /* BahamaAirLoginScreen */, 123 | ); 124 | }; 125 | /* End PBXProject section */ 126 | 127 | /* Begin PBXResourcesBuildPhase section */ 128 | 9C4319611A0C32D80085829B /* Resources */ = { 129 | isa = PBXResourcesBuildPhase; 130 | buildActionMask = 2147483647; 131 | files = ( 132 | 9C43196E1A0C32D90085829B /* Main.storyboard in Resources */, 133 | 9C4319731A0C32D90085829B /* LaunchScreen.xib in Resources */, 134 | 9C4319701A0C32D90085829B /* Images.xcassets in Resources */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXResourcesBuildPhase section */ 139 | 140 | /* Begin PBXSourcesBuildPhase section */ 141 | 9C43195F1A0C32D80085829B /* Sources */ = { 142 | isa = PBXSourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 9C43196B1A0C32D80085829B /* ViewController.swift in Sources */, 146 | 9C4319691A0C32D80085829B /* AppDelegate.swift in Sources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXSourcesBuildPhase section */ 151 | 152 | /* Begin PBXVariantGroup section */ 153 | 9C43196C1A0C32D90085829B /* Main.storyboard */ = { 154 | isa = PBXVariantGroup; 155 | children = ( 156 | 9C43196D1A0C32D90085829B /* Base */, 157 | ); 158 | name = Main.storyboard; 159 | sourceTree = ""; 160 | }; 161 | 9C4319711A0C32D90085829B /* LaunchScreen.xib */ = { 162 | isa = PBXVariantGroup; 163 | children = ( 164 | 9C4319721A0C32D90085829B /* Base */, 165 | ); 166 | name = LaunchScreen.xib; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXVariantGroup section */ 170 | 171 | /* Begin XCBuildConfiguration section */ 172 | 9C4319801A0C32D90085829B /* Debug */ = { 173 | isa = XCBuildConfiguration; 174 | buildSettings = { 175 | ALWAYS_SEARCH_USER_PATHS = NO; 176 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 177 | CLANG_CXX_LIBRARY = "libc++"; 178 | CLANG_ENABLE_MODULES = YES; 179 | CLANG_ENABLE_OBJC_ARC = YES; 180 | CLANG_WARN_BOOL_CONVERSION = YES; 181 | CLANG_WARN_CONSTANT_CONVERSION = YES; 182 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 183 | CLANG_WARN_EMPTY_BODY = YES; 184 | CLANG_WARN_ENUM_CONVERSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 187 | CLANG_WARN_UNREACHABLE_CODE = YES; 188 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 189 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 190 | COPY_PHASE_STRIP = NO; 191 | ENABLE_STRICT_OBJC_MSGSEND = YES; 192 | GCC_C_LANGUAGE_STANDARD = gnu99; 193 | GCC_DYNAMIC_NO_PIC = NO; 194 | GCC_OPTIMIZATION_LEVEL = 0; 195 | GCC_PREPROCESSOR_DEFINITIONS = ( 196 | "DEBUG=1", 197 | "$(inherited)", 198 | ); 199 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 200 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 201 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 202 | GCC_WARN_UNDECLARED_SELECTOR = YES; 203 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 204 | GCC_WARN_UNUSED_FUNCTION = YES; 205 | GCC_WARN_UNUSED_VARIABLE = YES; 206 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 207 | MTL_ENABLE_DEBUG_INFO = YES; 208 | ONLY_ACTIVE_ARCH = YES; 209 | SDKROOT = iphoneos; 210 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 211 | }; 212 | name = Debug; 213 | }; 214 | 9C4319811A0C32D90085829B /* Release */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | ALWAYS_SEARCH_USER_PATHS = NO; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BOOL_CONVERSION = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_EMPTY_BODY = YES; 226 | CLANG_WARN_ENUM_CONVERSION = YES; 227 | CLANG_WARN_INT_CONVERSION = YES; 228 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 229 | CLANG_WARN_UNREACHABLE_CODE = YES; 230 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 231 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 232 | COPY_PHASE_STRIP = YES; 233 | ENABLE_NS_ASSERTIONS = NO; 234 | ENABLE_STRICT_OBJC_MSGSEND = YES; 235 | GCC_C_LANGUAGE_STANDARD = gnu99; 236 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 237 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 238 | GCC_WARN_UNDECLARED_SELECTOR = YES; 239 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 240 | GCC_WARN_UNUSED_FUNCTION = YES; 241 | GCC_WARN_UNUSED_VARIABLE = YES; 242 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 243 | MTL_ENABLE_DEBUG_INFO = NO; 244 | SDKROOT = iphoneos; 245 | VALIDATE_PRODUCT = YES; 246 | }; 247 | name = Release; 248 | }; 249 | 9C4319831A0C32D90085829B /* Debug */ = { 250 | isa = XCBuildConfiguration; 251 | buildSettings = { 252 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 253 | INFOPLIST_FILE = BahamaAirLoginScreen/Info.plist; 254 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 255 | PRODUCT_NAME = "$(TARGET_NAME)"; 256 | }; 257 | name = Debug; 258 | }; 259 | 9C4319841A0C32D90085829B /* Release */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 263 | INFOPLIST_FILE = BahamaAirLoginScreen/Info.plist; 264 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 265 | PRODUCT_NAME = "$(TARGET_NAME)"; 266 | }; 267 | name = Release; 268 | }; 269 | /* End XCBuildConfiguration section */ 270 | 271 | /* Begin XCConfigurationList section */ 272 | 9C43195E1A0C32D80085829B /* Build configuration list for PBXProject "BahamaAirLoginScreen" */ = { 273 | isa = XCConfigurationList; 274 | buildConfigurations = ( 275 | 9C4319801A0C32D90085829B /* Debug */, 276 | 9C4319811A0C32D90085829B /* Release */, 277 | ); 278 | defaultConfigurationIsVisible = 0; 279 | defaultConfigurationName = Release; 280 | }; 281 | 9C4319821A0C32D90085829B /* Build configuration list for PBXNativeTarget "BahamaAirLoginScreen" */ = { 282 | isa = XCConfigurationList; 283 | buildConfigurations = ( 284 | 9C4319831A0C32D90085829B /* Debug */, 285 | 9C4319841A0C32D90085829B /* Release */, 286 | ); 287 | defaultConfigurationIsVisible = 0; 288 | defaultConfigurationName = Release; 289 | }; 290 | /* End XCConfigurationList section */ 291 | }; 292 | rootObject = 9C43195B1A0C32D80085829B /* Project object */; 293 | } 294 | -------------------------------------------------------------------------------- /BahamaAirLoginScreen/ViewController.swift: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 Razeware LLC 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | import UIKit 24 | 25 | // A delay function 26 | func delay(#seconds: Double, completion:()->()) { 27 | let popTime = dispatch_time(DISPATCH_TIME_NOW, Int64( Double(NSEC_PER_SEC) * seconds )) 28 | 29 | dispatch_after(popTime, dispatch_get_main_queue()) { 30 | completion() 31 | } 32 | } 33 | 34 | func tintBackgroundColor(#layer: CALayer, #toColor: UIColor) { 35 | 36 | let tint = CABasicAnimation(keyPath: "backgroundColor") 37 | tint.fromValue = layer.backgroundColor 38 | tint.toValue = toColor.CGColor 39 | tint.duration = 1.0 40 | layer.addAnimation(tint, forKey: nil) 41 | layer.backgroundColor = toColor.CGColor 42 | } 43 | 44 | func roundCorners(#layer: CALayer, #toRadius: CGFloat) { 45 | 46 | let round = CABasicAnimation(keyPath: "cornerRadius") 47 | round.fromValue = layer.cornerRadius 48 | round.toValue = toRadius 49 | round.duration = 0.33 50 | layer.addAnimation(round, forKey: nil) 51 | layer.cornerRadius = toRadius 52 | } 53 | 54 | class ViewController: UIViewController { 55 | 56 | // MARK: IB outlets 57 | 58 | @IBOutlet var loginButton: UIButton! 59 | @IBOutlet var heading: UILabel! 60 | @IBOutlet var username: UITextField! 61 | @IBOutlet var password: UITextField! 62 | 63 | @IBOutlet var cloud1: UIImageView! 64 | @IBOutlet var cloud2: UIImageView! 65 | @IBOutlet var cloud3: UIImageView! 66 | @IBOutlet var cloud4: UIImageView! 67 | 68 | // MARK: further UI 69 | 70 | let spinner = UIActivityIndicatorView(activityIndicatorStyle: .WhiteLarge) 71 | let status = UIImageView(image: UIImage(named: "banner")) 72 | let label = UILabel() 73 | let messages = ["Connecting ...", "Authorizing ...", "Sending credentials ...", "Failed"] 74 | 75 | var statusPosition = CGPoint.zeroPoint 76 | let info = UILabel() 77 | 78 | // MARK: view controller methods 79 | 80 | override func viewDidLoad() { 81 | super.viewDidLoad() 82 | 83 | //set up the UI 84 | loginButton.layer.cornerRadius = 8.0 85 | loginButton.layer.masksToBounds = true 86 | 87 | spinner.frame = CGRect(x: -20.0, y: 6.0, width: 20.0, height: 20.0) 88 | spinner.startAnimating() 89 | spinner.alpha = 0.0 90 | loginButton.addSubview(spinner) 91 | 92 | status.hidden = true 93 | status.center = loginButton.center 94 | view.addSubview(status) 95 | 96 | label.frame = CGRect(x: 0.0, y: 0.0, width: status.frame.size.width, height: status.frame.size.height) 97 | label.font = UIFont(name: "HelveticaNeue", size: 18.0) 98 | label.textColor = UIColor(red: 0.89, green: 0.38, blue: 0.0, alpha: 1.0) 99 | label.textAlignment = .Center 100 | status.addSubview(label) 101 | 102 | statusPosition = status.center 103 | 104 | info.frame = CGRect(x: 0.0, y: loginButton.center.y + 60.0, 105 | width: view.frame.size.width, height: 30) 106 | info.backgroundColor = UIColor.clearColor() 107 | info.font = UIFont(name: "HelveticaNeue", size: 12.0) 108 | info.textAlignment = .Center 109 | info.textColor = UIColor.whiteColor() 110 | info.text = "Tap on a field and enter username and password" 111 | view.insertSubview(info, belowSubview: loginButton) 112 | 113 | } 114 | 115 | override func viewWillAppear(animated: Bool) { 116 | super.viewWillAppear(animated) 117 | 118 | delay(seconds: 5.0, { 119 | println("where are the fields?") 120 | }) 121 | 122 | let fadeIn = CABasicAnimation(keyPath: "opacity") 123 | fadeIn.fromValue = 0.0 124 | fadeIn.toValue = 1.0 125 | fadeIn.duration = 0.5 126 | fadeIn.fillMode = kCAFillModeBackwards 127 | fadeIn.beginTime = CACurrentMediaTime() + 0.5 128 | cloud1.layer.addAnimation(fadeIn, forKey: nil) 129 | 130 | fadeIn.beginTime = CACurrentMediaTime() + 0.7 131 | cloud2.layer.addAnimation(fadeIn, forKey: nil) 132 | 133 | fadeIn.beginTime = CACurrentMediaTime() + 0.9 134 | cloud3.layer.addAnimation(fadeIn, forKey: nil) 135 | 136 | fadeIn.beginTime = CACurrentMediaTime() + 1.1 137 | cloud4.layer.addAnimation(fadeIn, forKey: nil) 138 | } 139 | 140 | override func viewDidAppear(animated: Bool) { 141 | super.viewDidAppear(animated) 142 | 143 | let formGroup = CAAnimationGroup() 144 | formGroup.duration = 0.5 145 | formGroup.fillMode = kCAFillModeBackwards 146 | 147 | let flyRight = CABasicAnimation(keyPath: "position.x") 148 | flyRight.fromValue = -view.bounds.size.width/2 149 | flyRight.toValue = view.bounds.size.width/2 150 | 151 | let fadeFieldIn = CABasicAnimation(keyPath: "opacity") 152 | fadeFieldIn.fromValue = 0.25 153 | fadeFieldIn.toValue = 1.0 154 | 155 | formGroup.animations = [flyRight, fadeFieldIn] 156 | heading.layer.addAnimation(formGroup, forKey: nil) 157 | 158 | formGroup.delegate = self 159 | formGroup.setValue("form", forKey: "name") 160 | formGroup.setValue(username.layer, forKey: "layer") 161 | 162 | formGroup.beginTime = CACurrentMediaTime() + 0.3 163 | username.layer.addAnimation(formGroup, forKey: nil) 164 | 165 | formGroup.setValue(password.layer, forKey: "layer") 166 | formGroup.beginTime = CACurrentMediaTime() + 0.4 167 | password.layer.addAnimation(formGroup, forKey: nil) 168 | 169 | let groupAnimation = CAAnimationGroup() 170 | groupAnimation.beginTime = CACurrentMediaTime() + 0.5 171 | groupAnimation.duration = 0.5 172 | groupAnimation.fillMode = kCAFillModeBackwards 173 | groupAnimation.timingFunction = CAMediaTimingFunction( 174 | name: kCAMediaTimingFunctionEaseIn) 175 | 176 | let scaleDown = CABasicAnimation(keyPath: "transform.scale") 177 | scaleDown.fromValue = 3.5 178 | scaleDown.toValue = 1.0 179 | 180 | let rotate = CABasicAnimation(keyPath: "transform.rotation") 181 | rotate.fromValue = CGFloat(M_PI_4) 182 | rotate.toValue = 0.0 183 | 184 | let fade = CABasicAnimation(keyPath: "opacity") 185 | fade.fromValue = 0.0 186 | fade.toValue = 1.0 187 | 188 | groupAnimation.animations = [scaleDown, rotate, fade] 189 | loginButton.layer.addAnimation(groupAnimation, forKey: nil) 190 | 191 | animateCloud(cloud1.layer) 192 | animateCloud(cloud2.layer) 193 | animateCloud(cloud3.layer) 194 | animateCloud(cloud4.layer) 195 | 196 | let flyLeft = CABasicAnimation(keyPath: "position.x") 197 | flyLeft.fromValue = info.layer.position.x + 198 | view.frame.size.width 199 | flyLeft.toValue = info.layer.position.x 200 | flyLeft.duration = 5.0 201 | info.layer.addAnimation(flyLeft, forKey: "infoappear") 202 | 203 | let fadeLabelIn = CABasicAnimation(keyPath: "opacity") 204 | fadeLabelIn.fromValue = 0.2 205 | fadeLabelIn.toValue = 1.0 206 | fadeLabelIn.duration = 4.5 207 | info.layer.addAnimation(fadeLabelIn, forKey: "fadein") 208 | 209 | username.delegate = self 210 | password.delegate = self 211 | } 212 | 213 | // MARK: further methods 214 | 215 | @IBAction func login() { 216 | 217 | UIView.animateWithDuration(1.5, delay: 0.0, usingSpringWithDamping: 0.2, initialSpringVelocity: 0.0, options: nil, animations: { 218 | self.loginButton.bounds.size.width += 80.0 219 | }, completion: nil) 220 | 221 | UIView.animateWithDuration(0.33, delay: 0.0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.0, options: nil, animations: { 222 | self.loginButton.center.y += 60.0 223 | 224 | self.spinner.center = CGPoint(x: 40.0, y: self.loginButton.frame.size.height/2) 225 | self.spinner.alpha = 1.0 226 | 227 | }, completion: {_ in 228 | self.showMessage(index: 0) 229 | }) 230 | 231 | let tintColor = UIColor(red: 0.85, green: 0.83, blue: 0.45, alpha: 1.0) 232 | tintBackgroundColor(layer: loginButton.layer, toColor: tintColor) 233 | 234 | roundCorners(layer: loginButton.layer, toRadius: 25.0) 235 | 236 | let balloon = CALayer() 237 | balloon.contents = UIImage(named: "balloon")!.CGImage 238 | balloon.frame = CGRect(x: -50.0, y: 0.0, 239 | width: 50.0, height: 65.0) 240 | view.layer.insertSublayer(balloon, below: username.layer) 241 | 242 | let flight = CAKeyframeAnimation(keyPath: "position") 243 | flight.duration = 12.0 244 | 245 | flight.values = [ 246 | CGPoint(x: -50.0, y: 0.0), 247 | CGPoint(x: view.frame.width + 50.0, y: 160.0), 248 | CGPoint(x: -50.0, y: loginButton.center.y) 249 | ].map { NSValue(CGPoint: $0) } 250 | flight.keyTimes = [0.0, 0.5, 1.0] 251 | 252 | balloon.addAnimation(flight, forKey: nil) 253 | balloon.position = CGPoint(x: -50.0, y: loginButton.center.y) 254 | 255 | } 256 | 257 | func showMessage(#index: Int) { 258 | label.text = messages[index] 259 | 260 | UIView.transitionWithView(status, duration: 0.33, options: 261 | .CurveEaseOut | .TransitionFlipFromBottom, animations: { 262 | self.status.hidden = false 263 | }, completion: {_ in 264 | //transition completion 265 | delay(seconds: 2.0) { 266 | if index < self.messages.count-1 { 267 | self.removeMessage(index: index) 268 | } else { 269 | //reset form 270 | self.resetForm() 271 | } 272 | } 273 | }) 274 | } 275 | 276 | func removeMessage(#index: Int) { 277 | UIView.animateWithDuration(0.33, delay: 0.0, options: nil, animations: { 278 | self.status.center.x += self.view.frame.size.width 279 | }, completion: {_ in 280 | self.status.hidden = true 281 | self.status.center = self.statusPosition 282 | self.showMessage(index: index+1) 283 | }) 284 | } 285 | 286 | func resetForm() { 287 | let wobble = CAKeyframeAnimation(keyPath: "transform.rotation") 288 | wobble.duration = 0.25 289 | wobble.repeatCount = 4 290 | wobble.values = [0.0, -M_PI_4/4, 0.0, M_PI_4/4, 0.0] 291 | wobble.keyTimes = [0.0, 0.25, 0.5, 0.75, 1.0] 292 | heading.layer.addAnimation(wobble, forKey: nil) 293 | 294 | 295 | UIView.transitionWithView(status, duration: 0.2, options: .TransitionFlipFromTop, animations: { 296 | self.status.hidden = true 297 | self.status.center = self.statusPosition 298 | }, completion: nil) 299 | 300 | UIView.animateWithDuration(0.2, delay: 0.0, options: nil, animations: { 301 | self.spinner.center = CGPoint(x: -20.0, y: 16.0) 302 | self.spinner.alpha = 0.0 303 | self.loginButton.bounds.size.width -= 80.0 304 | self.loginButton.center.y -= 60.0 305 | }, completion: {_ in 306 | let tintColor = UIColor(red: 0.63, green: 0.84, blue: 0.35, alpha: 1.0) 307 | tintBackgroundColor(layer: self.loginButton.layer, toColor: tintColor) 308 | roundCorners(layer: self.loginButton.layer, toRadius: 10.0) 309 | }) 310 | } 311 | 312 | func animateCloud(layer: CALayer) { 313 | //1 314 | let cloudSpeed = 60.0 / Double(view.layer.frame.size.width) 315 | let duration: NSTimeInterval = Double(view.layer.frame.size.width - layer.frame.origin.x) * cloudSpeed 316 | 317 | //2 318 | let cloudMove = CABasicAnimation(keyPath: "position.x") 319 | cloudMove.duration = duration 320 | cloudMove.toValue = self.view.bounds.size.width + layer.bounds.width/2 321 | cloudMove.delegate = self 322 | cloudMove.setValue("cloud", forKey: "name") 323 | cloudMove.setValue(layer, forKey: "layer") 324 | 325 | layer.addAnimation(cloudMove, forKey: nil) 326 | } 327 | override func animationDidStop(anim: CAAnimation!, finished flag: Bool) { 328 | println("animation did finish") 329 | 330 | if let name = anim.valueForKey("name") as? String { 331 | if name == "form" { 332 | //form field found 333 | let layer = anim.valueForKey("layer") as? CALayer 334 | anim.setValue(nil, forKey: "layer") 335 | 336 | let pulse = CABasicAnimation(keyPath: "transform.scale") 337 | pulse.fromValue = 1.25 338 | pulse.toValue = 1.0 339 | pulse.duration = 0.25 340 | layer?.addAnimation(pulse, forKey: nil) 341 | 342 | } 343 | if name == "cloud" { 344 | if let layer = anim.valueForKey("layer") as? CALayer { 345 | anim.setValue(nil, forKey: "layer") 346 | 347 | layer.position.x = -layer.bounds.width/2 348 | delay(seconds: 0.5, { 349 | self.animateCloud(layer) 350 | }) 351 | } 352 | } 353 | } 354 | 355 | } 356 | 357 | } 358 | 359 | extension ViewController: UITextFieldDelegate { 360 | func textFieldDidBeginEditing(textField: UITextField) { 361 | println(info.layer.animationKeys()) 362 | info.layer.removeAnimationForKey("infoappear") 363 | } 364 | } 365 | 366 | --------------------------------------------------------------------------------