├── .gitignore ├── HYBubbleButtonDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── HYBubbleButtonDemo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── HYBubbleButton │ ├── HYBubbleButton.h │ └── HYBubbleButton.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── oval.imageset │ │ ├── Contents.json │ │ └── Oval@2x.png │ └── star.imageset │ │ ├── Contents.json │ │ └── Star1@2x.png ├── Info.plist ├── ViewController.h ├── ViewController.m └── main.m ├── HYBubbleButtonDemoTests ├── HYBubbleButtonDemoTests.m └── Info.plist ├── LICENSE ├── README.md └── screenshot └── ScreenShot.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D8A52FA01B48CFF700A70CA0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A52F9F1B48CFF700A70CA0 /* main.m */; }; 11 | D8A52FA31B48CFF700A70CA0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A52FA21B48CFF700A70CA0 /* AppDelegate.m */; }; 12 | D8A52FA61B48CFF700A70CA0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A52FA51B48CFF700A70CA0 /* ViewController.m */; }; 13 | D8A52FA91B48CFF700A70CA0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D8A52FA71B48CFF700A70CA0 /* Main.storyboard */; }; 14 | D8A52FAB1B48CFF700A70CA0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D8A52FAA1B48CFF700A70CA0 /* Images.xcassets */; }; 15 | D8A52FAE1B48CFF700A70CA0 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8A52FAC1B48CFF700A70CA0 /* LaunchScreen.xib */; }; 16 | D8A52FBA1B48CFF700A70CA0 /* HYBubbleButtonDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A52FB91B48CFF700A70CA0 /* HYBubbleButtonDemoTests.m */; }; 17 | D8A52FC61B48D0C000A70CA0 /* HYBubbleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D8A52FC51B48D0C000A70CA0 /* HYBubbleButton.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | D8A52FB41B48CFF700A70CA0 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = D8A52F921B48CFF700A70CA0 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = D8A52F991B48CFF700A70CA0; 26 | remoteInfo = HYBubbleButtonDemo; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | D8A52F9A1B48CFF700A70CA0 /* HYBubbleButtonDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HYBubbleButtonDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | D8A52F9E1B48CFF700A70CA0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | D8A52F9F1B48CFF700A70CA0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | D8A52FA11B48CFF700A70CA0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | D8A52FA21B48CFF700A70CA0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | D8A52FA41B48CFF700A70CA0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 37 | D8A52FA51B48CFF700A70CA0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 38 | D8A52FA81B48CFF700A70CA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | D8A52FAA1B48CFF700A70CA0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 40 | D8A52FAD1B48CFF700A70CA0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 41 | D8A52FB31B48CFF700A70CA0 /* HYBubbleButtonDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HYBubbleButtonDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | D8A52FB81B48CFF700A70CA0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | D8A52FB91B48CFF700A70CA0 /* HYBubbleButtonDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HYBubbleButtonDemoTests.m; sourceTree = ""; }; 44 | D8A52FC41B48D0C000A70CA0 /* HYBubbleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HYBubbleButton.h; sourceTree = ""; }; 45 | D8A52FC51B48D0C000A70CA0 /* HYBubbleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HYBubbleButton.m; sourceTree = ""; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | D8A52F971B48CFF700A70CA0 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | ); 54 | runOnlyForDeploymentPostprocessing = 0; 55 | }; 56 | D8A52FB01B48CFF700A70CA0 /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | ); 61 | runOnlyForDeploymentPostprocessing = 0; 62 | }; 63 | /* End PBXFrameworksBuildPhase section */ 64 | 65 | /* Begin PBXGroup section */ 66 | D8A52F911B48CFF700A70CA0 = { 67 | isa = PBXGroup; 68 | children = ( 69 | D8A52F9C1B48CFF700A70CA0 /* HYBubbleButtonDemo */, 70 | D8A52FB61B48CFF700A70CA0 /* HYBubbleButtonDemoTests */, 71 | D8A52F9B1B48CFF700A70CA0 /* Products */, 72 | ); 73 | sourceTree = ""; 74 | }; 75 | D8A52F9B1B48CFF700A70CA0 /* Products */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | D8A52F9A1B48CFF700A70CA0 /* HYBubbleButtonDemo.app */, 79 | D8A52FB31B48CFF700A70CA0 /* HYBubbleButtonDemoTests.xctest */, 80 | ); 81 | name = Products; 82 | sourceTree = ""; 83 | }; 84 | D8A52F9C1B48CFF700A70CA0 /* HYBubbleButtonDemo */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | D8A52FC31B48D0B900A70CA0 /* HYBubbleButton */, 88 | D8A52FA11B48CFF700A70CA0 /* AppDelegate.h */, 89 | D8A52FA21B48CFF700A70CA0 /* AppDelegate.m */, 90 | D8A52FA41B48CFF700A70CA0 /* ViewController.h */, 91 | D8A52FA51B48CFF700A70CA0 /* ViewController.m */, 92 | D8A52FA71B48CFF700A70CA0 /* Main.storyboard */, 93 | D8A52FAA1B48CFF700A70CA0 /* Images.xcassets */, 94 | D8A52FAC1B48CFF700A70CA0 /* LaunchScreen.xib */, 95 | D8A52F9D1B48CFF700A70CA0 /* Supporting Files */, 96 | ); 97 | path = HYBubbleButtonDemo; 98 | sourceTree = ""; 99 | }; 100 | D8A52F9D1B48CFF700A70CA0 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | D8A52F9E1B48CFF700A70CA0 /* Info.plist */, 104 | D8A52F9F1B48CFF700A70CA0 /* main.m */, 105 | ); 106 | name = "Supporting Files"; 107 | sourceTree = ""; 108 | }; 109 | D8A52FB61B48CFF700A70CA0 /* HYBubbleButtonDemoTests */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | D8A52FB91B48CFF700A70CA0 /* HYBubbleButtonDemoTests.m */, 113 | D8A52FB71B48CFF700A70CA0 /* Supporting Files */, 114 | ); 115 | path = HYBubbleButtonDemoTests; 116 | sourceTree = ""; 117 | }; 118 | D8A52FB71B48CFF700A70CA0 /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | D8A52FB81B48CFF700A70CA0 /* Info.plist */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | D8A52FC31B48D0B900A70CA0 /* HYBubbleButton */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | D8A52FC41B48D0C000A70CA0 /* HYBubbleButton.h */, 130 | D8A52FC51B48D0C000A70CA0 /* HYBubbleButton.m */, 131 | ); 132 | path = HYBubbleButton; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | D8A52F991B48CFF700A70CA0 /* HYBubbleButtonDemo */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = D8A52FBD1B48CFF700A70CA0 /* Build configuration list for PBXNativeTarget "HYBubbleButtonDemo" */; 141 | buildPhases = ( 142 | D8A52F961B48CFF700A70CA0 /* Sources */, 143 | D8A52F971B48CFF700A70CA0 /* Frameworks */, 144 | D8A52F981B48CFF700A70CA0 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = HYBubbleButtonDemo; 151 | productName = HYBubbleButtonDemo; 152 | productReference = D8A52F9A1B48CFF700A70CA0 /* HYBubbleButtonDemo.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | D8A52FB21B48CFF700A70CA0 /* HYBubbleButtonDemoTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = D8A52FC01B48CFF700A70CA0 /* Build configuration list for PBXNativeTarget "HYBubbleButtonDemoTests" */; 158 | buildPhases = ( 159 | D8A52FAF1B48CFF700A70CA0 /* Sources */, 160 | D8A52FB01B48CFF700A70CA0 /* Frameworks */, 161 | D8A52FB11B48CFF700A70CA0 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | D8A52FB51B48CFF700A70CA0 /* PBXTargetDependency */, 167 | ); 168 | name = HYBubbleButtonDemoTests; 169 | productName = HYBubbleButtonDemoTests; 170 | productReference = D8A52FB31B48CFF700A70CA0 /* HYBubbleButtonDemoTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | D8A52F921B48CFF700A70CA0 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0630; 180 | ORGANIZATIONNAME = nathan; 181 | TargetAttributes = { 182 | D8A52F991B48CFF700A70CA0 = { 183 | CreatedOnToolsVersion = 6.3.1; 184 | }; 185 | D8A52FB21B48CFF700A70CA0 = { 186 | CreatedOnToolsVersion = 6.3.1; 187 | TestTargetID = D8A52F991B48CFF700A70CA0; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = D8A52F951B48CFF700A70CA0 /* Build configuration list for PBXProject "HYBubbleButtonDemo" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = D8A52F911B48CFF700A70CA0; 200 | productRefGroup = D8A52F9B1B48CFF700A70CA0 /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | D8A52F991B48CFF700A70CA0 /* HYBubbleButtonDemo */, 205 | D8A52FB21B48CFF700A70CA0 /* HYBubbleButtonDemoTests */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | D8A52F981B48CFF700A70CA0 /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | D8A52FA91B48CFF700A70CA0 /* Main.storyboard in Resources */, 216 | D8A52FAE1B48CFF700A70CA0 /* LaunchScreen.xib in Resources */, 217 | D8A52FAB1B48CFF700A70CA0 /* Images.xcassets in Resources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | D8A52FB11B48CFF700A70CA0 /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | /* End PBXResourcesBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | D8A52F961B48CFF700A70CA0 /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | D8A52FC61B48D0C000A70CA0 /* HYBubbleButton.m in Sources */, 236 | D8A52FA61B48CFF700A70CA0 /* ViewController.m in Sources */, 237 | D8A52FA31B48CFF700A70CA0 /* AppDelegate.m in Sources */, 238 | D8A52FA01B48CFF700A70CA0 /* main.m in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | D8A52FAF1B48CFF700A70CA0 /* Sources */ = { 243 | isa = PBXSourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | D8A52FBA1B48CFF700A70CA0 /* HYBubbleButtonDemoTests.m in Sources */, 247 | ); 248 | runOnlyForDeploymentPostprocessing = 0; 249 | }; 250 | /* End PBXSourcesBuildPhase section */ 251 | 252 | /* Begin PBXTargetDependency section */ 253 | D8A52FB51B48CFF700A70CA0 /* PBXTargetDependency */ = { 254 | isa = PBXTargetDependency; 255 | target = D8A52F991B48CFF700A70CA0 /* HYBubbleButtonDemo */; 256 | targetProxy = D8A52FB41B48CFF700A70CA0 /* PBXContainerItemProxy */; 257 | }; 258 | /* End PBXTargetDependency section */ 259 | 260 | /* Begin PBXVariantGroup section */ 261 | D8A52FA71B48CFF700A70CA0 /* Main.storyboard */ = { 262 | isa = PBXVariantGroup; 263 | children = ( 264 | D8A52FA81B48CFF700A70CA0 /* Base */, 265 | ); 266 | name = Main.storyboard; 267 | sourceTree = ""; 268 | }; 269 | D8A52FAC1B48CFF700A70CA0 /* LaunchScreen.xib */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | D8A52FAD1B48CFF700A70CA0 /* Base */, 273 | ); 274 | name = LaunchScreen.xib; 275 | sourceTree = ""; 276 | }; 277 | /* End PBXVariantGroup section */ 278 | 279 | /* Begin XCBuildConfiguration section */ 280 | D8A52FBB1B48CFF700A70CA0 /* Debug */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 285 | CLANG_CXX_LIBRARY = "libc++"; 286 | CLANG_ENABLE_MODULES = YES; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_WARN_BOOL_CONVERSION = YES; 289 | CLANG_WARN_CONSTANT_CONVERSION = YES; 290 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 291 | CLANG_WARN_EMPTY_BODY = YES; 292 | CLANG_WARN_ENUM_CONVERSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 295 | CLANG_WARN_UNREACHABLE_CODE = YES; 296 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 297 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 298 | COPY_PHASE_STRIP = NO; 299 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 300 | ENABLE_STRICT_OBJC_MSGSEND = YES; 301 | GCC_C_LANGUAGE_STANDARD = gnu99; 302 | GCC_DYNAMIC_NO_PIC = NO; 303 | GCC_NO_COMMON_BLOCKS = YES; 304 | GCC_OPTIMIZATION_LEVEL = 0; 305 | GCC_PREPROCESSOR_DEFINITIONS = ( 306 | "DEBUG=1", 307 | "$(inherited)", 308 | ); 309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 317 | MTL_ENABLE_DEBUG_INFO = YES; 318 | ONLY_ACTIVE_ARCH = YES; 319 | SDKROOT = iphoneos; 320 | }; 321 | name = Debug; 322 | }; 323 | D8A52FBC1B48CFF700A70CA0 /* Release */ = { 324 | isa = XCBuildConfiguration; 325 | buildSettings = { 326 | ALWAYS_SEARCH_USER_PATHS = NO; 327 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 328 | CLANG_CXX_LIBRARY = "libc++"; 329 | CLANG_ENABLE_MODULES = YES; 330 | CLANG_ENABLE_OBJC_ARC = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_CONSTANT_CONVERSION = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INT_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN_UNREACHABLE_CODE = YES; 339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 340 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 341 | COPY_PHASE_STRIP = NO; 342 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 343 | ENABLE_NS_ASSERTIONS = NO; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_NO_COMMON_BLOCKS = YES; 347 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 348 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 349 | GCC_WARN_UNDECLARED_SELECTOR = YES; 350 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 351 | GCC_WARN_UNUSED_FUNCTION = YES; 352 | GCC_WARN_UNUSED_VARIABLE = YES; 353 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 354 | MTL_ENABLE_DEBUG_INFO = NO; 355 | SDKROOT = iphoneos; 356 | VALIDATE_PRODUCT = YES; 357 | }; 358 | name = Release; 359 | }; 360 | D8A52FBE1B48CFF700A70CA0 /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 364 | INFOPLIST_FILE = HYBubbleButtonDemo/Info.plist; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | }; 368 | name = Debug; 369 | }; 370 | D8A52FBF1B48CFF700A70CA0 /* Release */ = { 371 | isa = XCBuildConfiguration; 372 | buildSettings = { 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | INFOPLIST_FILE = HYBubbleButtonDemo/Info.plist; 375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 376 | PRODUCT_NAME = "$(TARGET_NAME)"; 377 | }; 378 | name = Release; 379 | }; 380 | D8A52FC11B48CFF700A70CA0 /* Debug */ = { 381 | isa = XCBuildConfiguration; 382 | buildSettings = { 383 | BUNDLE_LOADER = "$(TEST_HOST)"; 384 | FRAMEWORK_SEARCH_PATHS = ( 385 | "$(SDKROOT)/Developer/Library/Frameworks", 386 | "$(inherited)", 387 | ); 388 | GCC_PREPROCESSOR_DEFINITIONS = ( 389 | "DEBUG=1", 390 | "$(inherited)", 391 | ); 392 | INFOPLIST_FILE = HYBubbleButtonDemoTests/Info.plist; 393 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 394 | PRODUCT_NAME = "$(TARGET_NAME)"; 395 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HYBubbleButtonDemo.app/HYBubbleButtonDemo"; 396 | }; 397 | name = Debug; 398 | }; 399 | D8A52FC21B48CFF700A70CA0 /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | BUNDLE_LOADER = "$(TEST_HOST)"; 403 | FRAMEWORK_SEARCH_PATHS = ( 404 | "$(SDKROOT)/Developer/Library/Frameworks", 405 | "$(inherited)", 406 | ); 407 | INFOPLIST_FILE = HYBubbleButtonDemoTests/Info.plist; 408 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 409 | PRODUCT_NAME = "$(TARGET_NAME)"; 410 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HYBubbleButtonDemo.app/HYBubbleButtonDemo"; 411 | }; 412 | name = Release; 413 | }; 414 | /* End XCBuildConfiguration section */ 415 | 416 | /* Begin XCConfigurationList section */ 417 | D8A52F951B48CFF700A70CA0 /* Build configuration list for PBXProject "HYBubbleButtonDemo" */ = { 418 | isa = XCConfigurationList; 419 | buildConfigurations = ( 420 | D8A52FBB1B48CFF700A70CA0 /* Debug */, 421 | D8A52FBC1B48CFF700A70CA0 /* Release */, 422 | ); 423 | defaultConfigurationIsVisible = 0; 424 | defaultConfigurationName = Release; 425 | }; 426 | D8A52FBD1B48CFF700A70CA0 /* Build configuration list for PBXNativeTarget "HYBubbleButtonDemo" */ = { 427 | isa = XCConfigurationList; 428 | buildConfigurations = ( 429 | D8A52FBE1B48CFF700A70CA0 /* Debug */, 430 | D8A52FBF1B48CFF700A70CA0 /* Release */, 431 | ); 432 | defaultConfigurationIsVisible = 0; 433 | }; 434 | D8A52FC01B48CFF700A70CA0 /* Build configuration list for PBXNativeTarget "HYBubbleButtonDemoTests" */ = { 435 | isa = XCConfigurationList; 436 | buildConfigurations = ( 437 | D8A52FC11B48CFF700A70CA0 /* Debug */, 438 | D8A52FC21B48CFF700A70CA0 /* Release */, 439 | ); 440 | defaultConfigurationIsVisible = 0; 441 | }; 442 | /* End XCConfigurationList section */ 443 | }; 444 | rootObject = D8A52F921B48CFF700A70CA0 /* Project object */; 445 | } 446 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HYBubbleButtonDemo 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. 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 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HYBubbleButtonDemo 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. 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 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/HYBubbleButton/HYBubbleButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // HYBubbleButton.h 3 | // animationDemo 4 | // 5 | // Created by nathan on 15/7/4. 6 | // Copyright (c) 2015年 nathan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HYBubbleButton : UIButton 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | maxLeft:(CGFloat)maxLeft 15 | maxRight:(CGFloat)maxRight 16 | maxHeight:(CGFloat)maxHeight; 17 | 18 | 19 | @property (nonatomic, assign)CGFloat maxLeft; 20 | @property (nonatomic, assign)CGFloat maxRight; 21 | @property (nonatomic, assign)CGFloat maxHeight; 22 | @property (nonatomic, assign)CGFloat duration; 23 | @property (nonatomic, strong)NSArray *images; 24 | 25 | - (void)generateBubbleWithImage:(UIImage *)image; 26 | 27 | 28 | // you have to set images first. 29 | - (void)generateBubbleInRandom; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/HYBubbleButton/HYBubbleButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYBubbleButton.m 3 | // animationDemo 4 | // 5 | // Created by nathan on 15/7/4. 6 | // Copyright (c) 2015年 nathan. All rights reserved. 7 | // 8 | 9 | #import "HYBubbleButton.h" 10 | 11 | @implementation HYBubbleButton 12 | { 13 | CGPoint _startPoint; 14 | CGFloat _maxWidth; 15 | NSMutableSet *_recyclePool; 16 | NSMutableArray *_array; 17 | } 18 | 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame 21 | maxLeft:(CGFloat)maxLeft 22 | maxRight:(CGFloat)maxRight 23 | maxHeight:(CGFloat)maxHeight{ 24 | 25 | self = [super initWithFrame:frame]; 26 | if (self) { 27 | _maxHeight = maxHeight; 28 | _maxLeft = maxLeft; 29 | _maxRight = maxRight; 30 | 31 | [self initData]; 32 | } 33 | return self; 34 | } 35 | 36 | - (id)initWithCoder:(NSCoder *)aDecoder{ 37 | self = [super initWithCoder:aDecoder]; 38 | if (self) { 39 | 40 | [self initData]; 41 | } 42 | return self; 43 | } 44 | 45 | - (void)initData{ 46 | _array = @[].mutableCopy; 47 | _recyclePool = [NSMutableSet set]; 48 | } 49 | 50 | - (void)generateBubbleInRandom{ 51 | CALayer *layer; 52 | 53 | if (_recyclePool.count > 0) { 54 | 55 | layer = [_recyclePool anyObject]; 56 | 57 | [_recyclePool removeObject:layer]; 58 | 59 | }else{ 60 | UIImage *image = self.images[arc4random() % self.images.count]; 61 | 62 | layer = [self createLayerWithImage:image]; 63 | } 64 | 65 | [self.layer addSublayer:layer]; 66 | [self generateBubbleWithCAlayer:layer]; 67 | } 68 | 69 | - (void)generateBubbleWithImage:(UIImage *)image{ 70 | 71 | CALayer *layer = [self createLayerWithImage:image]; 72 | 73 | [self.layer addSublayer:layer]; 74 | [self generateBubbleWithCAlayer:layer]; 75 | } 76 | 77 | - (void)generateBubbleWithCAlayer:(CALayer *)layer{ 78 | 79 | _maxWidth = _maxLeft + _maxRight; 80 | 81 | _startPoint = CGPointMake(self.frame.size.width / 2, 0); 82 | 83 | CGPoint endPoint = CGPointMake(_maxWidth * [self randomFloat] - _maxLeft, -_maxHeight); 84 | CGPoint controlPoint1 = 85 | CGPointMake(_maxWidth * [self randomFloat] - _maxLeft, -_maxHeight * 0.2); 86 | CGPoint controlPoint2 = 87 | CGPointMake(_maxWidth * [self randomFloat] - _maxLeft, -_maxHeight * 0.6); 88 | 89 | CGMutablePathRef curvedPath = CGPathCreateMutable(); 90 | CGPathMoveToPoint(curvedPath, NULL, _startPoint.x, _startPoint.y); 91 | CGPathAddCurveToPoint(curvedPath, NULL, controlPoint1.x, controlPoint1.y, controlPoint2.x, controlPoint2.y, endPoint.x, endPoint.y); 92 | 93 | 94 | CAKeyframeAnimation *keyFrame = [CAKeyframeAnimation animation]; 95 | keyFrame.keyPath = @"position"; 96 | keyFrame.path = CFAutorelease(curvedPath); 97 | keyFrame.duration = self.duration; 98 | keyFrame.calculationMode = kCAAnimationPaced; 99 | 100 | [layer addAnimation:keyFrame forKey:@"keyframe"]; 101 | 102 | CABasicAnimation *scale = [CABasicAnimation animation]; 103 | scale.keyPath = @"transform.scale"; 104 | scale.toValue = @1; 105 | scale.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 0.1)]; 106 | scale.duration = 0.5; 107 | 108 | CABasicAnimation *alpha = [CABasicAnimation animation]; 109 | alpha.keyPath = @"opacity"; 110 | alpha.fromValue = @1; 111 | alpha.toValue = @0.1; 112 | alpha.duration = self.duration * 0.4; 113 | alpha.beginTime = self.duration - alpha.duration; 114 | 115 | CAAnimationGroup *group = [CAAnimationGroup animation]; 116 | group.animations = @[keyFrame, scale, alpha]; 117 | group.duration = self.duration; 118 | group.delegate = self; 119 | group.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 120 | group.fillMode = kCAFillModeForwards; 121 | group.removedOnCompletion = NO; 122 | [layer addAnimation:group forKey:@"group"]; 123 | 124 | [_array addObject:layer]; 125 | } 126 | 127 | 128 | #pragma private 129 | - (CGFloat)randomFloat{ 130 | return (arc4random() % 100)/100.0f; 131 | } 132 | 133 | - (CALayer *)createLayerWithImage:(UIImage *)image{ 134 | CGFloat scale = [UIScreen mainScreen].scale; 135 | CALayer *layer = [CALayer layer]; 136 | layer.frame = CGRectMake(0, 0, image.size.width / scale, image.size.height / scale); 137 | layer.contents = (__bridge id)image.CGImage;; 138 | return layer; 139 | } 140 | 141 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 142 | if (flag) { 143 | CALayer *layer = [_array firstObject]; 144 | [layer removeAllAnimations]; 145 | [layer removeFromSuperlayer]; 146 | [_array removeObject:layer]; 147 | [_recyclePool addObject:layer]; 148 | } 149 | } 150 | @end 151 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Images.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 | } -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Images.xcassets/oval.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Oval@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Images.xcassets/oval.imageset/Oval@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nathanwhy/HYBubbleButton/6e99836018798bd33c4166097c4f07654f41d2fe/HYBubbleButtonDemo/Images.xcassets/oval.imageset/Oval@2x.png -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Images.xcassets/star.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "Star1@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Images.xcassets/star.imageset/Star1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nathanwhy/HYBubbleButton/6e99836018798bd33c4166097c4f07654f41d2fe/HYBubbleButtonDemo/Images.xcassets/star.imageset/Star1@2x.png -------------------------------------------------------------------------------- /HYBubbleButtonDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.gear.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HYBubbleButtonDemo 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HYBubbleButtonDemo 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "HYBubbleButton.h" 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet HYBubbleButton *bubbleButton; 14 | 15 | - (IBAction)startGenerate:(id)sender; 16 | 17 | @end 18 | 19 | @implementation ViewController 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | self.bubbleButton.maxLeft = 150; 25 | self.bubbleButton.maxRight = 100; 26 | self.bubbleButton.maxHeight = 300; 27 | self.bubbleButton.duration = 8; 28 | self.bubbleButton.images = @[[UIImage imageNamed:@"oval"], [UIImage imageNamed:@"star"]]; 29 | } 30 | 31 | 32 | - (IBAction)startGenerate:(id)sender { 33 | 34 | [self.bubbleButton generateBubbleInRandom]; 35 | } 36 | @end 37 | -------------------------------------------------------------------------------- /HYBubbleButtonDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HYBubbleButtonDemo 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. 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 | -------------------------------------------------------------------------------- /HYBubbleButtonDemoTests/HYBubbleButtonDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // HYBubbleButtonDemoTests.m 3 | // HYBubbleButtonDemoTests 4 | // 5 | // Created by nathan on 15/7/5. 6 | // Copyright (c) 2015年 nathan. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface HYBubbleButtonDemoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation HYBubbleButtonDemoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /HYBubbleButtonDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.gear.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 nathan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HYBubbleButton 2 | 3 | ![screenshot](screenshot/ScreenShot.gif) 4 | 5 | ``` 6 | @interface HYBubbleButton : UIButton 7 | 8 | - (instancetype)initWithFrame:(CGRect)frame 9 | maxLeft:(CGFloat)maxLeft 10 | maxRight:(CGFloat)maxRight 11 | maxHeight:(CGFloat)maxHeight; 12 | 13 | 14 | @property (nonatomic, assign)CGFloat maxLeft; 15 | @property (nonatomic, assign)CGFloat maxRight; 16 | @property (nonatomic, assign)CGFloat maxHeight; 17 | @property (nonatomic, assign)CGFloat duration; 18 | @property (nonatomic, strong)NSArray *images; 19 | 20 | - (void)generateBubbleWithImage:(UIImage *)image; 21 | 22 | 23 | // you have to set images first. 24 | - (void)generateBubbleInRandom; 25 | ``` -------------------------------------------------------------------------------- /screenshot/ScreenShot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nathanwhy/HYBubbleButton/6e99836018798bd33c4166097c4f07654f41d2fe/screenshot/ScreenShot.gif --------------------------------------------------------------------------------