├── .gitignore ├── DotsAnimation.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── DotsAnimation ├── AppAppearance.swift ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-57x57@1x.png │ │ ├── Icon-App-57x57@2x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ ├── Contents.json │ └── img_monster.imageset │ │ ├── Contents.json │ │ └── monster.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── ConfirmationAnimatedView.swift ├── DotView.swift ├── Info.plist ├── UIColor+RGB.swift └── ViewController.swift ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | xcuserdata 4 | *.ipa 5 | *.xcuserstate 6 | 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /DotsAnimation.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9A1105541DF4622700C510D4 /* ConfirmationAnimatedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1105531DF4622700C510D4 /* ConfirmationAnimatedView.swift */; }; 11 | 9A6CB3751E9CCC9E00C73C51 /* UIColor+RGB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6CB3741E9CCC9E00C73C51 /* UIColor+RGB.swift */; }; 12 | 9AD3F5CF1E11BADB008B6C3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AD3F5CE1E11BADB008B6C3C /* Assets.xcassets */; }; 13 | 9AF9F1201D9E3F5B0048C6F9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF9F11F1D9E3F5B0048C6F9 /* AppDelegate.swift */; }; 14 | 9AF9F1221D9E3F5B0048C6F9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF9F1211D9E3F5B0048C6F9 /* ViewController.swift */; }; 15 | 9AF9F1251D9E3F5B0048C6F9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AF9F1231D9E3F5B0048C6F9 /* Main.storyboard */; }; 16 | 9AF9F12A1D9E3F5B0048C6F9 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AF9F1281D9E3F5B0048C6F9 /* LaunchScreen.storyboard */; }; 17 | 9AF9F1321D9E48940048C6F9 /* DotView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF9F1311D9E48940048C6F9 /* DotView.swift */; }; 18 | B9944AE31E30715B002F38F0 /* AppAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9944AE21E30715B002F38F0 /* AppAppearance.swift */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 9A1105531DF4622700C510D4 /* ConfirmationAnimatedView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfirmationAnimatedView.swift; sourceTree = ""; }; 23 | 9A6CB3741E9CCC9E00C73C51 /* UIColor+RGB.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+RGB.swift"; sourceTree = ""; }; 24 | 9AD3F5CE1E11BADB008B6C3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 9AF9F11C1D9E3F5B0048C6F9 /* DotsAnimation.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DotsAnimation.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | 9AF9F11F1D9E3F5B0048C6F9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | 9AF9F1211D9E3F5B0048C6F9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 28 | 9AF9F1241D9E3F5B0048C6F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | 9AF9F1291D9E3F5B0048C6F9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | 9AF9F12B1D9E3F5B0048C6F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 9AF9F1311D9E48940048C6F9 /* DotView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DotView.swift; sourceTree = ""; }; 32 | B9944AE21E30715B002F38F0 /* AppAppearance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppAppearance.swift; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 9AF9F1191D9E3F5B0048C6F9 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 9AF9F1131D9E3F5B0048C6F9 = { 47 | isa = PBXGroup; 48 | children = ( 49 | 9AF9F11E1D9E3F5B0048C6F9 /* DotsAnimation */, 50 | 9AF9F11D1D9E3F5B0048C6F9 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | 9AF9F11D1D9E3F5B0048C6F9 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 9AF9F11C1D9E3F5B0048C6F9 /* DotsAnimation.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | 9AF9F11E1D9E3F5B0048C6F9 /* DotsAnimation */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 9AF9F11F1D9E3F5B0048C6F9 /* AppDelegate.swift */, 66 | 9AF9F1311D9E48940048C6F9 /* DotView.swift */, 67 | 9A1105531DF4622700C510D4 /* ConfirmationAnimatedView.swift */, 68 | 9AF9F1211D9E3F5B0048C6F9 /* ViewController.swift */, 69 | B9944AE21E30715B002F38F0 /* AppAppearance.swift */, 70 | 9A6CB3741E9CCC9E00C73C51 /* UIColor+RGB.swift */, 71 | 9AD3F5CE1E11BADB008B6C3C /* Assets.xcassets */, 72 | 9AF9F1231D9E3F5B0048C6F9 /* Main.storyboard */, 73 | 9AF9F1281D9E3F5B0048C6F9 /* LaunchScreen.storyboard */, 74 | 9AF9F12B1D9E3F5B0048C6F9 /* Info.plist */, 75 | ); 76 | path = DotsAnimation; 77 | sourceTree = ""; 78 | }; 79 | /* End PBXGroup section */ 80 | 81 | /* Begin PBXNativeTarget section */ 82 | 9AF9F11B1D9E3F5B0048C6F9 /* DotsAnimation */ = { 83 | isa = PBXNativeTarget; 84 | buildConfigurationList = 9AF9F12E1D9E3F5B0048C6F9 /* Build configuration list for PBXNativeTarget "DotsAnimation" */; 85 | buildPhases = ( 86 | 9AF9F1181D9E3F5B0048C6F9 /* Sources */, 87 | 9AF9F1191D9E3F5B0048C6F9 /* Frameworks */, 88 | 9AF9F11A1D9E3F5B0048C6F9 /* Resources */, 89 | ); 90 | buildRules = ( 91 | ); 92 | dependencies = ( 93 | ); 94 | name = DotsAnimation; 95 | productName = DotsAnimation; 96 | productReference = 9AF9F11C1D9E3F5B0048C6F9 /* DotsAnimation.app */; 97 | productType = "com.apple.product-type.application"; 98 | }; 99 | /* End PBXNativeTarget section */ 100 | 101 | /* Begin PBXProject section */ 102 | 9AF9F1141D9E3F5B0048C6F9 /* Project object */ = { 103 | isa = PBXProject; 104 | attributes = { 105 | LastSwiftUpdateCheck = 0800; 106 | LastUpgradeCheck = 0810; 107 | ORGANIZATIONNAME = "Olga Konoreva"; 108 | TargetAttributes = { 109 | 9AF9F11B1D9E3F5B0048C6F9 = { 110 | CreatedOnToolsVersion = 8.0; 111 | ProvisioningStyle = Automatic; 112 | }; 113 | }; 114 | }; 115 | buildConfigurationList = 9AF9F1171D9E3F5B0048C6F9 /* Build configuration list for PBXProject "DotsAnimation" */; 116 | compatibilityVersion = "Xcode 3.2"; 117 | developmentRegion = English; 118 | hasScannedForEncodings = 0; 119 | knownRegions = ( 120 | en, 121 | Base, 122 | ); 123 | mainGroup = 9AF9F1131D9E3F5B0048C6F9; 124 | productRefGroup = 9AF9F11D1D9E3F5B0048C6F9 /* Products */; 125 | projectDirPath = ""; 126 | projectRoot = ""; 127 | targets = ( 128 | 9AF9F11B1D9E3F5B0048C6F9 /* DotsAnimation */, 129 | ); 130 | }; 131 | /* End PBXProject section */ 132 | 133 | /* Begin PBXResourcesBuildPhase section */ 134 | 9AF9F11A1D9E3F5B0048C6F9 /* Resources */ = { 135 | isa = PBXResourcesBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | 9AF9F12A1D9E3F5B0048C6F9 /* LaunchScreen.storyboard in Resources */, 139 | 9AD3F5CF1E11BADB008B6C3C /* Assets.xcassets in Resources */, 140 | 9AF9F1251D9E3F5B0048C6F9 /* Main.storyboard in Resources */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | /* End PBXResourcesBuildPhase section */ 145 | 146 | /* Begin PBXSourcesBuildPhase section */ 147 | 9AF9F1181D9E3F5B0048C6F9 /* Sources */ = { 148 | isa = PBXSourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 9AF9F1221D9E3F5B0048C6F9 /* ViewController.swift in Sources */, 152 | 9A6CB3751E9CCC9E00C73C51 /* UIColor+RGB.swift in Sources */, 153 | 9A1105541DF4622700C510D4 /* ConfirmationAnimatedView.swift in Sources */, 154 | 9AF9F1201D9E3F5B0048C6F9 /* AppDelegate.swift in Sources */, 155 | B9944AE31E30715B002F38F0 /* AppAppearance.swift in Sources */, 156 | 9AF9F1321D9E48940048C6F9 /* DotView.swift in Sources */, 157 | ); 158 | runOnlyForDeploymentPostprocessing = 0; 159 | }; 160 | /* End PBXSourcesBuildPhase section */ 161 | 162 | /* Begin PBXVariantGroup section */ 163 | 9AF9F1231D9E3F5B0048C6F9 /* Main.storyboard */ = { 164 | isa = PBXVariantGroup; 165 | children = ( 166 | 9AF9F1241D9E3F5B0048C6F9 /* Base */, 167 | ); 168 | name = Main.storyboard; 169 | sourceTree = ""; 170 | }; 171 | 9AF9F1281D9E3F5B0048C6F9 /* LaunchScreen.storyboard */ = { 172 | isa = PBXVariantGroup; 173 | children = ( 174 | 9AF9F1291D9E3F5B0048C6F9 /* Base */, 175 | ); 176 | name = LaunchScreen.storyboard; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXVariantGroup section */ 180 | 181 | /* Begin XCBuildConfiguration section */ 182 | 9AF9F12C1D9E3F5B0048C6F9 /* Debug */ = { 183 | isa = XCBuildConfiguration; 184 | buildSettings = { 185 | ALWAYS_SEARCH_USER_PATHS = NO; 186 | CLANG_ANALYZER_NONNULL = YES; 187 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 188 | CLANG_CXX_LIBRARY = "libc++"; 189 | CLANG_ENABLE_MODULES = YES; 190 | CLANG_ENABLE_OBJC_ARC = YES; 191 | CLANG_WARN_BOOL_CONVERSION = YES; 192 | CLANG_WARN_CONSTANT_CONVERSION = YES; 193 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 194 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 195 | CLANG_WARN_EMPTY_BODY = YES; 196 | CLANG_WARN_ENUM_CONVERSION = YES; 197 | CLANG_WARN_INFINITE_RECURSION = YES; 198 | CLANG_WARN_INT_CONVERSION = YES; 199 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 200 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 201 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 202 | CLANG_WARN_UNREACHABLE_CODE = YES; 203 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 204 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 205 | COPY_PHASE_STRIP = NO; 206 | DEBUG_INFORMATION_FORMAT = dwarf; 207 | ENABLE_STRICT_OBJC_MSGSEND = YES; 208 | ENABLE_TESTABILITY = YES; 209 | GCC_C_LANGUAGE_STANDARD = gnu99; 210 | GCC_DYNAMIC_NO_PIC = NO; 211 | GCC_NO_COMMON_BLOCKS = YES; 212 | GCC_OPTIMIZATION_LEVEL = 0; 213 | GCC_PREPROCESSOR_DEFINITIONS = ( 214 | "DEBUG=1", 215 | "$(inherited)", 216 | ); 217 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 218 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 219 | GCC_WARN_UNDECLARED_SELECTOR = YES; 220 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 221 | GCC_WARN_UNUSED_FUNCTION = YES; 222 | GCC_WARN_UNUSED_VARIABLE = YES; 223 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 224 | MTL_ENABLE_DEBUG_INFO = YES; 225 | ONLY_ACTIVE_ARCH = YES; 226 | SDKROOT = iphoneos; 227 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 228 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 229 | }; 230 | name = Debug; 231 | }; 232 | 9AF9F12D1D9E3F5B0048C6F9 /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | ALWAYS_SEARCH_USER_PATHS = NO; 236 | CLANG_ANALYZER_NONNULL = YES; 237 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 238 | CLANG_CXX_LIBRARY = "libc++"; 239 | CLANG_ENABLE_MODULES = YES; 240 | CLANG_ENABLE_OBJC_ARC = YES; 241 | CLANG_WARN_BOOL_CONVERSION = YES; 242 | CLANG_WARN_CONSTANT_CONVERSION = YES; 243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 244 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 245 | CLANG_WARN_EMPTY_BODY = YES; 246 | CLANG_WARN_ENUM_CONVERSION = YES; 247 | CLANG_WARN_INFINITE_RECURSION = YES; 248 | CLANG_WARN_INT_CONVERSION = YES; 249 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 250 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 251 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 252 | CLANG_WARN_UNREACHABLE_CODE = YES; 253 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 254 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 255 | COPY_PHASE_STRIP = NO; 256 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 257 | ENABLE_NS_ASSERTIONS = NO; 258 | ENABLE_STRICT_OBJC_MSGSEND = YES; 259 | GCC_C_LANGUAGE_STANDARD = gnu99; 260 | GCC_NO_COMMON_BLOCKS = YES; 261 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 262 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 263 | GCC_WARN_UNDECLARED_SELECTOR = YES; 264 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 265 | GCC_WARN_UNUSED_FUNCTION = YES; 266 | GCC_WARN_UNUSED_VARIABLE = YES; 267 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 268 | MTL_ENABLE_DEBUG_INFO = NO; 269 | SDKROOT = iphoneos; 270 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 271 | VALIDATE_PRODUCT = YES; 272 | }; 273 | name = Release; 274 | }; 275 | 9AF9F12F1D9E3F5B0048C6F9 /* Debug */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 279 | DEVELOPMENT_TEAM = ""; 280 | INFOPLIST_FILE = DotsAnimation/Info.plist; 281 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 282 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 283 | PRODUCT_BUNDLE_IDENTIFIER = is.handsome.DotsAnimation; 284 | PRODUCT_NAME = "$(TARGET_NAME)"; 285 | SWIFT_VERSION = 3.0; 286 | }; 287 | name = Debug; 288 | }; 289 | 9AF9F1301D9E3F5B0048C6F9 /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 293 | DEVELOPMENT_TEAM = ""; 294 | INFOPLIST_FILE = DotsAnimation/Info.plist; 295 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 296 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 297 | PRODUCT_BUNDLE_IDENTIFIER = is.handsome.DotsAnimation; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | SWIFT_VERSION = 3.0; 300 | }; 301 | name = Release; 302 | }; 303 | /* End XCBuildConfiguration section */ 304 | 305 | /* Begin XCConfigurationList section */ 306 | 9AF9F1171D9E3F5B0048C6F9 /* Build configuration list for PBXProject "DotsAnimation" */ = { 307 | isa = XCConfigurationList; 308 | buildConfigurations = ( 309 | 9AF9F12C1D9E3F5B0048C6F9 /* Debug */, 310 | 9AF9F12D1D9E3F5B0048C6F9 /* Release */, 311 | ); 312 | defaultConfigurationIsVisible = 0; 313 | defaultConfigurationName = Release; 314 | }; 315 | 9AF9F12E1D9E3F5B0048C6F9 /* Build configuration list for PBXNativeTarget "DotsAnimation" */ = { 316 | isa = XCConfigurationList; 317 | buildConfigurations = ( 318 | 9AF9F12F1D9E3F5B0048C6F9 /* Debug */, 319 | 9AF9F1301D9E3F5B0048C6F9 /* Release */, 320 | ); 321 | defaultConfigurationIsVisible = 0; 322 | defaultConfigurationName = Release; 323 | }; 324 | /* End XCConfigurationList section */ 325 | }; 326 | rootObject = 9AF9F1141D9E3F5B0048C6F9 /* Project object */; 327 | } 328 | -------------------------------------------------------------------------------- /DotsAnimation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DotsAnimation/AppAppearance.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | extension UIColor { 21 | 22 | class func appBrandColor() -> UIColor { 23 | return UIColor(rgb: 0x06CFC0) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DotsAnimation/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | @UIApplicationMain 21 | class AppDelegate: UIResponder, UIApplicationDelegate { 22 | 23 | var window: UIWindow? 24 | 25 | 26 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 27 | // Override point for customization after application launch. 28 | return true 29 | } 30 | 31 | func applicationWillResignActive(_ application: UIApplication) { 32 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 34 | } 35 | 36 | func applicationDidEnterBackground(_ application: UIApplication) { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | func applicationWillEnterForeground(_ application: UIApplication) { 42 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | func applicationDidBecomeActive(_ application: UIApplication) { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | func applicationWillTerminate(_ application: UIApplication) { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "57x57", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-57x57@1x.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "57x57", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-57x57@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "60x60", 59 | "idiom" : "iphone", 60 | "filename" : "Icon-App-60x60@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "60x60", 65 | "idiom" : "iphone", 66 | "filename" : "Icon-App-60x60@3x.png", 67 | "scale" : "3x" 68 | }, 69 | { 70 | "size" : "20x20", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-20x20@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "20x20", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-20x20@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "29x29", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-29x29@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "29x29", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-29x29@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "40x40", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-40x40@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "40x40", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-40x40@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "76x76", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-76x76@1x.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "76x76", 113 | "idiom" : "ipad", 114 | "filename" : "Icon-App-76x76@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "83.5x83.5", 119 | "idiom" : "ipad", 120 | "filename" : "Icon-App-83.5x83.5@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/img_monster.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "monster.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DotsAnimation/Assets.xcassets/img_monster.imageset/monster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/handsomecode/iOS10-animations-demo/5eb77f1e7bc11c3366fa3d51372f73ce3a5a77af/DotsAnimation/Assets.xcassets/img_monster.imageset/monster.png -------------------------------------------------------------------------------- /DotsAnimation/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /DotsAnimation/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 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 62 | 63 | 64 | 65 | 66 | 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 | -------------------------------------------------------------------------------- /DotsAnimation/ConfirmationAnimatedView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | class ConfirmationAnimatedView : UIView { 21 | 22 | typealias Action = () -> () 23 | var didFinish: Action? 24 | 25 | init(color: UIColor) { 26 | super.init(frame: CGRect.zero) 27 | 28 | dotView = DotView(color: color) 29 | dotView.isHidden = true 30 | addSubview(dotView) 31 | 32 | first = createLineView(rising: false) 33 | second = createLineView(rising: true) 34 | } 35 | 36 | required init?(coder aDecoder: NSCoder) { 37 | fatalError("init(coder:) has not been implemented") 38 | } 39 | 40 | func showConfirmation(startPoint: CGPoint) { 41 | dotView.center = startPoint 42 | dotView.isHidden = false 43 | 44 | first.alpha = 1 45 | second.alpha = 1 46 | 47 | let springParameters = UISpringTimingParameters(mass: 2.2, stiffness: 300, damping: 30, initialVelocity: CGVector(dx: 0, dy: 0)) 48 | 49 | let springAnimator = UIViewPropertyAnimator(duration: 0.0, timingParameters: springParameters) 50 | springAnimator.addAnimations { 51 | self.dotView.frame = CGRect(x: startPoint.x - self.kConfirmationFinalSize / 2, y: startPoint.y - self.kConfirmationFinalSize / 2, width: self.kConfirmationFinalSize, height: self.kConfirmationFinalSize) 52 | } 53 | springAnimator.startAnimation() 54 | showCorrectMark(startPoint: startPoint) 55 | } 56 | 57 | func dotViewCenter() -> CGPoint { 58 | return dotView.center 59 | } 60 | 61 | func moveDotView(to: CGPoint) { 62 | self.dotView.center = to 63 | } 64 | 65 | 66 | ///////////////////////////////////////////////////////////////////////// 67 | // 68 | // MARK: - Private 69 | // 70 | 71 | private let kConfirmationFinalSize: CGFloat = 60 72 | private let kConfirmationOffsetHeight: CGFloat = 30 73 | 74 | private var first: LineView! 75 | private var second: LineView! 76 | 77 | private var dotView : DotView! 78 | 79 | private let controlPoint1 = CGPoint(x: 0.25, y: 0.1) 80 | private let controlPoint2 = CGPoint(x: 0.25, y: 1) 81 | 82 | private func showCorrectMark(startPoint: CGPoint) { 83 | let smallMarkSize = CGFloat(10) 84 | let bigMarkSize = CGFloat(20) 85 | self.first.frame = CGRect(x: startPoint.x - 12, y: startPoint.y, width: 0, height: 0) 86 | self.second.frame = CGRect(x: startPoint.x - 3, y: startPoint.y + smallMarkSize, width: 0, height: 0) 87 | 88 | let firstLineAnimator = UIViewPropertyAnimator(duration: 0.43, controlPoint1: self.controlPoint1, controlPoint2: self.controlPoint2) 89 | 90 | firstLineAnimator.addAnimations({ 91 | self.first.frame = CGRect(x: self.first.frame.origin.x, y: self.first.frame.origin.y, width: smallMarkSize + 1, height: smallMarkSize) 92 | self.first.setNeedsDisplay() 93 | }, delayFactor: 0.7) 94 | 95 | firstLineAnimator.addCompletion { _ in 96 | self.second.isHidden = false 97 | 98 | let secondLineAnimator = UIViewPropertyAnimator(duration: 0.13, controlPoint1: self.controlPoint1, controlPoint2: self.controlPoint2, animations: { 99 | self.second.frame = CGRect(x: self.second.frame.origin.x - 2, y: self.second.frame.origin.y - bigMarkSize, width: bigMarkSize, height: bigMarkSize) 100 | self.second.setNeedsDisplay() 101 | }) 102 | secondLineAnimator.addCompletion { _ in 103 | self.finish() 104 | } 105 | secondLineAnimator.startAnimation() 106 | } 107 | firstLineAnimator.startAnimation() 108 | } 109 | 110 | private func createLineView(rising : Bool) -> LineView { 111 | let lineView = LineView(color: UIColor.white) 112 | lineView.frame = CGRect.zero 113 | lineView.alpha = 0 114 | lineView.rising = rising 115 | addSubview(lineView) 116 | return lineView 117 | } 118 | 119 | private func finish() { 120 | let finishConfirmationAnimator = UIViewPropertyAnimator(duration: 1.1, controlPoint1: self.controlPoint1, controlPoint2: self.controlPoint2) 121 | 122 | finishConfirmationAnimator.addAnimations({ 123 | 124 | let center = self.dotView.center 125 | self.first.alpha = 0 126 | self.second.alpha = 0 127 | self.first.frame = CGRect(x: center.x, y: center.y - self.kConfirmationOffsetHeight, width: 0, height: 0) 128 | self.second.frame = CGRect(x: center.x, y: center.y - self.kConfirmationOffsetHeight, width: 0, height: 0) 129 | self.dotView.frame = CGRect(x: center.x - kDotSize / 2, y: center.y - kDotSize / 2 - self.kConfirmationOffsetHeight, width: kDotSize, height: kDotSize) 130 | }, delayFactor: 0.8) 131 | 132 | finishConfirmationAnimator.addCompletion { _ in 133 | self.didFinish?() 134 | } 135 | finishConfirmationAnimator.startAnimation() 136 | } 137 | } 138 | 139 | class LineView : UIView { 140 | 141 | private let lineWidth: CGFloat = 2.5 142 | 143 | private var color: UIColor 144 | 145 | init(color: UIColor) { 146 | self.color = color 147 | super.init(frame: CGRect.zero) 148 | backgroundColor = UIColor.clear 149 | } 150 | 151 | required init?(coder aDecoder: NSCoder) { 152 | fatalError("init(coder:) has not been implemented") 153 | } 154 | 155 | var rising = false 156 | 157 | override func draw(_ rect: CGRect) { 158 | let path = UIBezierPath() 159 | path.lineWidth = lineWidth 160 | path.lineCapStyle = .round 161 | path.lineJoinStyle = .round 162 | if rising { 163 | path.move(to: CGPoint(x: lineWidth / 2 + 1, y: rect.height - lineWidth / 2 - 1)) 164 | path.addLine(to: CGPoint(x: rect.width - lineWidth / 2 - 1, y: lineWidth / 2 + 1)) 165 | } else { 166 | path.move(to: CGPoint(x: lineWidth / 2 + 1, y: lineWidth / 2 + 1)) 167 | path.addLine(to: CGPoint(x: rect.width - lineWidth / 2 - 1, y: rect.height - lineWidth / 2 - 1)) 168 | } 169 | color.setStroke() 170 | path.stroke() 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /DotsAnimation/DotView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | let kDotSize: CGFloat = 15 21 | 22 | class DotView: UIView { 23 | 24 | private var color: UIColor 25 | 26 | init(color: UIColor) { 27 | self.color = color 28 | super.init(frame: CGRect(x: 0, y: 0, width: kDotSize, height: kDotSize)) 29 | clipsToBounds = true 30 | backgroundColor = UIColor.clear 31 | } 32 | 33 | required init?(coder aDecoder: NSCoder) { 34 | fatalError("init(coder:) has not been implemented") 35 | } 36 | 37 | override func draw(_ rect: CGRect) { 38 | guard let context = UIGraphicsGetCurrentContext() else { 39 | return 40 | } 41 | 42 | context.setFillColor(color.cgColor) 43 | context.addEllipse(in: bounds) 44 | context.drawPath(using: .fill) 45 | } 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /DotsAnimation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /DotsAnimation/UIColor+RGB.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | extension UIColor { 21 | 22 | convenience init(red: Int, green: Int, blue: Int) { 23 | assert(red >= 0 && red <= 255, "Invalid red component") 24 | assert(green >= 0 && green <= 255, "Invalid green component") 25 | assert(blue >= 0 && blue <= 255, "Invalid blue component") 26 | 27 | self.init(red: CGFloat(red) / 255.0, green: CGFloat(green) / 255.0, blue: CGFloat(blue) / 255.0, alpha: 1.0) 28 | } 29 | 30 | convenience init(rgb: Int) { 31 | self.init( 32 | red: (rgb >> 16) & 0xFF, 33 | green: (rgb >> 8) & 0xFF, 34 | blue: rgb & 0xFF 35 | ) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DotsAnimation/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Handsome. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | ///////////////////////////////////////////////////////////////////////////// 17 | 18 | import UIKit 19 | 20 | class ViewController: UIViewController { 21 | 22 | @IBOutlet weak var progressLabel: UILabel! 23 | @IBOutlet weak var startButton: UIButton! 24 | @IBOutlet weak var fakeButtonView: UIView! 25 | @IBOutlet weak var descriptionLabel: UILabel! 26 | @IBOutlet weak var logoImageView: UIImageView! 27 | 28 | override func viewDidLoad() { 29 | super.viewDidLoad() 30 | progressLabel.alpha = 0.0 31 | setupDotView(dotView: dotViewLeft) 32 | setupDotView(dotView: dotViewCenter) 33 | setupDotView(dotView: dotViewRight) 34 | fakeButtonView.clipsToBounds = true 35 | } 36 | 37 | @IBAction func startAnimationTapped(_ sender: AnyObject) { 38 | animateJumpUp() 39 | } 40 | 41 | ///////////////////////////////////////////////////////////////////////// 42 | // 43 | // MARK: - Private 44 | // 45 | 46 | private let kAnimationHeight: CGFloat = 24 47 | private let kDotsJumpsCountMax = 5 48 | private let kInitialCenterOffset: CGFloat = 40 49 | 50 | private let controlPoint1 = CGPoint(x: 0.25, y: 0.1) 51 | private let controlPoint2 = CGPoint(x: 0.25, y: 1) 52 | 53 | private let dotViewLeft = DotView(color: UIColor.appBrandColor()) 54 | private let dotViewCenter = DotView(color: UIColor.appBrandColor()) 55 | private let dotViewRight = DotView(color: UIColor.appBrandColor()) 56 | 57 | private var dotsUpAnimator: [UIViewPropertyAnimator] = [] 58 | private var timer: Timer? 59 | private var toTop = true 60 | private var buttonCenter: CGPoint! 61 | 62 | private var dotsJumpsCount = 0 63 | 64 | private func animateJumpUp() { 65 | self.buttonCenter = fakeButtonView.center 66 | self.startButton.alpha = 0 67 | let animator = UIViewPropertyAnimator(duration: 0.3, controlPoint1: controlPoint1, controlPoint2: controlPoint2, animations: { 68 | self.fakeButtonView.frame = CGRect(x: 0, y: 0, width: kDotSize, height: kDotSize) 69 | self.fakeButtonView.center = self.buttonCenter 70 | self.fakeButtonView.layer.cornerRadius = 7.0 71 | self.descriptionLabel.alpha = 0 72 | self.logoImageView.alpha = 0 73 | }) 74 | 75 | let velocity = CGVector(dx: 0, dy: 0) 76 | let springParameters = UISpringTimingParameters(mass: 1.8, stiffness: 330, damping: 33, initialVelocity: velocity) 77 | 78 | let springAnimator = UIViewPropertyAnimator(duration: 0.0, timingParameters: springParameters) 79 | springAnimator.addAnimations ({ 80 | self.fakeButtonView.center.y = self.dotViewCenter.center.y 81 | }, delayFactor: 0.3) 82 | springAnimator.addCompletion { _ in 83 | self.fakeButtonView.isHidden = true 84 | self.dotViewLeft.isHidden = false 85 | self.dotViewCenter.isHidden = false 86 | self.dotViewRight.isHidden = false 87 | self.createHorizontalDotsAnimation(isForward: true) 88 | } 89 | animator.startAnimation() 90 | springAnimator.startAnimation() 91 | } 92 | 93 | private func createHorizontalDotsAnimation(isForward: Bool) { 94 | let animator = UIViewPropertyAnimator(duration: 0.3, controlPoint1: controlPoint1, controlPoint2: controlPoint2, animations: { 95 | self.progressLabel.center.y = isForward ? self.progressLabel.center.y - 60 : 96 | self.progressLabel.center.y + 60 97 | self.progressLabel.alpha = isForward ? 1.0 : 0.0 98 | self.dotViewLeft.center.x = isForward ? self.view.center.x - self.dotViewLeft.frame.width * 1.8 : self.view.center.x 99 | self.dotViewRight.center.x = isForward ? self.view.center.x + self.dotViewLeft.frame.width * 1.8 : self.view.center.x 100 | }) 101 | if isForward { 102 | animator.addCompletion { _ in 103 | self.timer = Timer.scheduledTimer(timeInterval: 0.53, target: self, selector: #selector(self.startReversedDotsAnimation), userInfo: nil, repeats: true) 104 | self.createDotsAnimation() 105 | for dotAnimator in self.dotsUpAnimator { 106 | dotAnimator.startAnimation() 107 | } 108 | } 109 | } else { 110 | animator.addCompletion({ _ in 111 | self.dotViewLeft.isHidden = true 112 | self.dotViewCenter.isHidden = true 113 | self.dotViewRight.isHidden = true 114 | 115 | let confirmationAnimatedView = ConfirmationAnimatedView(color: UIColor.appBrandColor()) 116 | self.view.addSubview(confirmationAnimatedView) 117 | confirmationAnimatedView.didFinish = { 118 | self.fakeButtonView.frame = CGRect(x: 0, y: 0, width: kDotSize, height: kDotSize) 119 | self.fakeButtonView.center = confirmationAnimatedView.dotViewCenter() 120 | confirmationAnimatedView.removeFromSuperview() 121 | self.animateJumpDown() 122 | } 123 | confirmationAnimatedView.showConfirmation(startPoint: CGPoint(x: self.view.center.x, y: self.view.center.y - self.kInitialCenterOffset)) 124 | }) 125 | } 126 | animator.startAnimation() 127 | } 128 | 129 | private func createDotsAnimation() { 130 | let dotLeftAnimator = UIViewPropertyAnimator(duration: 0.37, controlPoint1: controlPoint1, controlPoint2: controlPoint2, animations: { 131 | self.dotViewLeft.center.y = self.dotViewLeft.center.y - self.kAnimationHeight 132 | }) 133 | dotsUpAnimator.append(dotLeftAnimator) 134 | 135 | let dotCenterAnimator = UIViewPropertyAnimator(duration: 0.43, controlPoint1: controlPoint1, controlPoint2: controlPoint2) 136 | dotCenterAnimator.addAnimations ({ 137 | self.dotViewCenter.center.y = self.dotViewCenter.center.y - self.kAnimationHeight 138 | }, delayFactor: 0.2) 139 | 140 | dotsUpAnimator.append(dotCenterAnimator) 141 | 142 | let dotRightAnimator = UIViewPropertyAnimator(duration: 0.53, controlPoint1: controlPoint1, controlPoint2: controlPoint2) 143 | dotRightAnimator.addAnimations ({ 144 | self.dotViewRight.center.y = self.dotViewRight.center.y - self.kAnimationHeight 145 | }, delayFactor: 0.32) 146 | 147 | dotsUpAnimator.append(dotRightAnimator) 148 | } 149 | 150 | @objc private func startReversedDotsAnimation() { 151 | if dotsJumpsCount < kDotsJumpsCountMax { 152 | 153 | dotsJumpsCount += 1 154 | toTop = !toTop 155 | 156 | dotsUpAnimator[0].addAnimations ({ 157 | self.dotViewLeft.center.y = self.toTop ? self.dotViewLeft.center.y - self.kAnimationHeight : self.dotViewLeft.center.y + self.kAnimationHeight 158 | }) 159 | 160 | dotsUpAnimator[1].addAnimations ({ 161 | self.dotViewCenter.center.y = self.toTop ? self.dotViewCenter.center.y - self.kAnimationHeight : self.dotViewCenter.center.y + self.kAnimationHeight 162 | }, delayFactor: 0.2) 163 | 164 | dotsUpAnimator[2].addAnimations ({ 165 | self.dotViewRight.center.y = self.toTop ? self.dotViewRight.center.y - self.kAnimationHeight : self.dotViewRight.center.y + self.kAnimationHeight 166 | }, delayFactor: 0.32) 167 | 168 | // Add complition action after finishing jumping of third dot 169 | // 170 | if dotsJumpsCount == kDotsJumpsCountMax { 171 | dotsUpAnimator[2].addCompletion { _ in 172 | self.createHorizontalDotsAnimation(isForward: false) 173 | self.dotsUpAnimator.removeAll() 174 | self.toTop = true 175 | } 176 | dotsJumpsCount = 0 177 | finishDotsProgressAnimation() 178 | } 179 | 180 | for dotAnimator in dotsUpAnimator { 181 | dotAnimator.startAnimation() 182 | } 183 | } 184 | } 185 | 186 | private func animateJumpDown() { 187 | self.descriptionLabel.center.y += 50 188 | self.logoImageView.center.y += 50 189 | let showContentAnimator = UIViewPropertyAnimator(duration: 0.5, controlPoint1: controlPoint1, controlPoint2: controlPoint2) 190 | showContentAnimator.addAnimations({ _ in 191 | self.descriptionLabel.alpha = 1 192 | self.logoImageView.alpha = 1 193 | self.descriptionLabel.center.y -= 50 194 | self.logoImageView.center.y -= 50 195 | self.fakeButtonView.frame = self.startButton.frame 196 | }, delayFactor: 0.43) 197 | 198 | showContentAnimator.addCompletion { _ in 199 | self.fakeButtonView.layer.cornerRadius = 0.0 200 | } 201 | 202 | self.fakeButtonView.isHidden = false 203 | self.fakeButtonView.layer.cornerRadius = 7.0 204 | self.fakeButtonView.clipsToBounds = true 205 | showContentAnimator.addCompletion { _ in 206 | self.fakeButtonView.layer.cornerRadius = 0.0 207 | } 208 | 209 | let showButtonTextAnimator = UIViewPropertyAnimator(duration: 0.3, controlPoint1: controlPoint1, controlPoint2: controlPoint2, animations: { 210 | self.startButton.alpha = 1 211 | }) 212 | showButtonTextAnimator.addCompletion { _ in 213 | let radiusFakeButtonAnimator = UIViewPropertyAnimator(duration: 0.3, controlPoint1: self.controlPoint1, controlPoint2: self.controlPoint2, animations: { 214 | self.fakeButtonView.layer.cornerRadius = 0.0 215 | }) 216 | radiusFakeButtonAnimator.startAnimation() 217 | } 218 | 219 | let animatorJumpDown = UIViewPropertyAnimator(duration: 0.29, controlPoint1: CGPoint(x: 0.68, y: 0), controlPoint2: CGPoint(x: 0.53, y: 1.3), animations: { 220 | self.fakeButtonView.center = self.startButton.center 221 | }) 222 | animatorJumpDown.addCompletion { _ in 223 | showButtonTextAnimator.startAnimation() 224 | } 225 | 226 | animatorJumpDown.startAnimation() 227 | showContentAnimator.startAnimation() 228 | } 229 | 230 | private func finishDotsProgressAnimation() { 231 | timer?.invalidate() 232 | timer = nil 233 | } 234 | 235 | private func setupDotView(dotView: DotView) { 236 | dotView.center = centerPoint() 237 | dotView.isHidden = true 238 | view.addSubview(dotView) 239 | } 240 | 241 | private func centerPoint() -> CGPoint { 242 | return CGPoint(x: self.view.center.x, y: self.view.center.y - kInitialCenterOffset) 243 | } 244 | } 245 | 246 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS 10 Animation demo 2 | 3 | If you like **DotsAnimation**, or the code was useful for you, please, give your :star: to this repository. 4 | 5 | **DotsAnimation sample** is a sequence of series of different, separate animations, created to demonstrate usage of iOS 10 Animations API, described in [the article](http://handsome.is/crafting-delightful-animations-in-ios-10/). 6 | 7 | ![Dots Animation Gif](https://user-images.githubusercontent.com/2081318/28453452-474e46e0-6e19-11e7-9dc0-74b463d11f9b.gif "Dots Animation") 8 | 9 | ### Here are some of the things that you’ll find in the code 10 | 11 | * Creating of Animation Objects using custom timing functions: 12 | * Cubic Bézier curves; 13 | * New *UISpringTimingParameters* that allow manipulating the mass, stiffness, damping, and initial velocity parameters; 14 | * Adding new animation blocks to existing objects on the fly (take a look into *ViewController.startReversedDotsAnimation* method); 15 | * Adding completion action on the fly (it's used to begin new animations phase, when the third dot is finishing its last jump); 16 | * Other possibilities of working with *UIViewPropertyAnimator* objects. 17 | 18 | ### Requirements 19 | - iOS 10.0+ 20 | - Xcode 8.1+ 21 | - Swift 3.0+ 22 | 23 | ### License 24 | 25 | Sample is released under the Apache License, Version 2.0. See [LICENSE](./LICENSE) file for details. 26 | 27 | 28 | 29 | --------------------------------------------------------------------------------