├── .gitignore ├── FlyToCart.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── pratik.xcuserdatad │ └── xcschemes │ ├── FlyToCart.xcscheme │ └── xcschememanagement.plist ├── FlyToCart ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── ic_cart.imageset │ │ ├── Contents.json │ │ ├── ic_cart.png │ │ ├── ic_cart@2x.png │ │ └── ic_cart@3x.png │ └── sample.imageset │ │ ├── Contents.json │ │ └── Screen Shot 2017-09-03 at 5.43.41 PM.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ProductCell.swift └── ViewController.swift ├── README.md └── image.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /FlyToCart.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 308DBC621F5C26BC005B49A7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308DBC611F5C26BC005B49A7 /* AppDelegate.swift */; }; 11 | 308DBC641F5C26BC005B49A7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308DBC631F5C26BC005B49A7 /* ViewController.swift */; }; 12 | 308DBC671F5C26BC005B49A7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 308DBC651F5C26BC005B49A7 /* Main.storyboard */; }; 13 | 308DBC691F5C26BD005B49A7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 308DBC681F5C26BD005B49A7 /* Assets.xcassets */; }; 14 | 308DBC6C1F5C26BD005B49A7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 308DBC6A1F5C26BD005B49A7 /* LaunchScreen.storyboard */; }; 15 | 308DBC741F5C2BD7005B49A7 /* ProductCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 308DBC731F5C2BD7005B49A7 /* ProductCell.swift */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 308DBC5E1F5C26BC005B49A7 /* FlyToCart.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlyToCart.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 308DBC611F5C26BC005B49A7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 308DBC631F5C26BC005B49A7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 308DBC661F5C26BC005B49A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 308DBC681F5C26BD005B49A7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 308DBC6B1F5C26BD005B49A7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 308DBC6D1F5C26BD005B49A7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 308DBC731F5C2BD7005B49A7 /* ProductCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductCell.swift; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 308DBC5B1F5C26BC005B49A7 /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 308DBC551F5C26BC005B49A7 = { 41 | isa = PBXGroup; 42 | children = ( 43 | 308DBC601F5C26BC005B49A7 /* FlyToCart */, 44 | 308DBC5F1F5C26BC005B49A7 /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 308DBC5F1F5C26BC005B49A7 /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 308DBC5E1F5C26BC005B49A7 /* FlyToCart.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 308DBC601F5C26BC005B49A7 /* FlyToCart */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 308DBC611F5C26BC005B49A7 /* AppDelegate.swift */, 60 | 308DBC631F5C26BC005B49A7 /* ViewController.swift */, 61 | 308DBC651F5C26BC005B49A7 /* Main.storyboard */, 62 | 308DBC681F5C26BD005B49A7 /* Assets.xcassets */, 63 | 308DBC6A1F5C26BD005B49A7 /* LaunchScreen.storyboard */, 64 | 308DBC6D1F5C26BD005B49A7 /* Info.plist */, 65 | 308DBC731F5C2BD7005B49A7 /* ProductCell.swift */, 66 | ); 67 | path = FlyToCart; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 308DBC5D1F5C26BC005B49A7 /* FlyToCart */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 308DBC701F5C26BD005B49A7 /* Build configuration list for PBXNativeTarget "FlyToCart" */; 76 | buildPhases = ( 77 | 308DBC5A1F5C26BC005B49A7 /* Sources */, 78 | 308DBC5B1F5C26BC005B49A7 /* Frameworks */, 79 | 308DBC5C1F5C26BC005B49A7 /* Resources */, 80 | ); 81 | buildRules = ( 82 | ); 83 | dependencies = ( 84 | ); 85 | name = FlyToCart; 86 | productName = FlyToCart; 87 | productReference = 308DBC5E1F5C26BC005B49A7 /* FlyToCart.app */; 88 | productType = "com.apple.product-type.application"; 89 | }; 90 | /* End PBXNativeTarget section */ 91 | 92 | /* Begin PBXProject section */ 93 | 308DBC561F5C26BC005B49A7 /* Project object */ = { 94 | isa = PBXProject; 95 | attributes = { 96 | LastSwiftUpdateCheck = 0830; 97 | LastUpgradeCheck = 0830; 98 | ORGANIZATIONNAME = "Pratik Lad"; 99 | TargetAttributes = { 100 | 308DBC5D1F5C26BC005B49A7 = { 101 | CreatedOnToolsVersion = 8.3.3; 102 | ProvisioningStyle = Automatic; 103 | }; 104 | }; 105 | }; 106 | buildConfigurationList = 308DBC591F5C26BC005B49A7 /* Build configuration list for PBXProject "FlyToCart" */; 107 | compatibilityVersion = "Xcode 3.2"; 108 | developmentRegion = English; 109 | hasScannedForEncodings = 0; 110 | knownRegions = ( 111 | en, 112 | Base, 113 | ); 114 | mainGroup = 308DBC551F5C26BC005B49A7; 115 | productRefGroup = 308DBC5F1F5C26BC005B49A7 /* Products */; 116 | projectDirPath = ""; 117 | projectRoot = ""; 118 | targets = ( 119 | 308DBC5D1F5C26BC005B49A7 /* FlyToCart */, 120 | ); 121 | }; 122 | /* End PBXProject section */ 123 | 124 | /* Begin PBXResourcesBuildPhase section */ 125 | 308DBC5C1F5C26BC005B49A7 /* Resources */ = { 126 | isa = PBXResourcesBuildPhase; 127 | buildActionMask = 2147483647; 128 | files = ( 129 | 308DBC6C1F5C26BD005B49A7 /* LaunchScreen.storyboard in Resources */, 130 | 308DBC691F5C26BD005B49A7 /* Assets.xcassets in Resources */, 131 | 308DBC671F5C26BC005B49A7 /* Main.storyboard in Resources */, 132 | ); 133 | runOnlyForDeploymentPostprocessing = 0; 134 | }; 135 | /* End PBXResourcesBuildPhase section */ 136 | 137 | /* Begin PBXSourcesBuildPhase section */ 138 | 308DBC5A1F5C26BC005B49A7 /* Sources */ = { 139 | isa = PBXSourcesBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | 308DBC741F5C2BD7005B49A7 /* ProductCell.swift in Sources */, 143 | 308DBC641F5C26BC005B49A7 /* ViewController.swift in Sources */, 144 | 308DBC621F5C26BC005B49A7 /* AppDelegate.swift in Sources */, 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | /* End PBXSourcesBuildPhase section */ 149 | 150 | /* Begin PBXVariantGroup section */ 151 | 308DBC651F5C26BC005B49A7 /* Main.storyboard */ = { 152 | isa = PBXVariantGroup; 153 | children = ( 154 | 308DBC661F5C26BC005B49A7 /* Base */, 155 | ); 156 | name = Main.storyboard; 157 | sourceTree = ""; 158 | }; 159 | 308DBC6A1F5C26BD005B49A7 /* LaunchScreen.storyboard */ = { 160 | isa = PBXVariantGroup; 161 | children = ( 162 | 308DBC6B1F5C26BD005B49A7 /* Base */, 163 | ); 164 | name = LaunchScreen.storyboard; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXVariantGroup section */ 168 | 169 | /* Begin XCBuildConfiguration section */ 170 | 308DBC6E1F5C26BD005B49A7 /* Debug */ = { 171 | isa = XCBuildConfiguration; 172 | buildSettings = { 173 | ALWAYS_SEARCH_USER_PATHS = NO; 174 | CLANG_ANALYZER_NONNULL = YES; 175 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 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_DOCUMENTATION_COMMENTS = YES; 184 | CLANG_WARN_EMPTY_BODY = YES; 185 | CLANG_WARN_ENUM_CONVERSION = YES; 186 | CLANG_WARN_INFINITE_RECURSION = YES; 187 | CLANG_WARN_INT_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 190 | CLANG_WARN_UNREACHABLE_CODE = YES; 191 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 192 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 193 | COPY_PHASE_STRIP = NO; 194 | DEBUG_INFORMATION_FORMAT = dwarf; 195 | ENABLE_STRICT_OBJC_MSGSEND = YES; 196 | ENABLE_TESTABILITY = YES; 197 | GCC_C_LANGUAGE_STANDARD = gnu99; 198 | GCC_DYNAMIC_NO_PIC = NO; 199 | GCC_NO_COMMON_BLOCKS = YES; 200 | GCC_OPTIMIZATION_LEVEL = 0; 201 | GCC_PREPROCESSOR_DEFINITIONS = ( 202 | "DEBUG=1", 203 | "$(inherited)", 204 | ); 205 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 206 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 207 | GCC_WARN_UNDECLARED_SELECTOR = YES; 208 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 209 | GCC_WARN_UNUSED_FUNCTION = YES; 210 | GCC_WARN_UNUSED_VARIABLE = YES; 211 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 212 | MTL_ENABLE_DEBUG_INFO = YES; 213 | ONLY_ACTIVE_ARCH = YES; 214 | SDKROOT = iphoneos; 215 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 216 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 217 | }; 218 | name = Debug; 219 | }; 220 | 308DBC6F1F5C26BD005B49A7 /* Release */ = { 221 | isa = XCBuildConfiguration; 222 | buildSettings = { 223 | ALWAYS_SEARCH_USER_PATHS = NO; 224 | CLANG_ANALYZER_NONNULL = YES; 225 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 226 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 227 | CLANG_CXX_LIBRARY = "libc++"; 228 | CLANG_ENABLE_MODULES = YES; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_BOOL_CONVERSION = YES; 231 | CLANG_WARN_CONSTANT_CONVERSION = YES; 232 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 233 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 234 | CLANG_WARN_EMPTY_BODY = YES; 235 | CLANG_WARN_ENUM_CONVERSION = YES; 236 | CLANG_WARN_INFINITE_RECURSION = YES; 237 | CLANG_WARN_INT_CONVERSION = YES; 238 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 239 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 240 | CLANG_WARN_UNREACHABLE_CODE = YES; 241 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 242 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 243 | COPY_PHASE_STRIP = NO; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | ENABLE_NS_ASSERTIONS = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_NO_COMMON_BLOCKS = YES; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | SDKROOT = iphoneos; 258 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 259 | VALIDATE_PRODUCT = YES; 260 | }; 261 | name = Release; 262 | }; 263 | 308DBC711F5C26BD005B49A7 /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 267 | INFOPLIST_FILE = FlyToCart/Info.plist; 268 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 269 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 270 | PRODUCT_BUNDLE_IDENTIFIER = com.pratik.FlyToCart; 271 | PRODUCT_NAME = "$(TARGET_NAME)"; 272 | SWIFT_VERSION = 3.0; 273 | }; 274 | name = Debug; 275 | }; 276 | 308DBC721F5C26BD005B49A7 /* Release */ = { 277 | isa = XCBuildConfiguration; 278 | buildSettings = { 279 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 280 | INFOPLIST_FILE = FlyToCart/Info.plist; 281 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 282 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 283 | PRODUCT_BUNDLE_IDENTIFIER = com.pratik.FlyToCart; 284 | PRODUCT_NAME = "$(TARGET_NAME)"; 285 | SWIFT_VERSION = 3.0; 286 | }; 287 | name = Release; 288 | }; 289 | /* End XCBuildConfiguration section */ 290 | 291 | /* Begin XCConfigurationList section */ 292 | 308DBC591F5C26BC005B49A7 /* Build configuration list for PBXProject "FlyToCart" */ = { 293 | isa = XCConfigurationList; 294 | buildConfigurations = ( 295 | 308DBC6E1F5C26BD005B49A7 /* Debug */, 296 | 308DBC6F1F5C26BD005B49A7 /* Release */, 297 | ); 298 | defaultConfigurationIsVisible = 0; 299 | defaultConfigurationName = Release; 300 | }; 301 | 308DBC701F5C26BD005B49A7 /* Build configuration list for PBXNativeTarget "FlyToCart" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | 308DBC711F5C26BD005B49A7 /* Debug */, 305 | 308DBC721F5C26BD005B49A7 /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | }; 309 | /* End XCConfigurationList section */ 310 | }; 311 | rootObject = 308DBC561F5C26BC005B49A7 /* Project object */; 312 | } 313 | -------------------------------------------------------------------------------- /FlyToCart.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FlyToCart.xcodeproj/xcuserdata/pratik.xcuserdatad/xcschemes/FlyToCart.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /FlyToCart.xcodeproj/xcuserdata/pratik.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FlyToCart.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 308DBC5D1F5C26BC005B49A7 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /FlyToCart/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FlyToCart 4 | // 5 | // Created by Pratik Lad on 03/09/17. 6 | // Copyright © 2017 Pratik Lad. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/ic_cart.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_cart.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_cart@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_cart@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pratik-123/FlyToCart/d3aecc70317e14ce31933faa811cbac33040da7d/FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart.png -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pratik-123/FlyToCart/d3aecc70317e14ce31933faa811cbac33040da7d/FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart@2x.png -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pratik-123/FlyToCart/d3aecc70317e14ce31933faa811cbac33040da7d/FlyToCart/Assets.xcassets/ic_cart.imageset/ic_cart@3x.png -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/sample.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Screen Shot 2017-09-03 at 5.43.41 PM.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 | } -------------------------------------------------------------------------------- /FlyToCart/Assets.xcassets/sample.imageset/Screen Shot 2017-09-03 at 5.43.41 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pratik-123/FlyToCart/d3aecc70317e14ce31933faa811cbac33040da7d/FlyToCart/Assets.xcassets/sample.imageset/Screen Shot 2017-09-03 at 5.43.41 PM.png -------------------------------------------------------------------------------- /FlyToCart/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 | -------------------------------------------------------------------------------- /FlyToCart/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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 52 | 59 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 98 | 109 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /FlyToCart/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 | -------------------------------------------------------------------------------- /FlyToCart/ProductCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProductCell.swift 3 | // FlyToCart 4 | // 5 | // Created by Pratik Lad on 03/09/17. 6 | // Copyright © 2017 Pratik Lad. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ProductCell: UITableViewCell { 12 | @IBOutlet weak var imageViewProduct: UIImageView! 13 | 14 | override func awakeFromNib() { 15 | super.awakeFromNib() 16 | // Initialization code 17 | } 18 | 19 | override func setSelected(_ selected: Bool, animated: Bool) { 20 | super.setSelected(selected, animated: animated) 21 | 22 | // Configure the view for the selected state 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /FlyToCart/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FlyToCart 4 | // 5 | // Created by Pratik Lad on 03/09/17. 6 | // Copyright © 2017 Pratik Lad. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController , UITableViewDelegate, UITableViewDataSource{ 12 | 13 | @IBOutlet weak var buttonCart: UIButton! 14 | @IBOutlet weak var lableNoOfCartItem: UILabel! 15 | @IBOutlet weak var tableViewProduct: UITableView! 16 | 17 | var counterItem = 0 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | 22 | tableViewProduct.delegate = self 23 | tableViewProduct.dataSource = self 24 | 25 | lableNoOfCartItem.layer.cornerRadius = lableNoOfCartItem.frame.size.height / 2 26 | lableNoOfCartItem.clipsToBounds = true 27 | 28 | } 29 | 30 | //MARK: TableView Delegate method 31 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 32 | return 25 33 | } 34 | 35 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 36 | 37 | let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: ProductCell.self)) as! ProductCell 38 | 39 | 40 | return cell 41 | } 42 | 43 | 44 | @IBAction func buttonHandlerAddToCart(_ sender: UIButton) { 45 | 46 | let buttonPosition : CGPoint = sender.convert(sender.bounds.origin, to: self.tableViewProduct) 47 | 48 | let indexPath = self.tableViewProduct.indexPathForRow(at: buttonPosition)! 49 | 50 | let cell = tableViewProduct.cellForRow(at: indexPath) as! ProductCell 51 | 52 | let imageViewPosition : CGPoint = cell.imageViewProduct.convert(cell.imageViewProduct.bounds.origin, to: self.view) 53 | 54 | 55 | let imgViewTemp = UIImageView(frame: CGRect(x: imageViewPosition.x, y: imageViewPosition.y, width: cell.imageViewProduct.frame.size.width, height: cell.imageViewProduct.frame.size.height)) 56 | 57 | imgViewTemp.image = cell.imageViewProduct.image 58 | 59 | animation(tempView: imgViewTemp) 60 | 61 | } 62 | 63 | 64 | func animation(tempView : UIView) { 65 | self.view.addSubview(tempView) 66 | UIView.animate(withDuration: 1.0, 67 | animations: { 68 | tempView.animationZoom(scaleX: 1.5, y: 1.5) 69 | }, completion: { _ in 70 | 71 | UIView.animate(withDuration: 0.5, animations: { 72 | 73 | tempView.animationZoom(scaleX: 0.2, y: 0.2) 74 | tempView.animationRoted(angle: CGFloat(Double.pi)) 75 | 76 | tempView.frame.origin.x = self.buttonCart.frame.origin.x 77 | tempView.frame.origin.y = self.buttonCart.frame.origin.y 78 | 79 | }, completion: { _ in 80 | 81 | tempView.removeFromSuperview() 82 | 83 | UIView.animate(withDuration: 1.0, animations: { 84 | 85 | self.counterItem += 1 86 | self.lableNoOfCartItem.text = "\(self.counterItem)" 87 | self.buttonCart.animationZoom(scaleX: 1.4, y: 1.4) 88 | }, completion: {_ in 89 | self.buttonCart.animationZoom(scaleX: 1.0, y: 1.0) 90 | }) 91 | 92 | }) 93 | 94 | }) 95 | } 96 | } 97 | 98 | extension UIView{ 99 | func animationZoom(scaleX: CGFloat, y: CGFloat) { 100 | self.transform = CGAffineTransform(scaleX: scaleX, y: y) 101 | } 102 | 103 | func animationRoted(angle : CGFloat) { 104 | self.transform = self.transform.rotated(by: angle) 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FlyToCart 2 | Product add to cart animation like Flying to cart 3 | 4 | ![alt tag](https://github.com/pratik-123/FlyToCart/blob/master/image.png) 5 | -------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pratik-123/FlyToCart/d3aecc70317e14ce31933faa811cbac33040da7d/image.png --------------------------------------------------------------------------------