├── JRMBubbleTutorial.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Caroline.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Caroline.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── JRMBubbleTutorial.xcscheme │ └── xcschememanagement.plist ├── JRMBubbleTutorial ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── bubble.imageset │ │ ├── Contents.json │ │ └── bubble.png │ └── fish.imageset │ │ ├── Contents.json │ │ └── fish.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m └── README.md /JRMBubbleTutorial.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 82608D011C8F66C6005ED737 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 82608D001C8F66C6005ED737 /* main.m */; }; 11 | 82608D041C8F66C6005ED737 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 82608D031C8F66C6005ED737 /* AppDelegate.m */; }; 12 | 82608D071C8F66C6005ED737 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 82608D061C8F66C6005ED737 /* ViewController.m */; }; 13 | 82608D0A1C8F66C6005ED737 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 82608D081C8F66C6005ED737 /* Main.storyboard */; }; 14 | 82608D0C1C8F66C6005ED737 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 82608D0B1C8F66C6005ED737 /* Assets.xcassets */; }; 15 | 82608D0F1C8F66C6005ED737 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 82608D0D1C8F66C6005ED737 /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 82608CFC1C8F66C6005ED737 /* JRMBubbleTutorial.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JRMBubbleTutorial.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 82608D001C8F66C6005ED737 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 21 | 82608D021C8F66C6005ED737 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 82608D031C8F66C6005ED737 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 82608D051C8F66C6005ED737 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 24 | 82608D061C8F66C6005ED737 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 25 | 82608D091C8F66C6005ED737 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 82608D0B1C8F66C6005ED737 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 82608D0E1C8F66C6005ED737 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 82608D101C8F66C6005ED737 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 82608CF91C8F66C6005ED737 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 82608CF31C8F66C6005ED737 = { 43 | isa = PBXGroup; 44 | children = ( 45 | 82608CFE1C8F66C6005ED737 /* JRMBubbleTutorial */, 46 | 82608CFD1C8F66C6005ED737 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 82608CFD1C8F66C6005ED737 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 82608CFC1C8F66C6005ED737 /* JRMBubbleTutorial.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 82608CFE1C8F66C6005ED737 /* JRMBubbleTutorial */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 82608D021C8F66C6005ED737 /* AppDelegate.h */, 62 | 82608D031C8F66C6005ED737 /* AppDelegate.m */, 63 | 82608D051C8F66C6005ED737 /* ViewController.h */, 64 | 82608D061C8F66C6005ED737 /* ViewController.m */, 65 | 82608D081C8F66C6005ED737 /* Main.storyboard */, 66 | 82608D0B1C8F66C6005ED737 /* Assets.xcassets */, 67 | 82608D0D1C8F66C6005ED737 /* LaunchScreen.storyboard */, 68 | 82608D101C8F66C6005ED737 /* Info.plist */, 69 | 82608CFF1C8F66C6005ED737 /* Supporting Files */, 70 | ); 71 | path = JRMBubbleTutorial; 72 | sourceTree = ""; 73 | }; 74 | 82608CFF1C8F66C6005ED737 /* Supporting Files */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 82608D001C8F66C6005ED737 /* main.m */, 78 | ); 79 | name = "Supporting Files"; 80 | sourceTree = ""; 81 | }; 82 | /* End PBXGroup section */ 83 | 84 | /* Begin PBXNativeTarget section */ 85 | 82608CFB1C8F66C6005ED737 /* JRMBubbleTutorial */ = { 86 | isa = PBXNativeTarget; 87 | buildConfigurationList = 82608D131C8F66C6005ED737 /* Build configuration list for PBXNativeTarget "JRMBubbleTutorial" */; 88 | buildPhases = ( 89 | 82608CF81C8F66C6005ED737 /* Sources */, 90 | 82608CF91C8F66C6005ED737 /* Frameworks */, 91 | 82608CFA1C8F66C6005ED737 /* Resources */, 92 | ); 93 | buildRules = ( 94 | ); 95 | dependencies = ( 96 | ); 97 | name = JRMBubbleTutorial; 98 | productName = JRMBubbleTutorial; 99 | productReference = 82608CFC1C8F66C6005ED737 /* JRMBubbleTutorial.app */; 100 | productType = "com.apple.product-type.application"; 101 | }; 102 | /* End PBXNativeTarget section */ 103 | 104 | /* Begin PBXProject section */ 105 | 82608CF41C8F66C6005ED737 /* Project object */ = { 106 | isa = PBXProject; 107 | attributes = { 108 | LastUpgradeCheck = 0720; 109 | ORGANIZATIONNAME = "Caroline Harrison"; 110 | TargetAttributes = { 111 | 82608CFB1C8F66C6005ED737 = { 112 | CreatedOnToolsVersion = 7.2; 113 | }; 114 | }; 115 | }; 116 | buildConfigurationList = 82608CF71C8F66C6005ED737 /* Build configuration list for PBXProject "JRMBubbleTutorial" */; 117 | compatibilityVersion = "Xcode 3.2"; 118 | developmentRegion = English; 119 | hasScannedForEncodings = 0; 120 | knownRegions = ( 121 | en, 122 | Base, 123 | ); 124 | mainGroup = 82608CF31C8F66C6005ED737; 125 | productRefGroup = 82608CFD1C8F66C6005ED737 /* Products */; 126 | projectDirPath = ""; 127 | projectRoot = ""; 128 | targets = ( 129 | 82608CFB1C8F66C6005ED737 /* JRMBubbleTutorial */, 130 | ); 131 | }; 132 | /* End PBXProject section */ 133 | 134 | /* Begin PBXResourcesBuildPhase section */ 135 | 82608CFA1C8F66C6005ED737 /* Resources */ = { 136 | isa = PBXResourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | 82608D0F1C8F66C6005ED737 /* LaunchScreen.storyboard in Resources */, 140 | 82608D0C1C8F66C6005ED737 /* Assets.xcassets in Resources */, 141 | 82608D0A1C8F66C6005ED737 /* Main.storyboard in Resources */, 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | /* End PBXResourcesBuildPhase section */ 146 | 147 | /* Begin PBXSourcesBuildPhase section */ 148 | 82608CF81C8F66C6005ED737 /* Sources */ = { 149 | isa = PBXSourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | 82608D071C8F66C6005ED737 /* ViewController.m in Sources */, 153 | 82608D041C8F66C6005ED737 /* AppDelegate.m in Sources */, 154 | 82608D011C8F66C6005ED737 /* main.m in Sources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXSourcesBuildPhase section */ 159 | 160 | /* Begin PBXVariantGroup section */ 161 | 82608D081C8F66C6005ED737 /* Main.storyboard */ = { 162 | isa = PBXVariantGroup; 163 | children = ( 164 | 82608D091C8F66C6005ED737 /* Base */, 165 | ); 166 | name = Main.storyboard; 167 | sourceTree = ""; 168 | }; 169 | 82608D0D1C8F66C6005ED737 /* LaunchScreen.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 82608D0E1C8F66C6005ED737 /* Base */, 173 | ); 174 | name = LaunchScreen.storyboard; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXVariantGroup section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | 82608D111C8F66C6005ED737 /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BOOL_CONVERSION = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 198 | COPY_PHASE_STRIP = NO; 199 | DEBUG_INFORMATION_FORMAT = dwarf; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | ENABLE_TESTABILITY = YES; 202 | GCC_C_LANGUAGE_STANDARD = gnu99; 203 | GCC_DYNAMIC_NO_PIC = NO; 204 | GCC_NO_COMMON_BLOCKS = YES; 205 | GCC_OPTIMIZATION_LEVEL = 0; 206 | GCC_PREPROCESSOR_DEFINITIONS = ( 207 | "DEBUG=1", 208 | "$(inherited)", 209 | ); 210 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 211 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 212 | GCC_WARN_UNDECLARED_SELECTOR = YES; 213 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 214 | GCC_WARN_UNUSED_FUNCTION = YES; 215 | GCC_WARN_UNUSED_VARIABLE = YES; 216 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 217 | MTL_ENABLE_DEBUG_INFO = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = iphoneos; 220 | }; 221 | name = Debug; 222 | }; 223 | 82608D121C8F66C6005ED737 /* Release */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 228 | CLANG_CXX_LIBRARY = "libc++"; 229 | CLANG_ENABLE_MODULES = YES; 230 | CLANG_ENABLE_OBJC_ARC = YES; 231 | CLANG_WARN_BOOL_CONVERSION = YES; 232 | CLANG_WARN_CONSTANT_CONVERSION = YES; 233 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 234 | CLANG_WARN_EMPTY_BODY = YES; 235 | CLANG_WARN_ENUM_CONVERSION = YES; 236 | CLANG_WARN_INT_CONVERSION = YES; 237 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 238 | CLANG_WARN_UNREACHABLE_CODE = YES; 239 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 240 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 241 | COPY_PHASE_STRIP = NO; 242 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 243 | ENABLE_NS_ASSERTIONS = NO; 244 | ENABLE_STRICT_OBJC_MSGSEND = YES; 245 | GCC_C_LANGUAGE_STANDARD = gnu99; 246 | GCC_NO_COMMON_BLOCKS = YES; 247 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 248 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 249 | GCC_WARN_UNDECLARED_SELECTOR = YES; 250 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 251 | GCC_WARN_UNUSED_FUNCTION = YES; 252 | GCC_WARN_UNUSED_VARIABLE = YES; 253 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 254 | MTL_ENABLE_DEBUG_INFO = NO; 255 | SDKROOT = iphoneos; 256 | VALIDATE_PRODUCT = YES; 257 | }; 258 | name = Release; 259 | }; 260 | 82608D141C8F66C6005ED737 /* Debug */ = { 261 | isa = XCBuildConfiguration; 262 | buildSettings = { 263 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 264 | INFOPLIST_FILE = JRMBubbleTutorial/Info.plist; 265 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 266 | PRODUCT_BUNDLE_IDENTIFIER = "Jackrabbit-Mobile.JRMBubbleTutorial"; 267 | PRODUCT_NAME = "$(TARGET_NAME)"; 268 | }; 269 | name = Debug; 270 | }; 271 | 82608D151C8F66C6005ED737 /* Release */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 275 | INFOPLIST_FILE = JRMBubbleTutorial/Info.plist; 276 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 277 | PRODUCT_BUNDLE_IDENTIFIER = "Jackrabbit-Mobile.JRMBubbleTutorial"; 278 | PRODUCT_NAME = "$(TARGET_NAME)"; 279 | }; 280 | name = Release; 281 | }; 282 | /* End XCBuildConfiguration section */ 283 | 284 | /* Begin XCConfigurationList section */ 285 | 82608CF71C8F66C6005ED737 /* Build configuration list for PBXProject "JRMBubbleTutorial" */ = { 286 | isa = XCConfigurationList; 287 | buildConfigurations = ( 288 | 82608D111C8F66C6005ED737 /* Debug */, 289 | 82608D121C8F66C6005ED737 /* Release */, 290 | ); 291 | defaultConfigurationIsVisible = 0; 292 | defaultConfigurationName = Release; 293 | }; 294 | 82608D131C8F66C6005ED737 /* Build configuration list for PBXNativeTarget "JRMBubbleTutorial" */ = { 295 | isa = XCConfigurationList; 296 | buildConfigurations = ( 297 | 82608D141C8F66C6005ED737 /* Debug */, 298 | 82608D151C8F66C6005ED737 /* Release */, 299 | ); 300 | defaultConfigurationIsVisible = 0; 301 | }; 302 | /* End XCConfigurationList section */ 303 | }; 304 | rootObject = 82608CF41C8F66C6005ED737 /* Project object */; 305 | } 306 | -------------------------------------------------------------------------------- /JRMBubbleTutorial.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JRMBubbleTutorial.xcodeproj/project.xcworkspace/xcuserdata/Caroline.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carleihar/JRMBubbleTutorial/1bbe105a3f0510ff5d7b393496ffeec11255d0e1/JRMBubbleTutorial.xcodeproj/project.xcworkspace/xcuserdata/Caroline.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JRMBubbleTutorial.xcodeproj/xcuserdata/Caroline.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /JRMBubbleTutorial.xcodeproj/xcuserdata/Caroline.xcuserdatad/xcschemes/JRMBubbleTutorial.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 | -------------------------------------------------------------------------------- /JRMBubbleTutorial.xcodeproj/xcuserdata/Caroline.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JRMBubbleTutorial.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 82608CFB1C8F66C6005ED737 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JRMBubbleTutorial 4 | // 5 | // Created by Caroline on 3/8/16. 6 | // Copyright © 2016 Caroline Harrison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JRMBubbleTutorial 4 | // 5 | // Created by Caroline on 3/8/16. 6 | // Copyright © 2016 Caroline Harrison. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/bubble.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bubble.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 | } -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/bubble.imageset/bubble.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carleihar/JRMBubbleTutorial/1bbe105a3f0510ff5d7b393496ffeec11255d0e1/JRMBubbleTutorial/Assets.xcassets/bubble.imageset/bubble.png -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/fish.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fish.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 | } -------------------------------------------------------------------------------- /JRMBubbleTutorial/Assets.xcassets/fish.imageset/fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/carleihar/JRMBubbleTutorial/1bbe105a3f0510ff5d7b393496ffeec11255d0e1/JRMBubbleTutorial/Assets.xcassets/fish.imageset/fish.png -------------------------------------------------------------------------------- /JRMBubbleTutorial/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 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/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 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JRMBubbleTutorial 4 | // 5 | // Created by Caroline on 3/8/16. 6 | // Copyright © 2016 Caroline Harrison. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JRMBubbleTutorial 4 | // 5 | // Created by Caroline on 3/8/16. 6 | // Copyright © 2016 Caroline Harrison. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @property (strong, nonatomic) UIImageView *fishImageView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | self.fishImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.center.x - 100, self.view.center.y - 100, 200, 200)]; 23 | self.fishImageView.image = [UIImage imageNamed:@"fish"]; 24 | [self.view addSubview:self.fishImageView]; 25 | 26 | /* If you want to release the bubbles by tapping on the fish 27 | UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(createBubble)]; 28 | singleTap.numberOfTapsRequired = 1; 29 | [self.fishImageView setUserInteractionEnabled:YES]; 30 | [self.fishImageView addGestureRecognizer:singleTap]; */ 31 | 32 | [NSTimer scheduledTimerWithTimeInterval:.1 33 | target:self 34 | selector:@selector(createBubble) 35 | userInfo:nil 36 | repeats:YES]; 37 | 38 | [self goFishGo]; 39 | 40 | } 41 | 42 | - (void)goFishGo { 43 | [UIView animateWithDuration:5 animations:^{ 44 | self.fishImageView.frame = CGRectMake(self.view.frame.size.width + 200, self.view.center.y - 100, 200, 200); 45 | } completion:^(BOOL finished) { 46 | self.fishImageView.frame = CGRectMake(self.view.frame.origin.x - 200, self.view.center.y - 100, 200, 200); 47 | [self goFishGo]; 48 | }]; 49 | } 50 | 51 | - (void)createBubble { 52 | UIImageView *bubbleImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bubble"]]; 53 | 54 | CGFloat size = [self randomFloatBetween:5 and:30]; 55 | 56 | /* If you are not animating your fish, this will work fine 57 | [bubbleImageView setFrame:CGRectMake(self.fishImageView.frame.origin.x + 5, self.fishImageView.frame.origin.y + 80, size, size)]; */ 58 | 59 | // If you are animating your fish, you need to get the starting point from the 60 | // fish's presentation layer, since it will be animating at the time. 61 | [bubbleImageView setFrame:CGRectMake([self.fishImageView.layer.presentationLayer frame].origin.x + 5, [self.fishImageView.layer.presentationLayer frame].origin.y + 80, size, size)]; 62 | 63 | bubbleImageView.alpha = [self randomFloatBetween:.1 and:1]; 64 | 65 | [self.view addSubview:bubbleImageView]; 66 | 67 | UIBezierPath *zigzagPath = [[UIBezierPath alloc] init]; 68 | CGFloat oX = bubbleImageView.frame.origin.x; 69 | CGFloat oY = bubbleImageView.frame.origin.y; 70 | CGFloat eX = oX; 71 | CGFloat eY = oY - [self randomFloatBetween:50 and:300]; 72 | CGFloat t = [self randomFloatBetween:20 and:100]; 73 | CGPoint cp1 = CGPointMake(oX - t, ((oY + eY) / 2)); 74 | CGPoint cp2 = CGPointMake(oX + t, cp1.y); 75 | 76 | // randomly switch up the control points so that the bubble 77 | // swings right or left at random 78 | NSInteger r = arc4random() % 2; 79 | if (r == 1) { 80 | CGPoint temp = cp1; 81 | cp1 = cp2; 82 | cp2 = temp; 83 | } 84 | 85 | // the moveToPoint method sets the starting point of the line 86 | [zigzagPath moveToPoint:CGPointMake(oX, oY)]; 87 | // add the end point and the control points 88 | [zigzagPath addCurveToPoint:CGPointMake(eX, eY) controlPoint1:cp1 controlPoint2:cp2]; 89 | 90 | [CATransaction begin]; 91 | [CATransaction setCompletionBlock:^{ 92 | // transform the image to be 1.3 sizes larger to 93 | // give the impression that it is popping 94 | [UIView transitionWithView:bubbleImageView 95 | duration:0.1f 96 | options:UIViewAnimationOptionTransitionCrossDissolve 97 | animations:^{ 98 | bubbleImageView.transform = CGAffineTransformMakeScale(1.3, 1.3); 99 | } completion:^(BOOL finished) { 100 | [bubbleImageView removeFromSuperview]; 101 | }]; 102 | }]; 103 | 104 | CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; 105 | pathAnimation.duration = 2; 106 | pathAnimation.path = zigzagPath.CGPath; 107 | // remains visible in it's final state when animation is finished 108 | // in conjunction with removedOnCompletion 109 | pathAnimation.fillMode = kCAFillModeForwards; 110 | pathAnimation.removedOnCompletion = NO; 111 | 112 | [bubbleImageView.layer addAnimation:pathAnimation forKey:@"movingAnimation"]; 113 | 114 | [CATransaction commit]; 115 | 116 | } 117 | 118 | - (float)randomFloatBetween:(float)smallNumber and:(float)bigNumber { 119 | float diff = bigNumber - smallNumber; 120 | return (((float) (arc4random() % ((unsigned)RAND_MAX + 1)) / RAND_MAX) * diff) + smallNumber; 121 | } 122 | 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /JRMBubbleTutorial/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JRMBubbleTutorial 4 | // 5 | // Created by Caroline on 3/8/16. 6 | // Copyright © 2016 Caroline Harrison. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JRMBubbleTutorial 2 | The code from my tutorial on how to create a iOS bubble animation. 3 | 4 | You can find the tutorial at [http://www.jackrabbitmobile.com/design/ios-bubble-animation-tutorial/](http://www.jackrabbitmobile.com/design/ios-bubble-animation-tutorial/). 5 | --------------------------------------------------------------------------------